The problems are worse with a network drive (or in my instance with a file on OneDrive). But my testing has been with a local file. Windows 10,, JMP 17.
The scripts “locktest1” and “locktest2” are identical except that the first script updates column 1 of the results table whereas the second script updates the column 2.
By running each script simultaneously in separate JMP instances it is possible to stress-test the logic for handling file-locks.
Line 75 of the scripts contains the path for the results table. Place the results table in a suitable location and update the path variable to point to this location.
Open a JMP session and open locktest1. Show the embedded log.
Open a second JMP session and open locktest2, with an embedded log.
Run the two scripts (I run the first, wait until the log shows i=5 and then run the second, but that is just superstition).
The loop defined on line 79 performs 50 iterations. If the two scripts finish successfully then the outcome should be that the results table contains numbers 1 to 50 in each of the two columns.
There is a table script that will allow you to reset the table contents.
In practice, there are 3 possible failure modes:
- One or more “unable to get end of file marker” messages are displayed. This error occurs when saving, and it is not possible to save the results. Therefore there will be some missing values in the results table.
- At some point, the results table will vanish. If the file cannot be found the scripts abort execution with a “file not found” message.
- Occasionally, both scripts fail to get a lock on the table. This is indicated by both scripts making 500 attempts to get a lock. If you abort the scripts, and then try opening the results table, it will have a file_lock table variable. Both instances of JMP will have the table locked. The only way to unlock it is to close both sessions of JMP.
50 iterations is usually sufficient to observe (1) and (2) but occasionally you need to increase the number of iterations to see (2). Scenario (3) is more likely with 100s of iterations and with the wait on line 100 removed.
-Dave