my bug or libev's? when multi-thread and multi-loop

Marc Lehmann schmorp at
Tue Dec 2 14:33:46 CET 2008

On Tue, Dec 02, 2008 at 04:59:11PM +0800, CodeAll <codeallcn at> wrote:
> 1. a little like,
> but i tried poll backend, has problem too

Not at all, actually.

> 2. when i generate a lot of request from 10 client, the server choose to not
> keepalive(one request per connection), but the system is reusing fd. Like,
> fd = 14 are closed, after a well, fd = 14 are used again. I see this in
> io_cb()'s debug info and strace's epoll_wait(xxx)

Not sure whwt the relevance of that is, but in general, you have to stop a
watcher when you close a fd.

The documentation epxlains this in detail.

However, this would not cause the problems you see.

It really looks much more like you accessed the same event loop form
multiple threads, or had another bug in your program, such as not
initialialising the file descriptor number properly.

Without an example program showing the issue or a minimal amount of
additional info (libev version, strace), there is nothing more that I cna

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list