Porting windows manual-reset event to Linux?

后端 未结 7 1610
别那么骄傲
别那么骄傲 2020-11-30 05:23

Is there any easier solution in porting a windows manual-reset event to pthread, than a pthread conditional-variable + pthread mutex + a flag if event is set or unset?

7条回答
  •  时光说笑
    2020-11-30 05:43

    We were looking for a similar solution to port some heavily-multithreaded C++ code from Windows to Linux, and ended up writing an open source, MIT-licensed Win32 Events for Linux library. It should be the solution you are looking for, and has been heavily vetted for performance and resource consumption.

    It implements manual and auto-reset events, and both the WaitForSingleObject and WaitForMultipleObject functionalities.

提交回复
热议问题