From cc1c382b0071981b0f3a1cc518dbcab97710b06a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Mar 2010 20:32:20 +0000 Subject: *** empty log message *** --- ev.pod | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'ev.pod') diff --git a/ev.pod b/ev.pod index 88340ac..0cfd949 100644 --- a/ev.pod +++ b/ev.pod @@ -347,9 +347,8 @@ around bugs. =item C -Instead of calling C or C manually after -a fork, you can also make libev check for a fork in each iteration by -enabling this flag. +Instead of calling C manually after a fork, you can also +make libev check for a fork in each iteration by enabling this flag. This works by calling C on every iteration of the loop, and thus this might slow down your event loop if you do a lot of loop @@ -613,9 +612,15 @@ the child process (or both child and parent, but that again makes little sense). You I call it in the child before using any of the libev functions, and it will only take effect at the next C iteration. +Again, you I to call it on I loop that you want to re-use after +a fork, I. This is +because some kernel interfaces *cough* I *cough* do funny things +during fork. + On the other hand, you only need to call this function in the child -process if and only if you want to use the event library in the child. If -you just fork+exec, you don't have to call it at all. +process if and only if you want to use the event loop in the child. If you +just fork+exec or create a new loop in the child, you don't have to call +it at all. The function itself is quite fast and it's usually not a problem to call it just in case after a fork. To make this easy, the function will fit in @@ -627,25 +632,26 @@ quite nicely into a call to C: Like C, but acts on an event loop created by C. Yes, you have to call this on every allocated event loop -after fork that you want to re-use in the child, and how you do this is -entirely your own problem. +after fork that you want to re-use in the child, and how you keep track of +them is entirely your own problem. =item int ev_is_default_loop (loop) Returns true when the given loop is, in fact, the default loop, and false otherwise. -=item unsigned int ev_loop_count (loop) +=item unsigned int ev_iteration (loop) -Returns the count of loop iterations for the loop, which is identical to +Returns the current iteration count for the loop, which is identical to the number of times libev did poll for new events. It starts at C<0> and happily wraps around with enough iterations. This value can sometimes be useful as a generation counter of sorts (it "ticks" the number of loop iterations), as it roughly corresponds with -C and C calls. +C and C calls - and is incremented between the +prepare and check phases. -=item unsigned int ev_loop_depth (loop) +=item unsigned int ev_depth (loop) Returns the number of times C was entered minus the number of times C was exited, in other words, the recursion depth. @@ -655,7 +661,8 @@ C<1>, unless C was invoked recursively (or from another thread), in which case it is higher. Leaving C abnormally (setjmp/longjmp, cancelling the thread -etc.), doesn't count as exit. +etc.), doesn't count as "exit" - consider this as a hint to avoid such +ungentleman behaviour unless it's really convenient. =item unsigned int ev_backend (loop) @@ -4620,13 +4627,28 @@ involves iterating over all running async watchers or all signal numbers. =back -=head1 PORTING FROM 3.X TO 4.X +=head1 PORTING FROM LIBEV 3.X TO 4.X The major version 4 introduced some minor incompatible changes to the API. +At the moment, the C header file tries to implement superficial +compatibility, so most programs should still compile. Those might be +removed in later versions of libev, so better update early than late. + =over 4 -=item C replaced by C in C +=item C renamed to C + +=item C renamed to C + +=item C renamed to C + +Most functions working on C objects don't have an +C prefix, so it was removed. Note that C is +still called C because it would otherwise clash with the +C typedef. + +=item C renamed to C in C This is a simple rename - all other watcher types use their name as revents flag, and now C does, too. -- cgit v1.2.3