vibhor
vibhor

Reputation: 31

Inter-process communication in C

I have a scenario, where one process should wait for a signal from another process, and this wait should be blocking wait, and as soon as it gets a signal, it should wake up.

However, with mechanisms like kill() or raise(), the first process goes to wait state, but periodically checks after a specified amount of time, whether the even/signal occurred or not, and decides to wait or go on. My requirement is a bit stringent, I want that process should wake up at the same instant as signal is received.

Please suggest something.

Upvotes: 1

Views: 161

Answers (1)

Abhijatya Singh
Abhijatya Singh

Reputation: 642

This can be achieved using semaphore,mutex or conditional variable. Or You can write wait and signal function by your own and you can control the behavior of these as per need. For reference see here: IPC examples IPC concept and Examples
Mutex and Conditional Variables

Upvotes: 1

Related Questions