libev tight loop

Marc Lehmann schmorp at schmorp.de
Tue Oct 27 18:54:41 CET 2020


On Tue, Oct 27, 2020 at 01:54:38AM -0400, Felipe Gasper <felipe at felipegasper.com> wrote:
> strace perl -MAnyEvent -e'AnyEvent->condvar()->recv()'
> ----
> 
> … causes tight-loop 0-second “epoll_wait”s.
> 
> Obviously this isn’t very useful logic, so maybe you don’t consider this a bug, but just in case I thought I’d point it out.

I know - it's suboptimal behaviour, but since cases like this are always
applciation bugs, I decided that adding overhead to work around it is not
worth the effort, especially as the behaviour is actually correct.

It's also not an issue in libev or EV, but is due to how AnyEvent
implements its condvar interface - EV effectively detects that there is a
deadlock, but AnyEvent does not define deadlocks.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list