On Wed, Dec 11, 2013 at 01:11:02PM +1100, Varun Chandramohan 
<cvarunen...@gmail.com> wrote:
> Once I have a sd to add to loop can I call
> 
>     ev_io_init(&d_packet->io, connect_ps_cb, d_packet->connect_sd, EV_WRITE|
> EV_READ);

Funny code formatting in your e-mail.

Anyways, if I understand your mail correctly, you want to add watchers to a
loop running in another thread.

That's fine, as long as you lock the loop (just like your array) with a
mutex or so. See the thread locking example in the manpage. You can use an
async watcher to wake up the loop after you changed it.

Whether overall ti is a good approach I can't tell from your mail, but
adding threads rarely make things better, they do make things much more
complex and error prone usually.

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

_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to