Setting Mutex lock for file locking

Mutex stands for mutually exclusive. This means that a computer resource can be made available to one user at a time. It can best be explained by this simple example. Person A wants to run a process script and does not want the file to be accessed by anyone else during the run time of the script. The user therefore locks the file. Once the process script has completed running, the computer resource can be unlocked and then becomes available for others to access.

To lock resources on a file during parallel processing, follow these steps:

  1. Assign a constant name to a resource variable (unique in the server as a Mutex).

  2. Create the resource by using the Resource command and click on Action set to Create.

  3. Before processing the file, run the Resource command with Action set to Require.

  4. After processing the file, run the Resource command with Action set to Release.

In this setting, if two processes try to access a file concurrently, one will wait until the other finishes.