--- Coro-Multicore/README 2015/06/30 01:01:34 1.2 +++ Coro-Multicore/README 2015/07/01 22:53:37 1.3 @@ -9,6 +9,10 @@ use Coro::Multicore (); DESCRIPTION + EXPERIMENTAL WARNING: This module is in its early stages of development. + It's fine to try out, but it didn't receive the normal amount of testing + and real-world usage that my other modules have gone through. + While Coro threads (unlike ithreads) provide real threads similar to pthreads, python threads and so on, they do not run in parallel to each other even on machines with multiple CPUs or multiple CPU cores. @@ -88,7 +92,44 @@ Coro::Multicore to *not* handle the next multicore-enabled request. INTERACTION WITH OTHER SOFTWARE - TODO + This module is very similar to other environments where perl + interpreters are moved between threads, such as mod_perl2, and the same + caveats apply. + + I want to spell out the most important ones: + + pthreads usage + Any creation of pthreads make it impossible to fork portably from a + perl program, as forking from within a threaded program will leave + the program in a state similar to a signal handler. While it might + work on some platforms (as an extension), this might also result in + silent data corruption. It also seems to work most of the time, so + it's hard to test for this. + + I recommend using something like AnyEvent::Fork, which can create + subprocesses safely (via Proc::FastSpawn). + + Similar issues exist for signal handlers, although this module works + hard to keep safe perl signals safe. + + module support + This module moves the same perl interpreter between different + threads. Some modules might get confused by that (although this can + usually be considered a bug). This is a rare case though. + + event loop reliance + To be able to wake up programs waiting for results, this module + relies on an active event loop (via AnyEvent). This is used to + notify the perl interpreter when the asynchronous task is done. + + Since event loops typically fail to work properly after a fork, this + means that some operations that were formerly working will now hang + after fork. + + A workaround is to call "Coro::Multicore::enable 0" after a fork to + disable the module. + + Future versions of this module might do this automatically. BUGS (OS-) threads are never released @@ -99,7 +140,7 @@ Future versions will likely lift this limitation. - AnyEvent is initalised on module load + AnyEvent is initalised at module load time AnyEvent is initialised on module load, as opposed to at a later time.