in reply to Re: locking over the network
in thread locking over the network
On writing, only one string is written to the file. The next time we are coming to the write operation, the old content is discarded and the new string is written.
However, I see one problem with your solution: There is a race condition between unlinking the original file, and renaming the temp file. If process B tries to access the file during this time, it thinks there is no such file. Unfortunately, having no file *is* a legal situation (and, from the processing logic, equivalent to an empty file), so we can not let the reader wait until the file appears.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: locking over the network
by BrowserUk (Patriarch) on Jan 31, 2011 at 18:24 UTC | |
Re^3: locking over the network (rename)
by tye (Sage) on Jan 31, 2011 at 20:51 UTC | |
by rovf (Priest) on Feb 01, 2011 at 10:11 UTC | |
by Corion (Patriarch) on Feb 01, 2011 at 14:34 UTC | |
by tye (Sage) on Feb 01, 2011 at 18:34 UTC | |
by rovf (Priest) on Feb 01, 2011 at 16:00 UTC | |
by Corion (Patriarch) on Feb 01, 2011 at 16:06 UTC | |
| |
by tye (Sage) on Feb 01, 2011 at 18:56 UTC | |
| |
by SuicideJunkie (Vicar) on Feb 01, 2011 at 14:28 UTC | |
by tye (Sage) on Feb 01, 2011 at 14:39 UTC | |
by rovf (Priest) on Feb 01, 2011 at 15:52 UTC | |
by Anonymous Monk on Feb 02, 2011 at 02:59 UTC | |
by rowdog (Curate) on Feb 02, 2011 at 02:17 UTC |