How to send Event signal through Processes - C
Posted
by Jamie Keeling
on Stack Overflow
See other posts from Stack Overflow
or by Jamie Keeling
Published on 2010-04-22T13:43:11Z
Indexed on
2010/04/24
21:03 UTC
Read the original article
Hit count: 273
Hello all!
I have an application consisting of two windows, one communicates to the other and sends it a struct constaining two integers (In this case two rolls of a dice).
I will be using events for the following circumstances:
- Process a sends data to process b, process b displays data
- Process a closes, in turn closing process b
- Process b closes a, in turn closing process a
I have noticed that if the second process is constantly waiting for the first process to send data then the program will be just sat waiting, which is where the idea of implementing threads on each process occurred and I have started to implement this already.
The problem i'm having is that I don't exactly have a lot of experience with threads and events so I'm not sure of the best way to actually implement what I want to do.
I'm trying to work out how the other process will know of the event being fired so it can do the tasks it needs to do, I don't understand how one process that is separate from another can tell what the states the events are in especially as it needs to act as soon as the event has changed state.
Thanks for any help
Edit:
I can only use the Create/Set/Open methods for events, sorry for not mentioning it earlier.
© Stack Overflow or respective owner