The essence of the algorithm (c libevent everything worked):
- One loop is used to listen to the socket.
- Several threads start, they hibernate. Each thread attaches an event to Read.
- According to the assemblet, they all awaken, and who had ... the first one awakened, he captured the mutex, took the connection ...
- We remove blocking, threads fall asleep., And our thread works out ...
- A pool is taken and a file descriptor and the necessary buffers (in / in) and structures are put into it. id block with mutex.
- Next, we organize self-made noblocked reading, code like
buffer_event
After the data will be given, we release the pool and the thread goes to sleep. further n 3.
I have an error:
Assertion failed: (("libev: ev_loop recursion during release detected", loop_done != EVBREAK_RECURSE)), function ev_run, file ev.c, line 2392.
github code Reading the INSTALL
file - for most unix systems, it should compile without problems, libev should be installed, if not compiled, then edit the path in the Makefile.am and then everything from the first step ./autogen.sh