Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Events be Inter-Process?

I have created an event in one process and to test, sent the event handle via a pipe to a totally separate process (not a child thread)

When I fire the event in the first, WaitForSingleObject does not detect the event so I am guessing the answer is no unless I missed some trick in the SECURITY_ATTRIBUTES structure?

Or perhaps I need to use a named event and call OpenEvent()?

In this case I cannot use window messages because I am trying to signal a windows service. I could use the pipe, but there will be many of these applications, and I would like to find a "low cost" solution if possible.

Other options like Memory mapped files have even more overhead than the pipe?

How would you do this?

like image 361
Mike Trader Avatar asked Mar 09 '09 09:03

Mike Trader


People also ask

What is the meaning of inter process?

Interprocess communication (IPC) is a set of programming interfaces that allow a programmer to coordinate activities among different program processes that can run concurrently in an operating system. This allows a program to handle many user requests at the same time.

What do you mean by Inter process communication explain with an example?

Inter-process communication (IPC) is a mechanism that allows processes to communicate with each other and synchronize their actions. The communication between these processes can be seen as a method of co-operation between them. Processes can communicate with each other through both: Shared Memory. Message passing.


1 Answers

You need to create a named event and open it in both processes. If you have multiple processes listening, you may consider using a semaphore.

like image 148
i_am_jorf Avatar answered Sep 22 '22 11:09

i_am_jorf