1

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your suggestion. We did tried IPC, but here is the problem we are facing: 1. We can't use busy wait for continuously checking the shared memory, as we need the process to actually do a blocking wait. 2. Currently, we can go upto minimum of 17 us of blocking time for the first process, which is quite high than we need. We actually want another process to get scheduled in this time. My understanding is that, the process consumes atleast a minimum specified amount of time, before it schedules out. We need to reduce this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.