--- libev/ev.pod 2008/05/22 03:06:58 1.160 +++ libev/ev.pod 2008/05/24 03:08:03 1.161 @@ -115,7 +115,7 @@ the beginning of 1970, details are complicated, don't ask). This type is called C, which is what you should use too. It usually aliases to the C type in C, and when you need to do any calculations on -it, you should treat it as some floatingpoint value. Unlike the name +it, you should treat it as some floating point value. Unlike the name component C might indicate, it is also used for time differences throughout libev. @@ -125,7 +125,7 @@ and internal errors (bugs). When libev catches an operating system error it cannot handle (for example -a syscall indicating a condition libev cannot fix), it calls the callback +a system call indicating a condition libev cannot fix), it calls the callback set via C, which is supposed to fix the problem or abort. The default is to print a diagnostic message and to call C. @@ -157,7 +157,7 @@ Sleep for the given interval: The current thread will be blocked until either it is interrupted or the given time interval has passed. Basically -this is a subsecond-resolution C. +this is a sub-second-resolution C. =item int ev_version_major () @@ -202,7 +202,7 @@ Return the set of all backends compiled into this binary of libev and also recommended for this platform. This set is often smaller than the one returned by C, as for example kqueue is broken on -most BSDs and will not be autodetected unless you explicitly request it +most BSDs and will not be auto-detected unless you explicitly request it (assuming you know what you are doing). This is the set of backends that libev will probe for if you specify no backends explicitly. @@ -254,10 +254,10 @@ =item ev_set_syserr_cb (void (*cb)(const char *msg)); -Set the callback function to call on a retryable syscall error (such +Set the callback function to call on a retryable system call error (such as failed select, poll, epoll_wait). The message is a printable string indicating the system call or subsystem causing the problem. If this -callback is set, then libev will expect it to remedy the sitution, no +callback is set, then libev will expect it to remedy the situation, no matter what, when it returns. That is, libev will generally retry the requested operation, or, if the condition doesn't go away, do bad stuff (such as abort). @@ -300,7 +300,7 @@ The default loop is the only loop that can handle C and C watchers, and to do this, it always registers a handler -for C. If this is a problem for your app you can either +for C. If this is a problem for your application you can either create a dynamic loop with C that doesn't do that, or you can simply overwrite the C signal handler I calling C. @@ -319,7 +319,7 @@ =item C -If this flag bit is ored into the flag value (or the program runs setuid +If this flag bit is or'ed into the flag value (or the program runs setuid or setgid) then libev will I look at the environment variable C. Otherwise (the default), this environment variable will override the flags completely if it is found in the environment. This is @@ -336,14 +336,14 @@ and thus this might slow down your event loop if you do a lot of loop iterations and little real work, but is usually not noticeable (on my GNU/Linux system for example, C is actually a simple 5-insn sequence -without a syscall and thus I fast, but my GNU/Linux system also has +without a system call and thus I fast, but my GNU/Linux system also has C which is even faster). The big advantage of this flag is that you can forget about fork (and forget about forgetting to tell libev about forking) when you use this flag. -This flag setting cannot be overriden or specified in the C +This flag setting cannot be overridden or specified in the C environment variable. =item C (value 1, portable select backend) @@ -355,7 +355,7 @@ usually the fastest backend for a low number of (low-numbered :) fds. To get good performance out of this backend you need a high amount of -parallelity (most of the file descriptors should be busy). If you are +parallelism (most of the file descriptors should be busy). If you are writing a server, you should C in a loop to accept as many connections as possible during one iteration. You might also want to have a look at C to increase the amount of @@ -377,11 +377,11 @@ like O(total_fds) where n is the total number of fds (or the highest fd), epoll scales either O(1) or O(active_fds). The epoll design has a number of shortcomings, such as silently dropping events in some hard-to-detect -cases and requiring a syscall per fd change, no fork support and bad +cases and requiring a system call per fd change, no fork support and bad support for dup. While stopping, setting and starting an I/O watcher in the same iteration -will result in some caching, there is still a syscall per such incident +will result in some caching, there is still a system call per such incident (because the fd could point to a different file description now), so its best to avoid that. Also, C'ed file descriptors might not work very well if you register events for both fds. @@ -394,7 +394,7 @@ watchers for a file descriptor until it has been closed, if possible, i.e. keep at least one watcher active per fd at all times. -While nominally embeddeble in other event loops, this feature is broken in +While nominally embeddable in other event loops, this feature is broken in all kernel versions tested so far. =item C (value 8, most BSD clones) @@ -402,7 +402,7 @@ Kqueue deserves special mention, as at the time of this writing, it was broken on all BSDs except NetBSD (usually it doesn't work reliably with anything but sockets and pipes, except on Darwin, where of course -it's completely useless). For this reason it's not being "autodetected" +it's completely useless). For this reason it's not being "auto-detected" unless you explicitly specify it explicitly in the flags (i.e. using C) or libev was compiled on a known-to-be-good (-enough) system like NetBSD. @@ -414,7 +414,7 @@ It scales in the same way as the epoll backend, but the interface to the kernel is more efficient (which says nothing about its actual speed, of course). While stopping, setting and starting an I/O watcher does never -cause an extra syscall as with C, it still adds up to +cause an extra system call as with C, it still adds up to two event changes per incident, support for C is very bad and it drops fds silently in similarly hard-to-detect cases. @@ -439,7 +439,7 @@ This uses the Solaris 10 event port mechanism. As with everything on Solaris, it's really slow, but it still scales very well (O(active_fds)). -Please note that solaris event ports can deliver a lot of spurious +Please note that Solaris event ports can deliver a lot of spurious notifications, so you need to use non-blocking I/O or other means to avoid blocking when no data (or space) is available. @@ -462,7 +462,7 @@ =back -If one or more of these are ored into the flags value, then only these +If one or more of these are or'ed into the flags value, then only these backends will be tried (in the reverse order as listed here). If none are specified, all backends in C will be tried. @@ -504,7 +504,7 @@ Destroys the default loop again (frees all memory and kernel state etc.). None of the active event watchers will be stopped in the normal sense, so e.g. C might still return true. It is your -responsibility to either stop all watchers cleanly yoursef I +responsibility to either stop all watchers cleanly yourself I calling this function, or cope with the fact afterwards (which is usually the easiest thing, you can just ignore the watchers and/or C them for example). @@ -595,7 +595,7 @@ case there are no events and will return after one iteration of the loop. A flags value of C will look for new events (waiting if -neccessary) and will handle those and any outstanding ones. It will block +necessary) and will handle those and any outstanding ones. It will block your process until at least one new event arrives, and will return after one iteration of the loop. This is useful if you are waiting for some external event in conjunction with something not expressible using other @@ -706,11 +706,11 @@ will not be affected. Setting this to a non-null value will not introduce any overhead in libev. -Many (busy) programs can usually benefit by setting the io collect +Many (busy) programs can usually benefit by setting the I/O collect interval to a value near C<0.1> or so, which is often enough for interactive servers (of course not for games), likewise for timeouts. It usually doesn't make much sense to set it to a lower value than C<0.01>, -as this approsaches the timing granularity of most systems. +as this approaches the timing granularity of most systems. =item ev_loop_verify (loop) @@ -751,7 +751,7 @@ Each watcher structure must be initialised by a call to C, which expects a callback to be provided. This -callback gets invoked each time the event occurs (or, in the case of io +callback gets invoked each time the event occurs (or, in the case of I/O watchers, each time the event loop detects that the file descriptor given is readable and/or writable). @@ -837,7 +837,7 @@ =item C -An unspecified error has occured, the watcher has been stopped. This might +An unspecified error has occurred, the watcher has been stopped. This might happen because the watcher could not be properly started because libev ran out of memory, a file descriptor was found to be closed or any other problem. You best act on it by reporting the problem and somehow coping @@ -846,7 +846,7 @@ Libev will usually signal a few "dummy" events together with an error, for example it might indicate that a fd is readable or writable, and if your callbacks is well-written it can just attempt the operation and cope -with the error from read() or write(). This will not work in multithreaded +with the error from read() or write(). This will not work in multi-threaded programs, though, so beware. =back @@ -886,8 +886,8 @@ =item C (ev_TYPE *watcher, callback, [args]) -This convinience macro rolls both C and C macro -calls into a single call. This is the most convinient method to initialise +This convenience macro rolls both C and C macro +calls into a single call. This is the most convenient method to initialise a watcher. The same limitations apply, of course. =item C (loop *, ev_TYPE *watcher) @@ -1069,13 +1069,13 @@ receive "spurious" readiness notifications, that is your callback might be called with C but a subsequent C(2) will actually block because there is no data. Not only are some backends known to create a -lot of those (for example solaris ports), it is very easy to get into +lot of those (for example Solaris ports), it is very easy to get into this situation even with a relatively standard program structure. Thus it is best to always use non-blocking I/O: An extra C(2) returning C is far preferable to a program hanging until some data arrives. If you cannot run the fd in non-blocking mode (for example you should not -play around with an Xlib connection), then you have to seperately re-test +play around with an Xlib connection), then you have to separately re-test whether a file descriptor is really ready with a known-to-be good interface such as poll (fortunately in our Xlib example, Xlib already does this on its own, so its quite safe to use). @@ -1145,7 +1145,7 @@ =item ev_io_set (ev_io *, int fd, int events) Configures an C watcher. The C is the file descriptor to -rceeive events for and events is either C, C or +receive events for and events is either C, C or C to receive the given events. =item int fd [read-only] @@ -1185,7 +1185,7 @@ given time, and optionally repeating in regular intervals after that. The timers are based on real time, that is, if you register an event that -times out after an hour and you reset your system clock to january last +times out after an hour and you reset your system clock to January last year, it will still time out after (roughly) and hour. "Roughly" because detecting time jumps is hard, and some inaccuracies are unavoidable (the monotonic clock option helps a lot here). @@ -1198,7 +1198,7 @@ ev_timer_set (&timer, after + ev_now () - ev_time (), 0.); -The callback is guarenteed to be invoked only after its timeout has passed, +The callback is guaranteed to be invoked only after its timeout has passed, but if multiple timers become ready during the same loop iteration then order of execution is undefined. @@ -1229,13 +1229,13 @@ If the timer is pending, its pending status is cleared. -If the timer is started but nonrepeating, stop it (as if it timed out). +If the timer is started but non-repeating, stop it (as if it timed out). If the timer is repeating, either start it if necessary (with the C value), or reset the running timer to the C value. This sounds a bit complicated, but here is a useful and typical -example: Imagine you have a tcp connection and you want a so-called idle +example: Imagine you have a TCP connection and you want a so-called idle timeout, that is, you want to be called when there have been, say, 60 seconds of inactivity on the socket. The easiest way to do this is to configure an C with a C value of C<60> and then call @@ -1306,11 +1306,11 @@ (and unfortunately a bit complex). Unlike C's, they are not based on real time (or relative time) -but on wallclock time (absolute time). You can tell a periodic watcher +but on wall clock time (absolute time). You can tell a periodic watcher to trigger after some specific point in time. For example, if you tell a -periodic watcher to trigger in 10 seconds (by specifiying e.g. C, that is, an absolute time not a delay) and then reset your system -clock to january of the previous year, then it will take more than year +clock to January of the previous year, then it will take more than year to trigger the event (unlike an C, which would still trigger roughly 10 seconds later as it uses a relative timeout). @@ -1318,7 +1318,7 @@ such as triggering an event on each "midnight, local time", or other complicated, rules. -As with timers, the callback is guarenteed to be invoked only when the +As with timers, the callback is guaranteed to be invoked only when the time (C) has passed, but if multiple periodic timers become ready during the same loop iteration then order of execution is undefined. @@ -1337,7 +1337,7 @@ =item * absolute timer (at = time, interval = reschedule_cb = 0) -In this configuration the watcher triggers an event after the wallclock +In this configuration the watcher triggers an event after the wall clock time C has passed and doesn't repeat. It will not adjust when a time jump occurs, that is, if it is to be run at January 1st 2011 then it will run when the system time reaches or surpasses this time. @@ -1355,7 +1355,7 @@ ev_periodic_set (&periodic, 0., 3600., 0); This doesn't mean there will always be 3600 seconds in between triggers, -but only that the the callback will be called when the system time shows a +but only that the callback will be called when the system time shows a full hour (UTC), or more correctly, when the system time is evenly divisible by 3600. @@ -1367,9 +1367,9 @@ C (the current time), but there is no range requirement for this value, and in fact is often specified as zero. -Note also that there is an upper limit to how often a timer can fire (cpu +Note also that there is an upper limit to how often a timer can fire (CPU speed for example), so if C is very small then timing stability -will of course detoriate. Libev itself tries to be exact to be about one +will of course deteriorate. Libev itself tries to be exact to be about one millisecond (if the OS supports it and the machine is fast enough). =item * manual reschedule mode (at and interval ignored, reschedule_cb = callback) @@ -1448,7 +1448,7 @@ Example: Call a callback every hour, or, more precisely, whenever the system clock is divisible by 3600. The callback invocation times have -potentially a lot of jittering, but good long-term stability. +potentially a lot of jitter, but good long-term stability. static void clock_cb (struct ev_loop *loop, struct ev_io *w, int revents) @@ -1495,8 +1495,8 @@ SIG_DFL (regardless of what it was set to before). If possible and supported, libev will install its handlers with -C behaviour enabled, so syscalls should not be unduly -interrupted. If you have a problem with syscalls getting interrupted by +C behaviour enabled, so system calls should not be unduly +interrupted. If you have a problem with system calls getting interrupted by signals you can block all signals in an C watcher and unblock them in an C watcher. @@ -1541,13 +1541,13 @@ loop isn't entered (or is continued from a watcher). Only the default event loop is capable of handling signals, and therefore -you can only rgeister child watchers in the default event loop. +you can only register child watchers in the default event loop. =head3 Process Interaction Libev grabs C as soon as the default event loop is initialised. This is necessary to guarantee proper behaviour even if -the first child watcher is started after the child exits. The occurance +the first child watcher is started after the child exits. The occurrence of C is recorded asynchronously, but child reaping is done synchronously as part of the event loop processing. Libev always reaps all children, even ones not watched. @@ -1626,7 +1626,7 @@ =head2 C - did the file attributes just change? -This watches a filesystem path for attribute changes. That is, it calls +This watches a file system path for attribute changes. That is, it calls C regularly (or when the OS says it changed) and sees if it changed compared to the last time, invoking the callback if it did. @@ -1670,7 +1670,7 @@ use 64 bit file offsets the programs will fail. In that case you have to compile libev with the same flags to get binary compatibility. This is obviously the case with any flags that change the ABI, but the problem is -most noticably with ev_stat and largefile support. +most noticeably with ev_stat and large file support. =head3 Inotify @@ -1690,8 +1690,8 @@ =head3 The special problem of stat time resolution -The C syscall only supports full-second resolution portably, and -even on systems where the resolution is higher, many filesystems still +The C system call only supports full-second resolution portably, and +even on systems where the resolution is higher, many file systems still only support whole seconds. That means that, if the time is the only thing that changes, you can @@ -1761,7 +1761,7 @@ =item const char *path [read-only] -The filesystem path that is being watched. +The file system path that is being watched. =back @@ -1897,7 +1897,7 @@ to be watched by the other library, registering C watchers for them and starting an C watcher for any timeouts (many libraries provide just this functionality). Then, in the check watcher you check for -any events that occured (by checking the pending status of all watchers +any events that occurred (by checking the pending status of all watchers and stopping them) and call back into the library. The I/O and timer callbacks will never actually be called (but must be valid nevertheless, because you never know, you know?). @@ -2009,7 +2009,7 @@ in the prepare watcher and would dispose of the check watcher. Method 3: If the module to be embedded supports explicit event -notification (adns does), you can also make use of the actual watcher +notification (libadns does), you can also make use of the actual watcher callbacks, and only destroy/create the watchers in the prepare watcher. static void @@ -2034,7 +2034,7 @@ // do not ever call adns_afterpoll Method 4: Do not use a prepare or check watcher because the module you -want to embed is too inflexible to support it. Instead, youc na override +want to embed is too inflexible to support it. Instead, you can override their poll function. The drawback with this solution is that the main loop is now no longer controllable by EV. The C module does this. @@ -2128,13 +2128,13 @@ embeddable. If the callback is C<0>, then C will be invoked automatically, otherwise it is the responsibility of the callback to invoke it (it will continue to be called until the sweep has been done, -if you do not want thta, you need to temporarily stop the embed watcher). +if you do not want that, you need to temporarily stop the embed watcher). =item ev_embed_sweep (loop, ev_embed *) Make a single, non-blocking sweep over the embedded loop. This works similarly to C, but in the most -apropriate way for embedded loops. +appropriate way for embedded loops. =item struct ev_loop *other [read-only] @@ -2146,8 +2146,8 @@ Example: Try to get an embeddable event loop and embed it into the default event loop. If that is not possible, use the default loop. The default -loop is stored in C, while the mebeddable loop is stored in -C (which is C in the acse no embeddable loop can be +loop is stored in C, while the embeddable loop is stored in +C (which is C in the case no embeddable loop can be used). struct ev_loop *loop_hi = ev_default_init (0); @@ -2251,7 +2251,7 @@ To implement race-free queueing, you simply add to the queue in the signal handler but you block the signal handler in the watcher callback. Here is an example that does that for -some fictitiuous SIGUSR1 handler: +some fictitious SIGUSR1 handler: static ev_async mysig; @@ -2335,11 +2335,11 @@ Sends/signals/activates the given C watcher, that is, feeds an C event on the watcher into the event loop. Unlike C, this call is safe to do in other threads, signal or -similar contexts (see the dicusssion of C in the embedding +similar contexts (see the discussion of C in the embedding section below on what exactly this means). -This call incurs the overhead of a syscall only once per loop iteration, -so while the overhead might be noticable, it doesn't apply to repeated +This call incurs the overhead of a system call only once per loop iteration, +so while the overhead might be noticeable, it doesn't apply to repeated calls to C. =item bool = ev_async_pending (ev_async *) @@ -2351,10 +2351,10 @@ C sets a flag in the watcher and wakes up the loop. When the loop iterates next and checks for the watcher to have become active, it will reset the flag again. C can be used to very -quickly check wether invoking the loop might be a good idea. +quickly check whether invoking the loop might be a good idea. -Not that this does I check wether the watcher itself is pending, only -wether it has been requested to make this watcher pending. +Not that this does I check whether the watcher itself is pending, only +whether it has been requested to make this watcher pending. =back @@ -2375,7 +2375,7 @@ If C is less than 0, then no I/O watcher will be started and events is being ignored. Otherwise, an C watcher for the given C and -C set will be craeted and started. +C set will be created and started. If C is less than 0, then no timeout watcher will be started. Otherwise an C watcher with after = C (and @@ -2410,7 +2410,7 @@ =item ev_feed_signal_event (ev_loop *loop, int signum) -Feed an event as if the given signal occured (C must be the default +Feed an event as if the given signal occurred (C must be the default loop!). =back @@ -2449,7 +2449,7 @@ =head1 C++ SUPPORT Libev comes with some simplistic wrapper classes for C++ that mainly allow -you to use some convinience methods to start/stop watchers and also change +you to use some convenience methods to start/stop watchers and also change the callback model to a model using method callbacks on objects. To use it, @@ -2560,9 +2560,9 @@ Associates a different C with this watcher. You can only do this when the watcher is inactive (and not pending either). -=item w->set ([args]) +=item w->set ([arguments]) -Basically the same as C, with the same args. Must be +Basically the same as C, with the same arguments. Must be called at least once. Unlike the C counterpart, an active watcher gets automatically stopped and restarted when reconfiguring it with this method. @@ -2614,7 +2614,7 @@ =head1 OTHER LANGUAGE BINDINGS Libev does not offer other language bindings itself, but bindings for a -numbe rof languages exist in the form of third-party packages. If you know +number of languages exist in the form of third-party packages. If you know any interesting language binding in addition to the ones listed here, drop me a note. @@ -2634,7 +2634,7 @@ =item Ruby Tony Arcieri has written a ruby extension that offers access to a subset -of the libev API and adds filehandle abstractions, asynchronous DNS and +of the libev API and adds file handle abstractions, asynchronous DNS and more on top of it. It can be found via gem servers. Its homepage is at L. @@ -2648,7 +2648,7 @@ =head1 MACRO MAGIC -Libev can be compiled with a variety of options, the most fundamantal +Libev can be compiled with a variety of options, the most fundamental of which is C. This option determines whether (most) functions and callbacks have an initial C argument. @@ -2732,7 +2732,7 @@ =head2 FILESETS Depending on what features you need you need to include one or more sets of files -in your app. +in your application. =head3 CORE EVENT LOOP @@ -2793,7 +2793,7 @@ =head3 AUTOCONF SUPPORT -Instead of using C and providing your config in +Instead of using C and providing your configuration in whatever way you want, you can also C in your F and leave C undefined. F will then include F and configure itself accordingly. @@ -2805,7 +2805,7 @@ =head2 PREPROCESSOR SYMBOLS/MACROS Libev can be configured via a variety of preprocessor symbols you have to -define before including any of its files. The default in the absense of +define before including any of its files. The default in the absence of autoconf is noted for every option. =over 4 @@ -2821,7 +2821,7 @@ =item EV_USE_MONOTONIC If defined to be C<1>, libev will try to detect the availability of the -monotonic clock option at both compiletime and runtime. Otherwise no use +monotonic clock option at both compile time and runtime. Otherwise no use of the monotonic clock option will be attempted. If you enable this, you usually have to link against librt or something similar. Enabling it when the functionality isn't available is safe, though, although you have @@ -2831,8 +2831,8 @@ =item EV_USE_REALTIME If defined to be C<1>, libev will try to detect the availability of the -realtime clock option at compiletime (and assume its availability at -runtime if successful). Otherwise no use of the realtime clock option will +real-time clock option at compile time (and assume its availability at +runtime if successful). Otherwise no use of the real-time clock option will be attempted. This effectively replaces C by C and will not normally affect correctness. See the note about libraries in the description of C, though. @@ -2853,7 +2853,7 @@ =item EV_USE_SELECT If undefined or defined to be C<1>, libev will compile in support for the -C(2) backend. No attempt at auto-detection will be done: if no other method takes over, select will be it. Otherwise the select backend will not be compiled in. @@ -2861,7 +2861,7 @@ If defined to C<1>, then the select backend will use the system C structure. This is useful if libev doesn't compile due to a missing -C or C definition or it misguesses the bitset layout on +C or C definition or it mis-guesses the bitset layout on exotic systems. This usually limits the range of file descriptors to some low limit such as 1024 or might have other limitations (winsocket only allows 64 sockets). The C macro, set before compilation, might @@ -2920,7 +2920,7 @@ =item EV_USE_DEVPOLL -reserved for future expansion, works like the USE symbols above. +Reserved for future expansion, works like the USE symbols above. =item EV_USE_INOTIFY @@ -2937,7 +2937,7 @@ that you know is safe for your purposes. It is used both for signal handler "locking" as well as for signal and thread safety in C watchers. -In the absense of this define, libev will use C +In the absence of this define, libev will use C (from F), which is usually good enough on most platforms. =item EV_H @@ -2986,8 +2986,8 @@ and time, so using the defaults of five priorities (-2 .. +2) is usually fine. -If your embedding app does not need any priorities, defining these both to -C<0> will save some memory and cpu. +If your embedding application does not need any priorities, defining these both to +C<0> will save some memory and CPU. =item EV_PERIODIC_ENABLE @@ -3025,7 +3025,7 @@ If you need to shave off some kilobytes of code at the expense of some speed, define this symbol to C<1>. Currently this is used to override some -inlining decisions, saves roughly 30% codesize of amd64. It also selects a +inlining decisions, saves roughly 30% code size on amd64. It also selects a much smaller 2-heap for timer management over the default 4-heap. =item EV_PID_HASHSIZE @@ -3048,7 +3048,7 @@ Heaps are not very cache-efficient. To improve the cache-efficiency of the timer and periodics heap, libev uses a 4-heap when this symbol is defined to C<1>. The 4-heap uses more complicated (longer) code but has -noticably faster performance with many (thousands) of watchers. +noticeably faster performance with many (thousands) of watchers. The default is C<1> unless C is set in which case it is C<0> (disabled). @@ -3060,7 +3060,7 @@ the heap structure (selected by defining C to C<1>), which uses 8-12 bytes more per watcher and a few hundred bytes more code, but avoids random read accesses on heap changes. This improves performance -noticably with with many (hundreds) of watchers. +noticeably with with many (hundreds) of watchers. The default is C<1> unless C is set in which case it is C<0> (disabled). @@ -3106,7 +3106,7 @@ =head2 EXPORTED API SYMBOLS -If you need to re-export the API (e.g. via a dll) and you need a list of +If you need to re-export the API (e.g. via a DLL) and you need a list of exported symbols, you can use the provided F files which list all public symbols, one per line: @@ -3115,7 +3115,7 @@ This can also be used to rename all public symbols to avoid clashes with multiple versions of libev linked together (which is obviously bad in -itself, but sometimes it is inconvinient to avoid this). +itself, but sometimes it is inconvenient to avoid this). A sed command like this will create wrapper C<#define>'s that you need to include before including F: @@ -3164,7 +3164,7 @@ =head2 THREADS -Libev itself is completely threadsafe, but it uses no locking. This +Libev itself is completely thread-safe, but it uses no locking. This means that you can use as many loops as you want in parallel, as long as only one thread ever calls into one libev function with the same loop parameter. @@ -3181,7 +3181,7 @@ =over 4 =item * most applications have a main thread: use the default libev loop -in that thread, or create a seperate thread running only the default loop. +in that thread, or create a separate thread running only the default loop. This helps integrating other libraries or software modules that use libev themselves and don't care/know about threading. @@ -3192,9 +3192,9 @@ exists, but it is always a good start. =item * other models exist, such as the leader/follower pattern, where one -loop is handed through multiple threads in a kind of round-robbin fashion. +loop is handed through multiple threads in a kind of round-robin fashion. -Chosing a model is hard - look around, learn, know that usually you cna do +Choosing a model is hard - look around, learn, know that usually you can do better than you currently do :-) =item * often you need to talk to some other thread which blocks in the @@ -3205,7 +3205,7 @@ =head2 COROUTINES -Libev is much more accomodating to coroutines ("cooperative threads"): +Libev is much more accommodating to coroutines ("cooperative threads"): libev fully supports nesting calls to it's functions from different coroutines (e.g. you can call C on the same loop from two different coroutines and switch freely between both coroutines running the @@ -3263,7 +3263,7 @@ A change means an I/O watcher gets started or stopped, which requires libev to recalculate its status (and possibly tell the kernel, depending -on backend and wether C was used). +on backend and whether C was used). =item Activating one watcher (putting it into the pending state): O(1) @@ -3280,7 +3280,7 @@ =item Processing signals: O(max_signal_number) -Sending involves a syscall I there were no other C +Sending involves a system call I there were no other C calls in the current loop iteration. Checking for async and signal events involves iterating over all running async watchers or all signal numbers. @@ -3310,7 +3310,7 @@ more than a hundred or so sockets, then likely it needs to use a totally different implementation for windows, as libev offers the POSIX readiness notification model, which cannot be implemented efficiently on windows -(microsoft monopoly games). +(Microsoft monopoly games). =over 4 @@ -3323,7 +3323,7 @@ discussion of the C, C and C preprocessor symbols for more info. -The configuration for a "naked" win32 using the microsoft runtime +The configuration for a "naked" win32 using the Microsoft runtime libraries and raw winsocket select is: #define EV_USE_SELECT 1 @@ -3338,7 +3338,7 @@ Early versions of winsocket's select only supported waiting for a maximum of C<64> handles (probably owning to the fact that all windows kernels -can only wait for C<64> things at the same time internally; microsoft +can only wait for C<64> things at the same time internally; Microsoft recommends spawning a chain of threads and wait for 63 handles and the previous thread in each. Great). @@ -3347,11 +3347,11 @@ call (which might be in libev or elsewhere, for example, perl does its own select emulation on windows). -Another limit is the number of file descriptors in the microsoft runtime +Another limit is the number of file descriptors in the Microsoft runtime libraries, which by default is C<64> (there must be a hidden I<64> fetish -or something like this inside microsoft). You can increase this by calling +or something like this inside Microsoft). You can increase this by calling C<_setmaxstdio>, which can increase this limit to C<2048> (another -arbitrary limit), but is broken in many versions of the microsoft runtime +arbitrary limit), but is broken in many versions of the Microsoft runtime libraries. This might get you to about C<512> or C<2048> sockets (depending on @@ -3418,14 +3418,14 @@ However, these are unavoidable for many reasons. For one, each compiler has different warnings, and each user has different tastes regarding warning options. "Warn-free" code therefore cannot be a goal except when -targetting a specific compiler and compiler-version. +targeting a specific compiler and compiler-version. Another reason is that some compiler warnings require elaborate workarounds, or other changes to the code that make it less clear and less maintainable. And of course, some compiler warnings are just plain stupid, or simply -wrong (because they don't actually warn about the cindition their message +wrong (because they don't actually warn about the condition their message seems to warn about). While libev is written to generate as few warnings as possible, @@ -3447,7 +3447,7 @@ ==2274== possibly lost: 0 bytes in 0 blocks. ==2274== still reachable: 256 bytes in 1 blocks. -then there is no memory leak. Similarly, under some circumstances, +Then there is no memory leak. Similarly, under some circumstances, valgrind might report kernel bugs as if it were a bug in libev, or it might be confused (it is a very good tool, but only a tool).