libuv / help

Need help with libuv? Post your question here.
28 stars 7 forks source link

libuv and Kernel Events #23

Open ribucuwa opened 7 years ago

ribucuwa commented 7 years ago

Hi,

I am trying to port some c# code to libuv (c) and wanted to convert ManualResetEvent and AutoResetEvent somehow. So the logic behind them uses CreateEvent , SetEvent and Wait https://msdn.microsoft.com/en-us/library/windows/desktop/ms687069(v=vs.85).aspx

dou you see any possiblity and or have any suggestion to use Kernel Events via libuv? I appreciate any help.

I am guessing that maybe pthread_cond_init, pthread_cond_signal and pthread_cond_wait could help me here but was wondering if there any examples with libuv.

All i want is to set some event in function A and wait in Function B for that event.

Best

bnoordhuis commented 7 years ago

If you want something that integrates with the event loop, uv_async_send() is probably a better fit.

ribucuwa commented 7 years ago

thx for the suggestion. i'll try to look at it for that purpose.