joyent / libuv

Go to
https://github.com/libuv/libuv
3.27k stars 653 forks source link

Add the ability to pass a uv_handle_t to a new event loop #1301

Open kellabyte opened 10 years ago

kellabyte commented 10 years ago

It would be really great to avoid having to implement the complexity of https://github.com/joyent/libuv/blob/master/test/benchmark-multi-accept.c and avoid sending over IPC to load balance on other event loops. I find this code hard to follow and it's the part I struggle with the most out of all my libuv calling code.

Potentially latency can be improved if this isn't done over IPC?

piscisaureus commented 10 years ago

I agree with the general observation that this could be done better.

The way to go IMO would be to add an easier API to share handles within a process. Then the user could create a separate thread w/ an event loop that dispatches incoming connections to the different worker threads/loops.

kellabyte commented 10 years ago

@piscisaureus That sounds great! :)

indutny commented 10 years ago

Yeah, this sounds reasonable indeed.