summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-20 18:45:16 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-20 18:45:16 +0200
commitb0e9190cda2d95ac57f05edd53bbfce8342cb7e1 (patch)
treef8a78f20f9b83f479b0d10fc1b8e94810d75ec37
parent88ef82a2a8e398728e05ef91decd084de409a796 (diff)
downloadnq-b0e9190cda2d95ac57f05edd53bbfce8342cb7e1.tar.gz
nq-b0e9190cda2d95ac57f05edd53bbfce8342cb7e1.tar.xz
nq-b0e9190cda2d95ac57f05edd53bbfce8342cb7e1.zip
README.md: explain why flock is used
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index 79efb08..1c6f2b1 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,9 @@ strictly.
 Enforcing job order works like this:
 - every job has a flock(2)ed output file ala `,TIMESTAMP.PID`
 - every job starts only after all earlier flock(2)ed files are unlocked
-- the lock is released by the kernel after the job terminates
+- Why flock(2)? Because it locks the file handle, which is shared
+  across exec(2) with the child process (the actual job), and it will
+  unlock when the file is closed (usually when the job terminates).
 
 You enqueue (get it?) new jobs using `nq CMDLINE...`.  The job id is
 output (unless suppressed using `-q`) and `nq` detaches immediately,