2014-05-14 21:44 GMT+02:00 Saúl Ibarra Corretgé <[email protected]>:
> You need to store your buffers in a queue from your worker thread and
> then process the queue in the callback called after uv_async_send.
>
> Since you are appending to the queue from one thread and processing it
> from another, it needs to be thread-safe.


Which means locking a mutex when writing into the queue and when
reading from it.

Anyhow I don't think the uv_async could work here since you may call
to it X times (as you said), receive just Y events in the reader
thread, and forget data in the queue (maybe, not sure).

-- 
Iñaki Baz Castillo
<[email protected]>

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