Description Usage Arguments Value Author(s) See Also Examples
Functions that indicate whether a model folder is currently locked by another process or not. This helps to prevent unintended interactions between processes.
1 2 3 | model_lock(folder=".", file=".lock", timeout1=NULL, timeout2=NULL,
check_interval=1, oncluster=TRUE)
model_unlock(id,folder=".",file=".lock",oncluster=TRUE)
|
folder |
model folder |
file |
file name of the lock file containing the process queue |
timeout1 |
Time in hours the top process in the queue is allowed to run before the current process is stopped. |
timeout2 |
Time in hours the processed is allowed to wait in the queue before it is stopped |
check_interval |
Time in seconds between checking the current position in the queue. |
oncluster |
a logical indicating whether the script is run on cluster or not. On windows a lock file is created, which does not prevent simulatneous access to the model. On the cluster the system command 'mkdir' is used to prevent simultaneous access. This atomicity of check-and-create is ensured at the operating system kernel level. |
id |
process id as returned by model_lock. |
model_lock returns the process id which is needed (only on Windows) to identify the process in model_unlock.
Jan Philipp Dietrich, David Klein
1 2 3 4 5 | #lock folder
id <- model_lock(tempdir())
#unlock folder
model_unlock(id,tempdir())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.