--- cvsroot/Async-Interrupt/Interrupt.pm 2009/07/02 16:12:40 1.3 +++ cvsroot/Async-Interrupt/Interrupt.pm 2009/07/02 16:15:52 1.4 @@ -9,7 +9,7 @@ =head1 DESCRIPTION This module implements a single feature only of interest to advanced perl -modules, namely asynchronous interruptions (think "unix signals", which +modules, namely asynchronous interruptions (think "UNIX signals", which are very similar). Sometimes, modules wish to run code asynchronously (in another thread), @@ -39,8 +39,9 @@ Since this kind of interruption is fast, but can only interrupt a I interpreter, there is optional support for also signalling a -pipe - that means you can also wait for the pipe to become readable while -#TODO# +pipe - that means you can also wait for the pipe to become readable (e.g. +via L or L). This, of course, incurs the overhead of a +C and C syscall. =over 4 @@ -102,10 +103,10 @@ Note that, because the callback can be invoked at almost any time, you have to be careful at saving and restoring global variables that Perl -might use (the excetpion is C, which is aved and restored by +might use (the exception is C, which is saved and restored by Async::Interrupt). The callback itself runs as part of the perl context, so you can call any perl functions and modify any perl data structures (in -which case the requireemnts set out for C apply as well). +which case the requirements set out for C apply as well). =item pipe => [$fileno_or_fh_for_reading, $fileno_or_fh_for_writing] @@ -117,7 +118,7 @@ mode. (You can get a portable pipe and set non-blocking mode portably by using -e.g. L from the L distro). +e.g. L from the L distribution). The object will keep a reference to the file handles. @@ -175,10 +176,10 @@ $async->block >> before the critical section, and C<< $async->unblock >> afterwards. -Note that there must be exactly one call of C for ever for every previous call to C (i.e. calls can nest). -Since ensuring this in the presense of exceptions and threads is +Since ensuring this in the presence of exceptions and threads is usually more difficult than you imagine, I recommend using C<< $async->scoped_block >> instead. @@ -198,11 +199,11 @@ =head1 EXAMPLE -#TODO +There really should be a complete C/XS example. Bug me about it. =head1 IMPLEMENTATION DETAILS AND LIMITATIONS -This module works by "hijacking" SIGKILL, which is guarenteed to be always +This module works by "hijacking" SIGKILL, which is guaranteed to be always available in perl, but also cannot be caught, so is always available. Basically, this module fakes the receive of a SIGKILL signal and @@ -212,7 +213,7 @@ It assumes that C and C are both exception-safe to modify (C is used by this module, and perl itself uses -C, so we can assume that this is quite portbale, at least w.r.t. +C, so we can assume that this is quite portable, at least w.r.t. signals). =head1 AUTHOR