0

Suppose I've a main loop that handle all the new connection and several thread all running its own loop. I would like to distribute my clients to these loops. Is it thread-safe to create a client in the main thread and pass to the init function another loop (that would be running on another thread), and start read ? If no, how to achieve that ? (I guess an idle function that handle a queue of work would do the trick...)

hl037_
  • 3,520
  • 1
  • 27
  • 58

1 Answers1

0

No, it's not safe. If you want to achieve that you should use uv_write2 and send the handle to the other loop over a pipe.

saghul
  • 1,990
  • 1
  • 13
  • 15