On 11/26/13 11:26 AM, Sarav Sandhu wrote:
Well I did know that function but I've heard that "libuv may also
combine multiple calls to uv_async_send and invoke your callback only
once. The only guarantee that libuv makes is – The callback function is
called /at least once/ after the call to uv_async_send." at this link :
http://nikhilm.github.io/uvbook/threads.html#inter-thread-communication
Now the example supplied with the book mentioned on the link has a
global uv_async_t object and the uv_async_send calls are
made repetitively using this global object. I want to know if the
problem mentioned above will go away if the object is locally declared
in user thread. Book Example Code:
https://github.com/nikhilm/uvbook/blob/master/code/progress/main.c
It's not really safe to attach something to async->data and then use it
in the callback, libuv could coalesce the calls and then the pointer
would be overwritten before you get a chance to read it.
--
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/groups/opt_out.