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

Comparing libev/ev.3 (file contents):
Revision 1.103 by root, Fri May 1 17:23:34 2015 UTC vs.
Revision 1.106 by root, Wed Nov 16 17:39:52 2016 UTC

1.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) 1.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
2.\" 2.\"
3.\" Standard preamble: 3.\" Standard preamble:
4.\" ======================================================================== 4.\" ========================================================================
5.de Sp \" Vertical space (when we can't use .PP) 5.de Sp \" Vertical space (when we can't use .PP)
6.if t .sp .5v 6.if t .sp .5v
131.\} 131.\}
132.rm #[ #] #H #V #F C 132.rm #[ #] #H #V #F C
133.\" ======================================================================== 133.\" ========================================================================
134.\" 134.\"
135.IX Title "LIBEV 3" 135.IX Title "LIBEV 3"
136.TH LIBEV 3 "2015-05-01" "libev-4.19" "libev - high performance full featured event loop" 136.TH LIBEV 3 "2016-11-16" "libev-4.23" "libev - high performance full featured event loop"
137.\" For nroff, turn off justification. Always turn off hyphenation; it makes 137.\" For nroff, turn off justification. Always turn off hyphenation; it makes
138.\" way too many mistakes in technical documents. 138.\" way too many mistakes in technical documents.
139.if n .ad l 139.if n .ad l
140.nh 140.nh
141.SH "NAME" 141.SH "NAME"
541GNU/Linux system for example, \f(CW\*(C`getpid\*(C'\fR is actually a simple 5\-insn sequence 541GNU/Linux system for example, \f(CW\*(C`getpid\*(C'\fR is actually a simple 5\-insn sequence
542without a system call and thus \fIvery\fR fast, but my GNU/Linux system also has 542without a system call and thus \fIvery\fR fast, but my GNU/Linux system also has
543\&\f(CW\*(C`pthread_atfork\*(C'\fR which is even faster). 543\&\f(CW\*(C`pthread_atfork\*(C'\fR which is even faster).
544.Sp 544.Sp
545The big advantage of this flag is that you can forget about fork (and 545The big advantage of this flag is that you can forget about fork (and
546forget about forgetting to tell libev about forking) when you use this 546forget about forgetting to tell libev about forking, although you still
547flag. 547have to ignore \f(CW\*(C`SIGPIPE\*(C'\fR) when you use this flag.
548.Sp 548.Sp
549This flag setting cannot be overridden or specified in the \f(CW\*(C`LIBEV_FLAGS\*(C'\fR 549This flag setting cannot be overridden or specified in the \f(CW\*(C`LIBEV_FLAGS\*(C'\fR
550environment variable. 550environment variable.
551.ie n .IP """EVFLAG_NOINOTIFY""" 4 551.ie n .IP """EVFLAG_NOINOTIFY""" 4
552.el .IP "\f(CWEVFLAG_NOINOTIFY\fR" 4 552.el .IP "\f(CWEVFLAG_NOINOTIFY\fR" 4
816to reinitialise the kernel state for backends that have one. Despite 816to reinitialise the kernel state for backends that have one. Despite
817the name, you can call it anytime you are allowed to start or stop 817the name, you can call it anytime you are allowed to start or stop
818watchers (except inside an \f(CW\*(C`ev_prepare\*(C'\fR callback), but it makes most 818watchers (except inside an \f(CW\*(C`ev_prepare\*(C'\fR callback), but it makes most
819sense after forking, in the child process. You \fImust\fR call it (or use 819sense after forking, in the child process. You \fImust\fR call it (or use
820\&\f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR) in the child before resuming or calling \f(CW\*(C`ev_run\*(C'\fR. 820\&\f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR) in the child before resuming or calling \f(CW\*(C`ev_run\*(C'\fR.
821.Sp
822In addition, if you want to reuse a loop (via this function or
823\&\f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR), you \fIalso\fR have to ignore \f(CW\*(C`SIGPIPE\*(C'\fR.
821.Sp 824.Sp
822Again, you \fIhave\fR to call it on \fIany\fR loop that you want to re-use after 825Again, you \fIhave\fR to call it on \fIany\fR loop that you want to re-use after
823a fork, \fIeven if you do not plan to use the loop in the parent\fR. This is 826a fork, \fIeven if you do not plan to use the loop in the parent\fR. This is
824because some kernel interfaces *cough* \fIkqueue\fR *cough* do funny things 827because some kernel interfaces *cough* \fIkqueue\fR *cough* do funny things
825during fork. 828during fork.
2343Periodic watchers are also timers of a kind, but they are very versatile 2346Periodic watchers are also timers of a kind, but they are very versatile
2344(and unfortunately a bit complex). 2347(and unfortunately a bit complex).
2345.PP 2348.PP
2346Unlike \f(CW\*(C`ev_timer\*(C'\fR, periodic watchers are not based on real time (or 2349Unlike \f(CW\*(C`ev_timer\*(C'\fR, periodic watchers are not based on real time (or
2347relative time, the physical time that passes) but on wall clock time 2350relative time, the physical time that passes) but on wall clock time
2348(absolute time, the thing you can read on your calender or clock). The 2351(absolute time, the thing you can read on your calendar or clock). The
2349difference is that wall clock time can run faster or slower than real 2352difference is that wall clock time can run faster or slower than real
2350time, and time jumps are not uncommon (e.g. when you adjust your 2353time, and time jumps are not uncommon (e.g. when you adjust your
2351wrist-watch). 2354wrist-watch).
2352.PP 2355.PP
2353You can tell a periodic watcher to trigger after some specific point 2356You can tell a periodic watcher to trigger after some specific point
5409Libev assumes not only that all watcher pointers have the same internal 5412Libev assumes not only that all watcher pointers have the same internal
5410structure (guaranteed by \s-1POSIX\s0 but not by \s-1ISO C\s0 for example), but it also 5413structure (guaranteed by \s-1POSIX\s0 but not by \s-1ISO C\s0 for example), but it also
5411assumes that the same (machine) code can be used to call any watcher 5414assumes that the same (machine) code can be used to call any watcher
5412callback: The watcher callbacks have different type signatures, but libev 5415callback: The watcher callbacks have different type signatures, but libev
5413calls them using an \f(CW\*(C`ev_watcher *\*(C'\fR internally. 5416calls them using an \f(CW\*(C`ev_watcher *\*(C'\fR internally.
5417.IP "null pointers and integer zero are represented by 0 bytes" 4
5418.IX Item "null pointers and integer zero are represented by 0 bytes"
5419Libev uses \f(CW\*(C`memset\*(C'\fR to initialise structs and arrays to \f(CW0\fR bytes, and
5420relies on this setting pointers and integers to null.
5414.IP "pointer accesses must be thread-atomic" 4 5421.IP "pointer accesses must be thread-atomic" 4
5415.IX Item "pointer accesses must be thread-atomic" 5422.IX Item "pointer accesses must be thread-atomic"
5416Accessing a pointer value must be atomic, it must both be readable and 5423Accessing a pointer value must be atomic, it must both be readable and
5417writable in one piece \- this is the case on all current architectures. 5424writable in one piece \- this is the case on all current architectures.
5418.ie n .IP """sig_atomic_t volatile"" must be thread-atomic as well" 4 5425.ie n .IP """sig_atomic_t volatile"" must be thread-atomic as well" 4

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines