Originally
posted by
feldon34:
In my programming experience, I checked to see if another program was running on the computer with the same internal program name. Never heard of a Mutex.
Think of Mutex as "
Mutual
Exclusion"
Assume there is a critical resource (serially-reusable but non-reentrant) that is needed by two or more programs. Those programs do not need to be doing the same tasks, and do not need to have the same program name - they just need exclusive use of the resource for a while.
Each of the several programs will get access to the critical resource by issuing a Mutex.
The effect is like each program asked the system: "Please give me access to this resource, and if you can't do that
right now, then put me in a queue (in request order with everybody else who wants that resource), and
suspend my execution until I can have that resource.
Mutex is not normally/generally/usually used in the way MA3 is apparently using it: "Give me that resource right now, or I intend to commit suicide".
Footnote: Not that it makes any difference, but it's also not clear what "resource" MA3 is looking at.