Assume I have producer and consumer in a monitor.
The code of the consumer signals the producer and then does something else. I know in a Hoare-style monitor, after signaling, the thread that is signaled wakes up and is is now schedule. What about the other instructions in the consumer after the signal? When will the consumer continue?
What if the consumer sends the signal before the producer does the wait? Will the producer be stuck forever?
If there is a context switch will the mutex of the monitor be released?