On 03/03/15 20:34, Nicolai G. wrote:
Hello,

I use async handlers to put jobs on loop-thread (like connect, listen,
close) , and each time I create uv_async_t, mixin my data in async->data
field, initialize it and call a uv_async_send().
It seemed to work nicely, but now sometimes I get the situation wnen
loop ends while there are active handlers.
Guess a call to uv_async_init() not from loop thread might be the issue.
So what is the polite way to inject your jobs on the loop thread, is
there any standard practice?


Hi,

Indeed, uv_async_init is not thread-safe. You can use a thread-safe queue, queue some work from any thread and use an async handle to process the queue in its callback.

--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.


--
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.

Reply via email to