Just wanted to know if mutual exclusion in monitors is at a procedure/method level or if it is at a monitor level.
I mean, in the first case, there might be 2 threads accessing the monitor, but they would be running in different procedures. In the second case, there won't be 2 threads acceding the monitor even if two different procedures are called.
Assuming it is at a monitor level, it seems much safer. However, aren't there situations in which there could be running 2 different threads in a monitor each modifying different shared variables and the monitor won't allow this to happen? If that is the case, wouldn't this lower the concurrency in the system? Or would it mean that 2 monitors should have been created instead of one?
Ok, I better finish philosophizing :) Thanks in advance