Wouldn't `uv_backend_poll` be unix specific?
On Thu, Apr 17, 2014 at 11:21 AM, Saúl Ibarra Corretgé <[email protected]>wrote: > > >> Well, the set of supported platforms would be all those supported by Node. >> >> > I see. Maybe we need some uv_backend_poll(timeout) function to help in the > case I outlined above. > > > I'm trying to figure out if it's possible to have JavaScript run off the >> uv_run() thread. >> >> Say, for example, the JS script needs to create a TCP server. It would >> need to sync up with the uv_run() thread to create the handle and run >> the server. Ideally I would like to be able to block the uv_run() thread >> just for the moment of creation so I can immediately get back the >> result, but if that's not possible then I'll work around it. >> >> > Not sure how well it would work in practice, but you could use a semaphore > + uv_stop the loop. That is, you'd call uv_stop and wait on a semaphore > which is set after uv_run returns, because the loop is stopped. Then you > could do whatever you want, assuming you only do it from one thread. It's > still not thread safe, but you can get away with it since the loop is not > running ;-) After you are done, run the loop again. > > > So I guess the issue I'm trying to tackle is being able to dynamically >> and safely create handles off the uv_run() thread. >> >> > Personally, I don't think that's a change we'd like to make in libuv at > this stage. > > > Cheers, > > -- > Saúl Ibarra Corretgé > http://bettercallsaghul.com > > > -- > You received this message because you are subscribed to the Google Groups > "libuv" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/libuv. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
