Can I use ev_loop only for read ?

xiang qian xqterry at gmail.com
Sun Mar 8 13:13:51 CET 2009


Hi
I am working for an packet forwarding tool. It opens 2 fds, reads data  
from one and sends to another.
It was implemented with single thread and uses only default ev_loop  
and I will write a multi-threaded version.

If I create 2 threads per fd, one for reading and another for writing,
reader threads use libev ev_loop, and put any incoming data into queue  
1st and 2nd,
the writer threads just wait for queues and write data to fds but  
doesn't use ev_loop to get EV_WRITE event,
is there any problem ?

Or should I create ev_loop for each writer thread and use  
ev_async_send to notify writers when queues get data?

Which mode is correct ?

thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20090308/ab81b9ba/attachment.html>


More information about the libev mailing list