ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/AnyEvent.pm
(Generate patch)

Comparing Coro/Coro/AnyEvent.pm (file contents):
Revision 1.81 by root, Fri Dec 7 22:37:24 2012 UTC vs.
Revision 1.82 by root, Wed Dec 12 05:06:02 2012 UTC

85What you I<MUST NOT EVER DO> is to block inside an event loop 85What you I<MUST NOT EVER DO> is to block inside an event loop
86callback. The reason is that most event loops are not reentrant and 86callback. The reason is that most event loops are not reentrant and
87this can cause a deadlock at best and corrupt memory at worst. 87this can cause a deadlock at best and corrupt memory at worst.
88 88
89Coro will try to catch you when you block in the event loop 89Coro will try to catch you when you block in the event loop
90("FATAL:$Coro::IDLE blocked itself"), but this is just best effort and 90("FATAL: $Coro::IDLE blocked itself"), but this is just best effort and
91only works when you do not run your own event loop. 91only works when you do not run your own event loop.
92 92
93To avoid this problem, simply do not block inside an event callback 93To avoid this problem, simply do not block inside an event callback
94- start a new thread (e.g. with C<Coro:async_pool>) or use 94- start a new thread (e.g. with C<Coro:async_pool>) or use
95C<Coro::unblock_sub>. 95C<Coro::unblock_sub>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines