http://qs321.pair.com?node_id=905355


in reply to AnyEvent: How to protect critical sections?

If you have code you don't want interrupted, don't yield to AnyEvent functions, it's that simple.

AnyEvent does not run anything in parallel, so as long as you are running your own Perl code, and not calling ->recv, ->send or ->timer, the AnyEvent loop won't run and your code will stay in the critical section uninterrupted.