… | |
… | |
480 | unblocking the signals. |
480 | unblocking the signals. |
481 | |
481 | |
482 | It's also required by POSIX in a threaded program, as libev calls |
482 | It's also required by POSIX in a threaded program, as libev calls |
483 | C<sigprocmask>, whose behaviour is officially unspecified. |
483 | C<sigprocmask>, whose behaviour is officially unspecified. |
484 | |
484 | |
485 | This flag's behaviour will become the default in future versions of libev. |
485 | =item C<EVFLAG_NOTIMERFD> |
|
|
486 | |
|
|
487 | When this flag is specified, the libev will avoid using a C<timerfd> to |
|
|
488 | detect time jumps. It will still be able to detect time jumps, but takes |
|
|
489 | longer and has a lower accuracy in doing so, but saves a file descriptor |
|
|
490 | per loop. |
|
|
491 | |
|
|
492 | The current implementation only tries to use a C<timerfd> when the first |
|
|
493 | C<ev_periodic> watcher is started and falls back on other methods if it |
|
|
494 | cannot be created, but this behaviour might change in the future. |
486 | |
495 | |
487 | =item C<EVBACKEND_SELECT> (value 1, portable select backend) |
496 | =item C<EVBACKEND_SELECT> (value 1, portable select backend) |
488 | |
497 | |
489 | This is your standard select(2) backend. Not I<completely> standard, as |
498 | This is your standard select(2) backend. Not I<completely> standard, as |
490 | libev tries to roll its own fd_set with no limits on the number of fds, |
499 | libev tries to roll its own fd_set with no limits on the number of fds, |
… | |
… | |
666 | and is not embeddable, which would limit the usefulness of this backend |
675 | and is not embeddable, which would limit the usefulness of this backend |
667 | immensely. |
676 | immensely. |
668 | |
677 | |
669 | =item C<EVBACKEND_PORT> (value 32, Solaris 10) |
678 | =item C<EVBACKEND_PORT> (value 32, Solaris 10) |
670 | |
679 | |
671 | This uses the Solaris 10 event port mechanism. As with everything on Solaris, |
680 | This uses the Solaris 10 event port mechanism. As with everything on |
672 | it's really slow, but it still scales very well (O(active_fds)). |
681 | Solaris, it's really slow, but it still scales very well (O(active_fds)). |
673 | |
682 | |
674 | While this backend scales well, it requires one system call per active |
683 | While this backend scales well, it requires one system call per active |
675 | file descriptor per loop iteration. For small and medium numbers of file |
684 | file descriptor per loop iteration. For small and medium numbers of file |
676 | descriptors a "slow" C<EVBACKEND_SELECT> or C<EVBACKEND_POLL> backend |
685 | descriptors a "slow" C<EVBACKEND_SELECT> or C<EVBACKEND_POLL> backend |
677 | might perform better. |
686 | might perform better. |
… | |
… | |
950 | - Queue all expired timers. |
959 | - Queue all expired timers. |
951 | - Queue all expired periodics. |
960 | - Queue all expired periodics. |
952 | - Queue all idle watchers with priority higher than that of pending events. |
961 | - Queue all idle watchers with priority higher than that of pending events. |
953 | - Queue all check watchers. |
962 | - Queue all check watchers. |
954 | - Call all queued watchers in reverse order (i.e. check watchers first). |
963 | - Call all queued watchers in reverse order (i.e. check watchers first). |
955 | Signals and child watchers are implemented as I/O watchers, and will |
964 | Signals, async and child watchers are implemented as I/O watchers, and |
956 | be handled here by queueing them when their watcher gets executed. |
965 | will be handled here by queueing them when their watcher gets executed. |
957 | - If ev_break has been called, or EVRUN_ONCE or EVRUN_NOWAIT |
966 | - If ev_break has been called, or EVRUN_ONCE or EVRUN_NOWAIT |
958 | were used, or there are no active watchers, goto FINISH, otherwise |
967 | were used, or there are no active watchers, goto FINISH, otherwise |
959 | continue with step LOOP. |
968 | continue with step LOOP. |
960 | FINISH: |
969 | FINISH: |
961 | - Reset the ev_break status iff it was EVBREAK_ONE. |
970 | - Reset the ev_break status iff it was EVBREAK_ONE. |
… | |
… | |
1209 | with a watcher-specific start function (C<< ev_TYPE_start (loop, watcher |
1218 | with a watcher-specific start function (C<< ev_TYPE_start (loop, watcher |
1210 | *) >>), and you can stop watching for events at any time by calling the |
1219 | *) >>), and you can stop watching for events at any time by calling the |
1211 | corresponding stop function (C<< ev_TYPE_stop (loop, watcher *) >>. |
1220 | corresponding stop function (C<< ev_TYPE_stop (loop, watcher *) >>. |
1212 | |
1221 | |
1213 | As long as your watcher is active (has been started but not stopped) you |
1222 | As long as your watcher is active (has been started but not stopped) you |
1214 | must not touch the values stored in it. Most specifically you must never |
1223 | must not touch the values stored in it except when explicitly documented |
1215 | reinitialise it or call its C<ev_TYPE_set> macro. |
1224 | otherwise. Most specifically you must never reinitialise it or call its |
|
|
1225 | C<ev_TYPE_set> macro. |
1216 | |
1226 | |
1217 | Each and every callback receives the event loop pointer as first, the |
1227 | Each and every callback receives the event loop pointer as first, the |
1218 | registered watcher structure as second, and a bitset of received events as |
1228 | registered watcher structure as second, and a bitset of received events as |
1219 | third argument. |
1229 | third argument. |
1220 | |
1230 | |
… | |
… | |
1386 | |
1396 | |
1387 | =item bool ev_is_active (ev_TYPE *watcher) |
1397 | =item bool ev_is_active (ev_TYPE *watcher) |
1388 | |
1398 | |
1389 | Returns a true value iff the watcher is active (i.e. it has been started |
1399 | Returns a true value iff the watcher is active (i.e. it has been started |
1390 | and not yet been stopped). As long as a watcher is active you must not modify |
1400 | and not yet been stopped). As long as a watcher is active you must not modify |
1391 | it. |
1401 | it unless documented otherwise. |
|
|
1402 | |
|
|
1403 | Obviously, it is safe to call this on an active watcher, or actually any |
|
|
1404 | watcher that is initialised. |
1392 | |
1405 | |
1393 | =item bool ev_is_pending (ev_TYPE *watcher) |
1406 | =item bool ev_is_pending (ev_TYPE *watcher) |
1394 | |
1407 | |
1395 | Returns a true value iff the watcher is pending, (i.e. it has outstanding |
1408 | Returns a true value iff the watcher is pending, (i.e. it has outstanding |
1396 | events but its callback has not yet been invoked). As long as a watcher |
1409 | events but its callback has not yet been invoked). As long as a watcher |
1397 | is pending (but not active) you must not call an init function on it (but |
1410 | is pending (but not active) you must not call an init function on it (but |
1398 | C<ev_TYPE_set> is safe), you must not change its priority, and you must |
1411 | C<ev_TYPE_set> is safe), you must not change its priority, and you must |
1399 | make sure the watcher is available to libev (e.g. you cannot C<free ()> |
1412 | make sure the watcher is available to libev (e.g. you cannot C<free ()> |
1400 | it). |
1413 | it). |
1401 | |
1414 | |
|
|
1415 | It is safe to call this on any watcher in any state as long as it is |
|
|
1416 | initialised. |
|
|
1417 | |
1402 | =item callback ev_cb (ev_TYPE *watcher) |
1418 | =item callback ev_cb (ev_TYPE *watcher) |
1403 | |
1419 | |
1404 | Returns the callback currently set on the watcher. |
1420 | Returns the callback currently set on the watcher. |
1405 | |
1421 | |
1406 | =item ev_set_cb (ev_TYPE *watcher, callback) |
1422 | =item ev_set_cb (ev_TYPE *watcher, callback) |
… | |
… | |
1419 | from being executed (except for C<ev_idle> watchers). |
1435 | from being executed (except for C<ev_idle> watchers). |
1420 | |
1436 | |
1421 | If you need to suppress invocation when higher priority events are pending |
1437 | If you need to suppress invocation when higher priority events are pending |
1422 | you need to look at C<ev_idle> watchers, which provide this functionality. |
1438 | you need to look at C<ev_idle> watchers, which provide this functionality. |
1423 | |
1439 | |
1424 | You I<must not> change the priority of a watcher as long as it is active or |
1440 | You I<must not> change the priority of a watcher as long as it is active |
1425 | pending. |
1441 | or pending. Reading the priority with C<ev_priority> is fine in any state. |
1426 | |
1442 | |
1427 | Setting a priority outside the range of C<EV_MINPRI> to C<EV_MAXPRI> is |
1443 | Setting a priority outside the range of C<EV_MINPRI> to C<EV_MAXPRI> is |
1428 | fine, as long as you do not mind that the priority value you query might |
1444 | fine, as long as you do not mind that the priority value you query might |
1429 | or might not have been clamped to the valid range. |
1445 | or might not have been clamped to the valid range. |
1430 | |
1446 | |
… | |
… | |
1452 | |
1468 | |
1453 | =item ev_feed_event (loop, ev_TYPE *watcher, int revents) |
1469 | =item ev_feed_event (loop, ev_TYPE *watcher, int revents) |
1454 | |
1470 | |
1455 | Feeds the given event set into the event loop, as if the specified event |
1471 | Feeds the given event set into the event loop, as if the specified event |
1456 | had happened for the specified watcher (which must be a pointer to an |
1472 | had happened for the specified watcher (which must be a pointer to an |
1457 | initialised but not necessarily started event watcher). Obviously you must |
1473 | initialised but not necessarily started event watcher, though it can be |
1458 | not free the watcher as long as it has pending events. |
1474 | active). Obviously you must not free the watcher as long as it has pending |
|
|
1475 | events. |
1459 | |
1476 | |
1460 | Stopping the watcher, letting libev invoke it, or calling |
1477 | Stopping the watcher, letting libev invoke it, or calling |
1461 | C<ev_clear_pending> will clear the pending event, even if the watcher was |
1478 | C<ev_clear_pending> will clear the pending event, even if the watcher was |
1462 | not started in the first place. |
1479 | not started in the first place. |
1463 | |
1480 | |
… | |
… | |
1491 | |
1508 | |
1492 | =item started/running/active |
1509 | =item started/running/active |
1493 | |
1510 | |
1494 | Once a watcher has been started with a call to C<ev_TYPE_start> it becomes |
1511 | Once a watcher has been started with a call to C<ev_TYPE_start> it becomes |
1495 | property of the event loop, and is actively waiting for events. While in |
1512 | property of the event loop, and is actively waiting for events. While in |
1496 | this state it cannot be accessed (except in a few documented ways), moved, |
1513 | this state it cannot be accessed (except in a few documented ways, such as |
1497 | freed or anything else - the only legal thing is to keep a pointer to it, |
1514 | stoping it), moved, freed or anything else - the only legal thing is to |
1498 | and call libev functions on it that are documented to work on active watchers. |
1515 | keep a pointer to it, and call libev functions on it that are documented |
|
|
1516 | to work on active watchers. |
|
|
1517 | |
|
|
1518 | As a rule of thumb, before accessing a member or calling any function on |
|
|
1519 | a watcher, it should be stopped (or freshly initialised). If that is not |
|
|
1520 | convenient, you can check the documentation for that function or member to |
|
|
1521 | see if it is safe to use on an active watcher. |
1499 | |
1522 | |
1500 | =item pending |
1523 | =item pending |
1501 | |
1524 | |
1502 | If a watcher is active and libev determines that an event it is interested |
1525 | If a watcher is active and libev determines that an event it is interested |
1503 | in has occurred (such as a timer expiring), it will become pending. It will |
1526 | in has occurred (such as a timer expiring), it will become pending. It |
1504 | stay in this pending state until either it is stopped or its callback is |
1527 | will stay in this pending state until either it is explicitly stopped or |
1505 | about to be invoked, so it is not normally pending inside the watcher |
1528 | its callback is about to be invoked, so it is not normally pending inside |
1506 | callback. |
1529 | the watcher callback. |
1507 | |
1530 | |
1508 | The watcher might or might not be active while it is pending (for example, |
1531 | Generally, the watcher might or might not be active while it is pending |
1509 | an expired non-repeating timer can be pending but no longer active). If it |
1532 | (for example, an expired non-repeating timer can be pending but no longer |
1510 | is stopped, it can be freely accessed (e.g. by calling C<ev_TYPE_set>), |
1533 | active). If it is pending but not active, it can be freely accessed (e.g. |
1511 | but it is still property of the event loop at this time, so cannot be |
1534 | by calling C<ev_TYPE_set>), but it is still property of the event loop at |
1512 | moved, freed or reused. And if it is active the rules described in the |
1535 | this time, so cannot be moved, freed or reused. And if it is active the |
1513 | previous item still apply. |
1536 | rules described in the previous item still apply. |
|
|
1537 | |
|
|
1538 | Explicitly stopping a watcher will also clear the pending state |
|
|
1539 | unconditionally, so it is safe to stop a watcher and then free it. |
1514 | |
1540 | |
1515 | It is also possible to feed an event on a watcher that is not active (e.g. |
1541 | It is also possible to feed an event on a watcher that is not active (e.g. |
1516 | via C<ev_feed_event>), in which case it becomes pending without being |
1542 | via C<ev_feed_event>), in which case it becomes pending without being |
1517 | active. |
1543 | active. |
1518 | |
1544 | |
… | |
… | |
1535 | |
1561 | |
1536 | Many event loops support I<watcher priorities>, which are usually small |
1562 | Many event loops support I<watcher priorities>, which are usually small |
1537 | integers that influence the ordering of event callback invocation |
1563 | integers that influence the ordering of event callback invocation |
1538 | between watchers in some way, all else being equal. |
1564 | between watchers in some way, all else being equal. |
1539 | |
1565 | |
1540 | In libev, Watcher priorities can be set using C<ev_set_priority>. See its |
1566 | In libev, watcher priorities can be set using C<ev_set_priority>. See its |
1541 | description for the more technical details such as the actual priority |
1567 | description for the more technical details such as the actual priority |
1542 | range. |
1568 | range. |
1543 | |
1569 | |
1544 | There are two common ways how these these priorities are being interpreted |
1570 | There are two common ways how these these priorities are being interpreted |
1545 | by event loops: |
1571 | by event loops: |
… | |
… | |
1639 | |
1665 | |
1640 | This section describes each watcher in detail, but will not repeat |
1666 | This section describes each watcher in detail, but will not repeat |
1641 | information given in the last section. Any initialisation/set macros, |
1667 | information given in the last section. Any initialisation/set macros, |
1642 | functions and members specific to the watcher type are explained. |
1668 | functions and members specific to the watcher type are explained. |
1643 | |
1669 | |
1644 | Members are additionally marked with either I<[read-only]>, meaning that, |
1670 | Most members are additionally marked with either I<[read-only]>, meaning |
1645 | while the watcher is active, you can look at the member and expect some |
1671 | that, while the watcher is active, you can look at the member and expect |
1646 | sensible content, but you must not modify it (you can modify it while the |
1672 | some sensible content, but you must not modify it (you can modify it while |
1647 | watcher is stopped to your hearts content), or I<[read-write]>, which |
1673 | the watcher is stopped to your hearts content), or I<[read-write]>, which |
1648 | means you can expect it to have some sensible content while the watcher |
1674 | means you can expect it to have some sensible content while the watcher is |
1649 | is active, but you can also modify it. Modifying it may not do something |
1675 | active, but you can also modify it (within the same thread as the event |
|
|
1676 | loop, i.e. without creating data races). Modifying it may not do something |
1650 | sensible or take immediate effect (or do anything at all), but libev will |
1677 | sensible or take immediate effect (or do anything at all), but libev will |
1651 | not crash or malfunction in any way. |
1678 | not crash or malfunction in any way. |
1652 | |
1679 | |
|
|
1680 | In any case, the documentation for each member will explain what the |
|
|
1681 | effects are, and if there are any additional access restrictions. |
1653 | |
1682 | |
1654 | =head2 C<ev_io> - is this file descriptor readable or writable? |
1683 | =head2 C<ev_io> - is this file descriptor readable or writable? |
1655 | |
1684 | |
1656 | I/O watchers check whether a file descriptor is readable or writable |
1685 | I/O watchers check whether a file descriptor is readable or writable |
1657 | in each iteration of the event loop, or, more precisely, when reading |
1686 | in each iteration of the event loop, or, more precisely, when reading |
… | |
… | |
1749 | when you rarely read from a file instead of from a socket, and want to |
1778 | when you rarely read from a file instead of from a socket, and want to |
1750 | reuse the same code path. |
1779 | reuse the same code path. |
1751 | |
1780 | |
1752 | =head3 The special problem of fork |
1781 | =head3 The special problem of fork |
1753 | |
1782 | |
1754 | Some backends (epoll, kqueue, probably linuxaio) do not support C<fork ()> |
1783 | Some backends (epoll, kqueue, linuxaio, iouring) do not support C<fork ()> |
1755 | at all or exhibit useless behaviour. Libev fully supports fork, but needs |
1784 | at all or exhibit useless behaviour. Libev fully supports fork, but needs |
1756 | to be told about it in the child if you want to continue to use it in the |
1785 | to be told about it in the child if you want to continue to use it in the |
1757 | child. |
1786 | child. |
1758 | |
1787 | |
1759 | To support fork in your child processes, you have to call C<ev_loop_fork |
1788 | To support fork in your child processes, you have to call C<ev_loop_fork |
… | |
… | |
1817 | =item ev_io_init (ev_io *, callback, int fd, int events) |
1846 | =item ev_io_init (ev_io *, callback, int fd, int events) |
1818 | |
1847 | |
1819 | =item ev_io_set (ev_io *, int fd, int events) |
1848 | =item ev_io_set (ev_io *, int fd, int events) |
1820 | |
1849 | |
1821 | Configures an C<ev_io> watcher. The C<fd> is the file descriptor to |
1850 | Configures an C<ev_io> watcher. The C<fd> is the file descriptor to |
1822 | receive events for and C<events> is either C<EV_READ>, C<EV_WRITE> or |
1851 | receive events for and C<events> is either C<EV_READ>, C<EV_WRITE>, both |
1823 | C<EV_READ | EV_WRITE>, to express the desire to receive the given events. |
1852 | C<EV_READ | EV_WRITE> or C<0>, to express the desire to receive the given |
|
|
1853 | events. |
1824 | |
1854 | |
1825 | =item int fd [read-only] |
1855 | Note that setting the C<events> to C<0> and starting the watcher is |
|
|
1856 | supported, but not specially optimized - if your program sometimes happens |
|
|
1857 | to generate this combination this is fine, but if it is easy to avoid |
|
|
1858 | starting an io watcher watching for no events you should do so. |
1826 | |
1859 | |
1827 | The file descriptor being watched. |
1860 | =item ev_io_modify (ev_io *, int events) |
1828 | |
1861 | |
|
|
1862 | Similar to C<ev_io_set>, but only changes the requested events. Using this |
|
|
1863 | might be faster with some backends, as libev can assume that the C<fd> |
|
|
1864 | still refers to the same underlying file description, something it cannot |
|
|
1865 | do when using C<ev_io_set>. |
|
|
1866 | |
|
|
1867 | =item int fd [no-modify] |
|
|
1868 | |
|
|
1869 | The file descriptor being watched. While it can be read at any time, you |
|
|
1870 | must not modify this member even when the watcher is stopped - always use |
|
|
1871 | C<ev_io_set> for that. |
|
|
1872 | |
1829 | =item int events [read-only] |
1873 | =item int events [no-modify] |
1830 | |
1874 | |
1831 | The events being watched. |
1875 | The set of events the fd is being watched for, among other flags. Remember |
|
|
1876 | that this is a bit set - to test for C<EV_READ>, use C<< w->events & |
|
|
1877 | EV_READ >>, and similarly for C<EV_WRITE>. |
|
|
1878 | |
|
|
1879 | As with C<fd>, you must not modify this member even when the watcher is |
|
|
1880 | stopped, always use C<ev_io_set> or C<ev_io_modify> for that. |
1832 | |
1881 | |
1833 | =back |
1882 | =back |
1834 | |
1883 | |
1835 | =head3 Examples |
1884 | =head3 Examples |
1836 | |
1885 | |
… | |
… | |
3829 | event loop thread and an unspecified mechanism to wake up the main thread. |
3878 | event loop thread and an unspecified mechanism to wake up the main thread. |
3830 | |
3879 | |
3831 | First, you need to associate some data with the event loop: |
3880 | First, you need to associate some data with the event loop: |
3832 | |
3881 | |
3833 | typedef struct { |
3882 | typedef struct { |
3834 | mutex_t lock; /* global loop lock */ |
3883 | pthread_mutex_t lock; /* global loop lock */ |
|
|
3884 | pthread_t tid; |
|
|
3885 | pthread_cond_t invoke_cv; |
3835 | ev_async async_w; |
3886 | ev_async async_w; |
3836 | thread_t tid; |
|
|
3837 | cond_t invoke_cv; |
|
|
3838 | } userdata; |
3887 | } userdata; |
3839 | |
3888 | |
3840 | void prepare_loop (EV_P) |
3889 | void prepare_loop (EV_P) |
3841 | { |
3890 | { |
3842 | // for simplicity, we use a static userdata struct. |
3891 | // for simplicity, we use a static userdata struct. |
3843 | static userdata u; |
3892 | static userdata u; |
3844 | |
3893 | |
3845 | ev_async_init (&u->async_w, async_cb); |
3894 | ev_async_init (&u.async_w, async_cb); |
3846 | ev_async_start (EV_A_ &u->async_w); |
3895 | ev_async_start (EV_A_ &u.async_w); |
3847 | |
3896 | |
3848 | pthread_mutex_init (&u->lock, 0); |
3897 | pthread_mutex_init (&u.lock, 0); |
3849 | pthread_cond_init (&u->invoke_cv, 0); |
3898 | pthread_cond_init (&u.invoke_cv, 0); |
3850 | |
3899 | |
3851 | // now associate this with the loop |
3900 | // now associate this with the loop |
3852 | ev_set_userdata (EV_A_ u); |
3901 | ev_set_userdata (EV_A_ &u); |
3853 | ev_set_invoke_pending_cb (EV_A_ l_invoke); |
3902 | ev_set_invoke_pending_cb (EV_A_ l_invoke); |
3854 | ev_set_loop_release_cb (EV_A_ l_release, l_acquire); |
3903 | ev_set_loop_release_cb (EV_A_ l_release, l_acquire); |
3855 | |
3904 | |
3856 | // then create the thread running ev_run |
3905 | // then create the thread running ev_run |
3857 | pthread_create (&u->tid, 0, l_run, EV_A); |
3906 | pthread_create (&u.tid, 0, l_run, EV_A); |
3858 | } |
3907 | } |
3859 | |
3908 | |
3860 | The callback for the C<ev_async> watcher does nothing: the watcher is used |
3909 | The callback for the C<ev_async> watcher does nothing: the watcher is used |
3861 | solely to wake up the event loop so it takes notice of any new watchers |
3910 | solely to wake up the event loop so it takes notice of any new watchers |
3862 | that might have been added: |
3911 | that might have been added: |
… | |
… | |
4234 | method. |
4283 | method. |
4235 | |
4284 | |
4236 | For C<ev::embed> watchers this method is called C<set_embed>, to avoid |
4285 | For C<ev::embed> watchers this method is called C<set_embed>, to avoid |
4237 | clashing with the C<set (loop)> method. |
4286 | clashing with the C<set (loop)> method. |
4238 | |
4287 | |
|
|
4288 | For C<ev::io> watchers there is an additional C<set> method that acepts a |
|
|
4289 | new event mask only, and internally calls C<ev_io_modify>. |
|
|
4290 | |
4239 | =item w->start () |
4291 | =item w->start () |
4240 | |
4292 | |
4241 | Starts the watcher. Note that there is no C<loop> argument, as the |
4293 | Starts the watcher. Note that there is no C<loop> argument, as the |
4242 | constructor already stores the event loop. |
4294 | constructor already stores the event loop. |
4243 | |
4295 | |
… | |
… | |
4484 | |
4536 | |
4485 | ev_select.c only when select backend is enabled |
4537 | ev_select.c only when select backend is enabled |
4486 | ev_poll.c only when poll backend is enabled |
4538 | ev_poll.c only when poll backend is enabled |
4487 | ev_epoll.c only when the epoll backend is enabled |
4539 | ev_epoll.c only when the epoll backend is enabled |
4488 | ev_linuxaio.c only when the linux aio backend is enabled |
4540 | ev_linuxaio.c only when the linux aio backend is enabled |
|
|
4541 | ev_iouring.c only when the linux io_uring backend is enabled |
4489 | ev_kqueue.c only when the kqueue backend is enabled |
4542 | ev_kqueue.c only when the kqueue backend is enabled |
4490 | ev_port.c only when the solaris port backend is enabled |
4543 | ev_port.c only when the solaris port backend is enabled |
4491 | |
4544 | |
4492 | F<ev.c> includes the backend files directly when enabled, so you only need |
4545 | F<ev.c> includes the backend files directly when enabled, so you only need |
4493 | to compile this single file. |
4546 | to compile this single file. |
… | |
… | |
4614 | available and will probe for kernel support at runtime. This will improve |
4667 | available and will probe for kernel support at runtime. This will improve |
4615 | C<ev_signal> and C<ev_async> performance and reduce resource consumption. |
4668 | C<ev_signal> and C<ev_async> performance and reduce resource consumption. |
4616 | If undefined, it will be enabled if the headers indicate GNU/Linux + Glibc |
4669 | If undefined, it will be enabled if the headers indicate GNU/Linux + Glibc |
4617 | 2.7 or newer, otherwise disabled. |
4670 | 2.7 or newer, otherwise disabled. |
4618 | |
4671 | |
|
|
4672 | =item EV_USE_SIGNALFD |
|
|
4673 | |
|
|
4674 | If defined to be C<1>, then libev will assume that C<signalfd ()> is |
|
|
4675 | available and will probe for kernel support at runtime. This enables |
|
|
4676 | the use of EVFLAG_SIGNALFD for faster and simpler signal handling. If |
|
|
4677 | undefined, it will be enabled if the headers indicate GNU/Linux + Glibc |
|
|
4678 | 2.7 or newer, otherwise disabled. |
|
|
4679 | |
|
|
4680 | =item EV_USE_TIMERFD |
|
|
4681 | |
|
|
4682 | If defined to be C<1>, then libev will assume that C<timerfd ()> is |
|
|
4683 | available and will probe for kernel support at runtime. This allows |
|
|
4684 | libev to detect time jumps accurately. If undefined, it will be enabled |
|
|
4685 | if the headers indicate GNU/Linux + Glibc 2.8 or newer and define |
|
|
4686 | C<TFD_TIMER_CANCEL_ON_SET>, otherwise disabled. |
|
|
4687 | |
|
|
4688 | =item EV_USE_EVENTFD |
|
|
4689 | |
|
|
4690 | If defined to be C<1>, then libev will assume that C<eventfd ()> is |
|
|
4691 | available and will probe for kernel support at runtime. This will improve |
|
|
4692 | C<ev_signal> and C<ev_async> performance and reduce resource consumption. |
|
|
4693 | If undefined, it will be enabled if the headers indicate GNU/Linux + Glibc |
|
|
4694 | 2.7 or newer, otherwise disabled. |
|
|
4695 | |
4619 | =item EV_USE_SELECT |
4696 | =item EV_USE_SELECT |
4620 | |
4697 | |
4621 | If undefined or defined to be C<1>, libev will compile in support for the |
4698 | If undefined or defined to be C<1>, libev will compile in support for the |
4622 | C<select>(2) backend. No attempt at auto-detection will be done: if no |
4699 | C<select>(2) backend. No attempt at auto-detection will be done: if no |
4623 | other method takes over, select will be it. Otherwise the select backend |
4700 | other method takes over, select will be it. Otherwise the select backend |
… | |
… | |
4686 | backend for GNU/Linux systems. If undefined, it will be enabled if the |
4763 | backend for GNU/Linux systems. If undefined, it will be enabled if the |
4687 | headers indicate GNU/Linux + Glibc 2.4 or newer, otherwise disabled. |
4764 | headers indicate GNU/Linux + Glibc 2.4 or newer, otherwise disabled. |
4688 | |
4765 | |
4689 | =item EV_USE_LINUXAIO |
4766 | =item EV_USE_LINUXAIO |
4690 | |
4767 | |
|
|
4768 | If defined to be C<1>, libev will compile in support for the Linux aio |
|
|
4769 | backend (C<EV_USE_EPOLL> must also be enabled). If undefined, it will be |
|
|
4770 | enabled on linux, otherwise disabled. |
|
|
4771 | |
|
|
4772 | =item EV_USE_IOURING |
|
|
4773 | |
4691 | If defined to be C<1>, libev will compile in support for the Linux |
4774 | If defined to be C<1>, libev will compile in support for the Linux |
4692 | aio backend. Due to it's currenbt limitations it has to be requested |
4775 | io_uring backend (C<EV_USE_EPOLL> must also be enabled). Due to it's |
4693 | explicitly. If undefined, it will be enabled on linux, otherwise |
4776 | current limitations it has to be requested explicitly. If undefined, it |
4694 | disabled. |
4777 | will be enabled on linux, otherwise disabled. |
4695 | |
4778 | |
4696 | =item EV_USE_KQUEUE |
4779 | =item EV_USE_KQUEUE |
4697 | |
4780 | |
4698 | If defined to be C<1>, libev will compile in support for the BSD style |
4781 | If defined to be C<1>, libev will compile in support for the BSD style |
4699 | C<kqueue>(2) backend. Its actual availability will be detected at runtime, |
4782 | C<kqueue>(2) backend. Its actual availability will be detected at runtime, |