Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a C++ cross platform "named event like the "CreateEvent()" in Win32?

I am looking for something analogous to CreateEvent(), SetEvent() and WaitForMultipleObjects() from the Win32 world.

Specifically this has to be accessible across processes on the same machine.

We are already using Poco for some cross platform stuff, but I don't see that the Poco::Event is what I want. perhaps i am missing something.

EDIT:

To explain what I want to do:

I want process B to know when something happens in process A. This is trivial in win32 - Each process/thread calls CreateEvent() with a name for the event. Process B calls waitForXObject() and Process A calls SetEvent() when something happens. B is signaled.

Again, this is trivial in win32, but how to do it cross-platform.

like image 820
Tim Avatar asked Apr 19 '10 02:04

Tim


1 Answers

There is no built in way in C++ to do named events. But you can use boost to do it.

You're looking for boost::condition and boost::named_condition

As you also mentioned there exists: Poco.NamedEvent

like image 183
Brian R. Bondy Avatar answered Oct 27 '22 00:10

Brian R. Bondy