comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Suggestions on the use of lockfiles?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Suggestions on the use of lockfiles? [message #34009 is a reply to message #33919] Mon, 10 February 2003 20:01 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Jonathan Greenberg <greenberg@ucdavis.edu> writes:
> Robert:
>
> Thanks! That sounds fine, and is almost what I had come up with
> (incidentally, I finally found out the term for this is a "race condition",
> since I'm not a programmer it took some searching so I could find an
> official term for what was happening) -- here's the only possible issue that
> I was concerned about:
>
> If two computers openw,/APPEND and printf the same file, let's say their ID
> (computer #1 = 100 and #2 = 200), do we only have 2 possibilities in IDL:
... examples of two processes overwriting each other...

What you need to do is make an atomic operation. One way to do that
is write the data to a temporary file, then use rename or "mv" to
rename the temp file to the lockfile name. Since "mv" should be
atomic, there will be no race condition, and the file will be moved
complete. Then proceed from there.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: SQL access without Dataminer (perl off topic)
Next Topic: Interesting WHERE function gotcha

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 04:46:38 PDT 2025

Total time taken to generate the page: 2.00198 seconds