Search code examples
libuv

count number of uv_async_send()s which were combined to a single call back


From libuv's documentation : http://docs.libuv.org/en/v1.x/async.html?highlight=uv_async_t

Warning libuv will coalesce calls to uv_async_send(), that is, not every call to it will yield an execution of the callback, the only guarantee is that it will be called at least once. Thus, calling this function may not wakeup the event loop if it was already called previously within a short period of time.

Is there any way to find the number of uv_async_send()s which were combined to invoke single call back ?


Solution

  • No, there is no facility provided for this. You could do it by keeping a counter in your application, but you would need to modify and access it in a thread-safe manner.