… | |
… | |
439 | of course I<doesn't>, and epoll just loves to report events for totally |
439 | of course I<doesn't>, and epoll just loves to report events for totally |
440 | I<different> file descriptors (even already closed ones, so one cannot |
440 | I<different> file descriptors (even already closed ones, so one cannot |
441 | even remove them from the set) than registered in the set (especially |
441 | even remove them from the set) than registered in the set (especially |
442 | on SMP systems). Libev tries to counter these spurious notifications by |
442 | on SMP systems). Libev tries to counter these spurious notifications by |
443 | employing an additional generation counter and comparing that against the |
443 | employing an additional generation counter and comparing that against the |
444 | events to filter out spurious ones, recreating the set when required. |
444 | events to filter out spurious ones, recreating the set when required. Last |
|
|
445 | not least, it also refuses to work with some file descriptors which work |
|
|
446 | perfectly fine with C<select> (files, many character devices...). |
445 | |
447 | |
446 | While stopping, setting and starting an I/O watcher in the same iteration |
448 | While stopping, setting and starting an I/O watcher in the same iteration |
447 | will result in some caching, there is still a system call per such |
449 | will result in some caching, there is still a system call per such |
448 | incident (because the same I<file descriptor> could point to a different |
450 | incident (because the same I<file descriptor> could point to a different |
449 | I<file description> now), so its best to avoid that. Also, C<dup ()>'ed |
451 | I<file description> now), so its best to avoid that. Also, C<dup ()>'ed |
… | |
… | |
2123 | Example: Call a callback every hour, or, more precisely, whenever the |
2125 | Example: Call a callback every hour, or, more precisely, whenever the |
2124 | system time is divisible by 3600. The callback invocation times have |
2126 | system time is divisible by 3600. The callback invocation times have |
2125 | potentially a lot of jitter, but good long-term stability. |
2127 | potentially a lot of jitter, but good long-term stability. |
2126 | |
2128 | |
2127 | static void |
2129 | static void |
2128 | clock_cb (struct ev_loop *loop, ev_io *w, int revents) |
2130 | clock_cb (struct ev_loop *loop, ev_periodic *w, int revents) |
2129 | { |
2131 | { |
2130 | ... its now a full hour (UTC, or TAI or whatever your clock follows) |
2132 | ... its now a full hour (UTC, or TAI or whatever your clock follows) |
2131 | } |
2133 | } |
2132 | |
2134 | |
2133 | ev_periodic hourly_tick; |
2135 | ev_periodic hourly_tick; |
… | |
… | |
2965 | C<ev_default_fork> cheats and calls it in the wrong process, the fork |
2967 | C<ev_default_fork> cheats and calls it in the wrong process, the fork |
2966 | handlers will be invoked, too, of course. |
2968 | handlers will be invoked, too, of course. |
2967 | |
2969 | |
2968 | =head3 The special problem of life after fork - how is it possible? |
2970 | =head3 The special problem of life after fork - how is it possible? |
2969 | |
2971 | |
2970 | Most uses of C<fork()> consist of forking, then some simple calls to ste |
2972 | Most uses of C<fork()> consist of forking, then some simple calls to set |
2971 | up/change the process environment, followed by a call to C<exec()>. This |
2973 | up/change the process environment, followed by a call to C<exec()>. This |
2972 | sequence should be handled by libev without any problems. |
2974 | sequence should be handled by libev without any problems. |
2973 | |
2975 | |
2974 | This changes when the application actually wants to do event handling |
2976 | This changes when the application actually wants to do event handling |
2975 | in the child, or both parent in child, in effect "continuing" after the |
2977 | in the child, or both parent in child, in effect "continuing" after the |
… | |
… | |
3009 | believe me. |
3011 | believe me. |
3010 | |
3012 | |
3011 | =back |
3013 | =back |
3012 | |
3014 | |
3013 | |
3015 | |
3014 | =head2 C<ev_async> - how to wake up another event loop |
3016 | =head2 C<ev_async> - how to wake up an event loop |
3015 | |
3017 | |
3016 | In general, you cannot use an C<ev_loop> from multiple threads or other |
3018 | In general, you cannot use an C<ev_loop> from multiple threads or other |
3017 | asynchronous sources such as signal handlers (as opposed to multiple event |
3019 | asynchronous sources such as signal handlers (as opposed to multiple event |
3018 | loops - those are of course safe to use in different threads). |
3020 | loops - those are of course safe to use in different threads). |
3019 | |
3021 | |
3020 | Sometimes, however, you need to wake up another event loop you do not |
3022 | Sometimes, however, you need to wake up an event loop you do not control, |
3021 | control, for example because it belongs to another thread. This is what |
3023 | for example because it belongs to another thread. This is what C<ev_async> |
3022 | C<ev_async> watchers do: as long as the C<ev_async> watcher is active, you |
3024 | watchers do: as long as the C<ev_async> watcher is active, you can signal |
3023 | can signal it by calling C<ev_async_send>, which is thread- and signal |
3025 | it by calling C<ev_async_send>, which is thread- and signal safe. |
3024 | safe. |
|
|
3025 | |
3026 | |
3026 | This functionality is very similar to C<ev_signal> watchers, as signals, |
3027 | This functionality is very similar to C<ev_signal> watchers, as signals, |
3027 | too, are asynchronous in nature, and signals, too, will be compressed |
3028 | too, are asynchronous in nature, and signals, too, will be compressed |
3028 | (i.e. the number of callback invocations may be less than the number of |
3029 | (i.e. the number of callback invocations may be less than the number of |
3029 | C<ev_async_sent> calls). |
3030 | C<ev_async_sent> calls). |
… | |
… | |
3390 | Associates a different C<struct ev_loop> with this watcher. You can only |
3391 | Associates a different C<struct ev_loop> with this watcher. You can only |
3391 | do this when the watcher is inactive (and not pending either). |
3392 | do this when the watcher is inactive (and not pending either). |
3392 | |
3393 | |
3393 | =item w->set ([arguments]) |
3394 | =item w->set ([arguments]) |
3394 | |
3395 | |
3395 | Basically the same as C<ev_TYPE_set>, with the same arguments. Must be |
3396 | Basically the same as C<ev_TYPE_set>, with the same arguments. Either this |
3396 | called at least once. Unlike the C counterpart, an active watcher gets |
3397 | method or a suitable start method must be called at least once. Unlike the |
3397 | automatically stopped and restarted when reconfiguring it with this |
3398 | C counterpart, an active watcher gets automatically stopped and restarted |
3398 | method. |
3399 | when reconfiguring it with this method. |
3399 | |
3400 | |
3400 | =item w->start () |
3401 | =item w->start () |
3401 | |
3402 | |
3402 | Starts the watcher. Note that there is no C<loop> argument, as the |
3403 | Starts the watcher. Note that there is no C<loop> argument, as the |
3403 | constructor already stores the event loop. |
3404 | constructor already stores the event loop. |
3404 | |
3405 | |
|
|
3406 | =item w->start ([arguments]) |
|
|
3407 | |
|
|
3408 | Instead of calling C<set> and C<start> methods separately, it is often |
|
|
3409 | convenient to wrap them in one call. Uses the same type of arguments as |
|
|
3410 | the configure C<set> method of the watcher. |
|
|
3411 | |
3405 | =item w->stop () |
3412 | =item w->stop () |
3406 | |
3413 | |
3407 | Stops the watcher if it is active. Again, no C<loop> argument. |
3414 | Stops the watcher if it is active. Again, no C<loop> argument. |
3408 | |
3415 | |
3409 | =item w->again () (C<ev::timer>, C<ev::periodic> only) |
3416 | =item w->again () (C<ev::timer>, C<ev::periodic> only) |
… | |
… | |
3421 | |
3428 | |
3422 | =back |
3429 | =back |
3423 | |
3430 | |
3424 | =back |
3431 | =back |
3425 | |
3432 | |
3426 | Example: Define a class with an IO and idle watcher, start one of them in |
3433 | Example: Define a class with two I/O and idle watchers, start the I/O |
3427 | the constructor. |
3434 | watchers in the constructor. |
3428 | |
3435 | |
3429 | class myclass |
3436 | class myclass |
3430 | { |
3437 | { |
3431 | ev::io io ; void io_cb (ev::io &w, int revents); |
3438 | ev::io io ; void io_cb (ev::io &w, int revents); |
|
|
3439 | ev::io2 io2 ; void io2_cb (ev::io &w, int revents); |
3432 | ev::idle idle; void idle_cb (ev::idle &w, int revents); |
3440 | ev::idle idle; void idle_cb (ev::idle &w, int revents); |
3433 | |
3441 | |
3434 | myclass (int fd) |
3442 | myclass (int fd) |
3435 | { |
3443 | { |
3436 | io .set <myclass, &myclass::io_cb > (this); |
3444 | io .set <myclass, &myclass::io_cb > (this); |
|
|
3445 | io2 .set <myclass, &myclass::io2_cb > (this); |
3437 | idle.set <myclass, &myclass::idle_cb> (this); |
3446 | idle.set <myclass, &myclass::idle_cb> (this); |
3438 | |
3447 | |
3439 | io.start (fd, ev::READ); |
3448 | io.set (fd, ev::WRITE); // configure the watcher |
|
|
3449 | io.start (); // start it whenever convenient |
|
|
3450 | |
|
|
3451 | io2.start (fd, ev::READ); // set + start in one call |
3440 | } |
3452 | } |
3441 | }; |
3453 | }; |
3442 | |
3454 | |
3443 | |
3455 | |
3444 | =head1 OTHER LANGUAGE BINDINGS |
3456 | =head1 OTHER LANGUAGE BINDINGS |
… | |
… | |
3885 | EV_PREPARE_ENABLE, EV_CHECK_ENABLE, EV_FORK_ENABLE, EV_SIGNAL_ENABLE, |
3897 | EV_PREPARE_ENABLE, EV_CHECK_ENABLE, EV_FORK_ENABLE, EV_SIGNAL_ENABLE, |
3886 | EV_ASYNC_ENABLE, EV_CHILD_ENABLE. |
3898 | EV_ASYNC_ENABLE, EV_CHILD_ENABLE. |
3887 | |
3899 | |
3888 | If undefined or defined to be C<1> (and the platform supports it), then |
3900 | If undefined or defined to be C<1> (and the platform supports it), then |
3889 | the respective watcher type is supported. If defined to be C<0>, then it |
3901 | the respective watcher type is supported. If defined to be C<0>, then it |
3890 | is not. Disabling watcher types mainly saves codesize. |
3902 | is not. Disabling watcher types mainly saves code size. |
3891 | |
3903 | |
3892 | =item EV_FEATURES |
3904 | =item EV_FEATURES |
3893 | |
3905 | |
3894 | If you need to shave off some kilobytes of code at the expense of some |
3906 | If you need to shave off some kilobytes of code at the expense of some |
3895 | speed (but with the full API), you can define this symbol to request |
3907 | speed (but with the full API), you can define this symbol to request |
… | |
… | |
3915 | |
3927 | |
3916 | =item C<1> - faster/larger code |
3928 | =item C<1> - faster/larger code |
3917 | |
3929 | |
3918 | Use larger code to speed up some operations. |
3930 | Use larger code to speed up some operations. |
3919 | |
3931 | |
3920 | Currently this is used to override some inlining decisions (enlarging the roughly |
3932 | Currently this is used to override some inlining decisions (enlarging the |
3921 | 30% code size on amd64. |
3933 | code size by roughly 30% on amd64). |
3922 | |
3934 | |
3923 | When optimising for size, use of compiler flags such as C<-Os> with |
3935 | When optimising for size, use of compiler flags such as C<-Os> with |
3924 | gcc recommended, as well as C<-DNDEBUG>, as libev contains a number of |
3936 | gcc is recommended, as well as C<-DNDEBUG>, as libev contains a number of |
3925 | assertions. |
3937 | assertions. |
3926 | |
3938 | |
3927 | =item C<2> - faster/larger data structures |
3939 | =item C<2> - faster/larger data structures |
3928 | |
3940 | |
3929 | Replaces the small 2-heap for timer management by a faster 4-heap, larger |
3941 | Replaces the small 2-heap for timer management by a faster 4-heap, larger |
3930 | hash table sizes and so on. This will usually further increase codesize |
3942 | hash table sizes and so on. This will usually further increase code size |
3931 | and can additionally have an effect on the size of data structures at |
3943 | and can additionally have an effect on the size of data structures at |
3932 | runtime. |
3944 | runtime. |
3933 | |
3945 | |
3934 | =item C<4> - full API configuration |
3946 | =item C<4> - full API configuration |
3935 | |
3947 | |
… | |
… | |
3972 | I/O watcher then might come out at only 5Kb. |
3984 | I/O watcher then might come out at only 5Kb. |
3973 | |
3985 | |
3974 | =item EV_AVOID_STDIO |
3986 | =item EV_AVOID_STDIO |
3975 | |
3987 | |
3976 | If this is set to C<1> at compiletime, then libev will avoid using stdio |
3988 | If this is set to C<1> at compiletime, then libev will avoid using stdio |
3977 | functions (printf, scanf, perror etc.). This will increase the codesize |
3989 | functions (printf, scanf, perror etc.). This will increase the code size |
3978 | somewhat, but if your program doesn't otherwise depend on stdio and your |
3990 | somewhat, but if your program doesn't otherwise depend on stdio and your |
3979 | libc allows it, this avoids linking in the stdio library which is quite |
3991 | libc allows it, this avoids linking in the stdio library which is quite |
3980 | big. |
3992 | big. |
3981 | |
3993 | |
3982 | Note that error messages might become less precise when this option is |
3994 | Note that error messages might become less precise when this option is |
… | |
… | |
4042 | will be C<0>. |
4054 | will be C<0>. |
4043 | |
4055 | |
4044 | =item EV_COMMON |
4056 | =item EV_COMMON |
4045 | |
4057 | |
4046 | By default, all watchers have a C<void *data> member. By redefining |
4058 | By default, all watchers have a C<void *data> member. By redefining |
4047 | this macro to a something else you can include more and other types of |
4059 | this macro to something else you can include more and other types of |
4048 | members. You have to define it each time you include one of the files, |
4060 | members. You have to define it each time you include one of the files, |
4049 | though, and it must be identical each time. |
4061 | though, and it must be identical each time. |
4050 | |
4062 | |
4051 | For example, the perl EV module uses something like this: |
4063 | For example, the perl EV module uses something like this: |
4052 | |
4064 | |
… | |
… | |
4351 | maintainable. |
4363 | maintainable. |
4352 | |
4364 | |
4353 | And of course, some compiler warnings are just plain stupid, or simply |
4365 | And of course, some compiler warnings are just plain stupid, or simply |
4354 | wrong (because they don't actually warn about the condition their message |
4366 | wrong (because they don't actually warn about the condition their message |
4355 | seems to warn about). For example, certain older gcc versions had some |
4367 | seems to warn about). For example, certain older gcc versions had some |
4356 | warnings that resulted an extreme number of false positives. These have |
4368 | warnings that resulted in an extreme number of false positives. These have |
4357 | been fixed, but some people still insist on making code warn-free with |
4369 | been fixed, but some people still insist on making code warn-free with |
4358 | such buggy versions. |
4370 | such buggy versions. |
4359 | |
4371 | |
4360 | While libev is written to generate as few warnings as possible, |
4372 | While libev is written to generate as few warnings as possible, |
4361 | "warn-free" code is not a goal, and it is recommended not to build libev |
4373 | "warn-free" code is not a goal, and it is recommended not to build libev |
… | |
… | |
4397 | I suggest using suppression lists. |
4409 | I suggest using suppression lists. |
4398 | |
4410 | |
4399 | |
4411 | |
4400 | =head1 PORTABILITY NOTES |
4412 | =head1 PORTABILITY NOTES |
4401 | |
4413 | |
|
|
4414 | =head2 GNU/LINUX 32 BIT LIMITATIONS |
|
|
4415 | |
|
|
4416 | GNU/Linux is the only common platform that supports 64 bit file/large file |
|
|
4417 | interfaces but I<disables> them by default. |
|
|
4418 | |
|
|
4419 | That means that libev compiled in the default environment doesn't support |
|
|
4420 | files larger than 2GiB or so, which mainly affects C<ev_stat> watchers. |
|
|
4421 | |
|
|
4422 | Unfortunately, many programs try to work around this GNU/Linux issue |
|
|
4423 | by enabling the large file API, which makes them incompatible with the |
|
|
4424 | standard libev compiled for their system. |
|
|
4425 | |
|
|
4426 | Likewise, libev cannot enable the large file API itself as this would |
|
|
4427 | suddenly make it incompatible to the default compile time environment, |
|
|
4428 | i.e. all programs not using special compile switches. |
|
|
4429 | |
|
|
4430 | =head2 OS/X AND DARWIN BUGS |
|
|
4431 | |
|
|
4432 | The whole thing is a bug if you ask me - basically any system interface |
|
|
4433 | you touch is broken, whether it is locales, poll, kqueue or even the |
|
|
4434 | OpenGL drivers. |
|
|
4435 | |
|
|
4436 | =head3 C<kqueue> is buggy |
|
|
4437 | |
|
|
4438 | The kqueue syscall is broken in all known versions - most versions support |
|
|
4439 | only sockets, many support pipes. |
|
|
4440 | |
|
|
4441 | Libev tries to work around this by not using C<kqueue> by default on |
|
|
4442 | this rotten platform, but of course you can still ask for it when creating |
|
|
4443 | a loop. |
|
|
4444 | |
|
|
4445 | =head3 C<poll> is buggy |
|
|
4446 | |
|
|
4447 | Instead of fixing C<kqueue>, Apple replaced their (working) C<poll> |
|
|
4448 | implementation by something calling C<kqueue> internally around the 10.5.6 |
|
|
4449 | release, so now C<kqueue> I<and> C<poll> are broken. |
|
|
4450 | |
|
|
4451 | Libev tries to work around this by not using C<poll> by default on |
|
|
4452 | this rotten platform, but of course you can still ask for it when creating |
|
|
4453 | a loop. |
|
|
4454 | |
|
|
4455 | =head3 C<select> is buggy |
|
|
4456 | |
|
|
4457 | All that's left is C<select>, and of course Apple found a way to fuck this |
|
|
4458 | one up as well: On OS/X, C<select> actively limits the number of file |
|
|
4459 | descriptors you can pass in to 1024 - your program suddenly crashes when |
|
|
4460 | you use more. |
|
|
4461 | |
|
|
4462 | There is an undocumented "workaround" for this - defining |
|
|
4463 | C<_DARWIN_UNLIMITED_SELECT>, which libev tries to use, so select I<should> |
|
|
4464 | work on OS/X. |
|
|
4465 | |
|
|
4466 | =head2 SOLARIS PROBLEMS AND WORKAROUNDS |
|
|
4467 | |
|
|
4468 | =head3 C<errno> reentrancy |
|
|
4469 | |
|
|
4470 | The default compile environment on Solaris is unfortunately so |
|
|
4471 | thread-unsafe that you can't even use components/libraries compiled |
|
|
4472 | without C<-D_REENTRANT> (as long as they use C<errno>), which, of course, |
|
|
4473 | isn't defined by default. |
|
|
4474 | |
|
|
4475 | If you want to use libev in threaded environments you have to make sure |
|
|
4476 | it's compiled with C<_REENTRANT> defined. |
|
|
4477 | |
|
|
4478 | =head3 Event port backend |
|
|
4479 | |
|
|
4480 | The scalable event interface for Solaris is called "event ports". Unfortunately, |
|
|
4481 | this mechanism is very buggy. If you run into high CPU usage, your program |
|
|
4482 | freezes or you get a large number of spurious wakeups, make sure you have |
|
|
4483 | all the relevant and latest kernel patches applied. No, I don't know which |
|
|
4484 | ones, but there are multiple ones. |
|
|
4485 | |
|
|
4486 | If you can't get it to work, you can try running the program by setting |
|
|
4487 | the environment variable C<LIBEV_FLAGS=3> to only allow C<poll> and |
|
|
4488 | C<select> backends. |
|
|
4489 | |
|
|
4490 | =head2 AIX POLL BUG |
|
|
4491 | |
|
|
4492 | AIX unfortunately has a broken C<poll.h> header. Libev works around |
|
|
4493 | this by trying to avoid the poll backend altogether (i.e. it's not even |
|
|
4494 | compiled in), which normally isn't a big problem as C<select> works fine |
|
|
4495 | with large bitsets, and AIX is dead anyway. |
|
|
4496 | |
4402 | =head2 WIN32 PLATFORM LIMITATIONS AND WORKAROUNDS |
4497 | =head2 WIN32 PLATFORM LIMITATIONS AND WORKAROUNDS |
|
|
4498 | |
|
|
4499 | =head3 General issues |
4403 | |
4500 | |
4404 | Win32 doesn't support any of the standards (e.g. POSIX) that libev |
4501 | Win32 doesn't support any of the standards (e.g. POSIX) that libev |
4405 | requires, and its I/O model is fundamentally incompatible with the POSIX |
4502 | requires, and its I/O model is fundamentally incompatible with the POSIX |
4406 | model. Libev still offers limited functionality on this platform in |
4503 | model. Libev still offers limited functionality on this platform in |
4407 | the form of the C<EVBACKEND_SELECT> backend, and only supports socket |
4504 | the form of the C<EVBACKEND_SELECT> backend, and only supports socket |
4408 | descriptors. This only applies when using Win32 natively, not when using |
4505 | descriptors. This only applies when using Win32 natively, not when using |
4409 | e.g. cygwin. |
4506 | e.g. cygwin. Actually, it only applies to the microsofts own compilers, |
|
|
4507 | as every compielr comes with a slightly differently broken/incompatible |
|
|
4508 | environment. |
4410 | |
4509 | |
4411 | Lifting these limitations would basically require the full |
4510 | Lifting these limitations would basically require the full |
4412 | re-implementation of the I/O system. If you are into these kinds of |
4511 | re-implementation of the I/O system. If you are into this kind of thing, |
4413 | things, then note that glib does exactly that for you in a very portable |
4512 | then note that glib does exactly that for you in a very portable way (note |
4414 | way (note also that glib is the slowest event library known to man). |
4513 | also that glib is the slowest event library known to man). |
4415 | |
4514 | |
4416 | There is no supported compilation method available on windows except |
4515 | There is no supported compilation method available on windows except |
4417 | embedding it into other applications. |
4516 | embedding it into other applications. |
4418 | |
4517 | |
4419 | Sensible signal handling is officially unsupported by Microsoft - libev |
4518 | Sensible signal handling is officially unsupported by Microsoft - libev |
… | |
… | |
4447 | you do I<not> compile the F<ev.c> or any other embedded source files!): |
4546 | you do I<not> compile the F<ev.c> or any other embedded source files!): |
4448 | |
4547 | |
4449 | #include "evwrap.h" |
4548 | #include "evwrap.h" |
4450 | #include "ev.c" |
4549 | #include "ev.c" |
4451 | |
4550 | |
4452 | =over 4 |
|
|
4453 | |
|
|
4454 | =item The winsocket select function |
4551 | =head3 The winsocket C<select> function |
4455 | |
4552 | |
4456 | The winsocket C<select> function doesn't follow POSIX in that it |
4553 | The winsocket C<select> function doesn't follow POSIX in that it |
4457 | requires socket I<handles> and not socket I<file descriptors> (it is |
4554 | requires socket I<handles> and not socket I<file descriptors> (it is |
4458 | also extremely buggy). This makes select very inefficient, and also |
4555 | also extremely buggy). This makes select very inefficient, and also |
4459 | requires a mapping from file descriptors to socket handles (the Microsoft |
4556 | requires a mapping from file descriptors to socket handles (the Microsoft |
… | |
… | |
4468 | #define EV_SELECT_IS_WINSOCKET 1 /* forces EV_SELECT_USE_FD_SET, too */ |
4565 | #define EV_SELECT_IS_WINSOCKET 1 /* forces EV_SELECT_USE_FD_SET, too */ |
4469 | |
4566 | |
4470 | Note that winsockets handling of fd sets is O(n), so you can easily get a |
4567 | Note that winsockets handling of fd sets is O(n), so you can easily get a |
4471 | complexity in the O(n²) range when using win32. |
4568 | complexity in the O(n²) range when using win32. |
4472 | |
4569 | |
4473 | =item Limited number of file descriptors |
4570 | =head3 Limited number of file descriptors |
4474 | |
4571 | |
4475 | Windows has numerous arbitrary (and low) limits on things. |
4572 | Windows has numerous arbitrary (and low) limits on things. |
4476 | |
4573 | |
4477 | Early versions of winsocket's select only supported waiting for a maximum |
4574 | Early versions of winsocket's select only supported waiting for a maximum |
4478 | of C<64> handles (probably owning to the fact that all windows kernels |
4575 | of C<64> handles (probably owning to the fact that all windows kernels |
… | |
… | |
4493 | runtime libraries. This might get you to about C<512> or C<2048> sockets |
4590 | runtime libraries. This might get you to about C<512> or C<2048> sockets |
4494 | (depending on windows version and/or the phase of the moon). To get more, |
4591 | (depending on windows version and/or the phase of the moon). To get more, |
4495 | you need to wrap all I/O functions and provide your own fd management, but |
4592 | you need to wrap all I/O functions and provide your own fd management, but |
4496 | the cost of calling select (O(n²)) will likely make this unworkable. |
4593 | the cost of calling select (O(n²)) will likely make this unworkable. |
4497 | |
4594 | |
4498 | =back |
|
|
4499 | |
|
|
4500 | =head2 PORTABILITY REQUIREMENTS |
4595 | =head2 PORTABILITY REQUIREMENTS |
4501 | |
4596 | |
4502 | In addition to a working ISO-C implementation and of course the |
4597 | In addition to a working ISO-C implementation and of course the |
4503 | backend-specific APIs, libev relies on a few additional extensions: |
4598 | backend-specific APIs, libev relies on a few additional extensions: |
4504 | |
4599 | |