ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.63 by root, Thu Nov 29 20:05:59 2007 UTC vs.
Revision 1.65 by ayin, Sat Dec 1 15:38:54 2007 UTC

274a fork, you can also make libev check for a fork in each iteration by 274a fork, you can also make libev check for a fork in each iteration by
275enabling this flag. 275enabling this flag.
276 276
277This works by calling C<getpid ()> on every iteration of the loop, 277This works by calling C<getpid ()> on every iteration of the loop,
278and thus this might slow down your event loop if you do a lot of loop 278and thus this might slow down your event loop if you do a lot of loop
279iterations and little real work, but is usually not noticable (on my 279iterations and little real work, but is usually not noticeable (on my
280Linux system for example, C<getpid> is actually a simple 5-insn sequence 280Linux system for example, C<getpid> is actually a simple 5-insn sequence
281without a syscall and thus I<very> fast, but my Linux system also has 281without a syscall and thus I<very> fast, but my Linux system also has
282C<pthread_atfork> which is even faster). 282C<pthread_atfork> which is even faster).
283 283
284The big advantage of this flag is that you can forget about fork (and 284The big advantage of this flag is that you can forget about fork (and
1457 1457
1458 // create io watchers for each fd and a timer before blocking 1458 // create io watchers for each fd and a timer before blocking
1459 static void 1459 static void
1460 adns_prepare_cb (ev_loop *loop, ev_prepare *w, int revents) 1460 adns_prepare_cb (ev_loop *loop, ev_prepare *w, int revents)
1461 { 1461 {
1462 int timeout = 3600000;truct pollfd fds [nfd]; 1462 int timeout = 3600000;
1463 struct pollfd fds [nfd];
1463 // actual code will need to loop here and realloc etc. 1464 // actual code will need to loop here and realloc etc.
1464 adns_beforepoll (ads, fds, &nfd, &timeout, timeval_from (ev_time ())); 1465 adns_beforepoll (ads, fds, &nfd, &timeout, timeval_from (ev_time ()));
1465 1466
1466 /* the callback is illegal, but won't be called as we stop during check */ 1467 /* the callback is illegal, but won't be called as we stop during check */
1467 ev_timer_init (&tw, 0, timeout * 1e-3); 1468 ev_timer_init (&tw, 0, timeout * 1e-3);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines