Unix Shell - Multiple processes writing to a single file

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > Multiple processes writing to a single file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Multiple processes writing to a single file
James

2006-10-13, 7:45 pm

I need to write to a single file from multiple processes
(e.g. parallel make).
One approach is creating a lock file while the file is being updated,
so that other processes won't be able to write.
Once it's done, the program (or script) removes the lock file and
others can write to the file.

In practice, I have problems dealing with the existence of the lock
file.
and the file gets corrupted. How can I do it?
Is there a useful link, etc?

Thanks.
James

Kenan Kalajdzic

2006-10-13, 7:45 pm

James <hslee911@yahoo.com> wrote:
> I need to write to a single file from multiple processes
> (e.g. parallel make).
> One approach is creating a lock file while the file is being updated,
> so that other processes won't be able to write.
> Once it's done, the program (or script) removes the lock file and
> others can write to the file.
>
> In practice, I have problems dealing with the existence of the lock
> file.
> and the file gets corrupted. How can I do it?
> Is there a useful link, etc?


It's explained here:

http://home.comcast.net/~j.p.h/cus-faq.html#8

--
Kenan Kalajdzic
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com