LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Slightly Off Topic : Concurrent Access to a Text File in a bash script - can I enforce thread safety

[ILUG] Slightly Off Topic : Concurrent Access to a Text File in a bash script - can I enforce thread safety

Pádraig Brady P at draigBrady.com
Fri Jul 13 16:40:35 IST 2007


Oisin Kim wrote:
> OK,
> 
> now that Pádraig has told me what I am looking for :)
> 
> I think the answer can be found at:
> 
> Basically, its not safe, as in my case, we will always be using NFS mounts.

So multiple systems will be writing to a central file over NFS.
You never said that :)
http://nfs.sourceforge.net/#faq_a9

> Thanks for all your help, I'll now benchmark lock files for this task,
> which should be fine :)
> Expect an update on the inode sorting next week.

Note to eliminate the possible NFS bottleneck from the equation
when comparing your parallel process version,
to my single process version, just compare the following
on a single machine:

time find . -maxdepth 1 -type f -printf "%i\t%f\n" |
sort -k1,1n |
cut -f2 |
tr '\n' '\0' |
xargs -r0 cksum >> log.file

for i in *.* do
   cksum $i >> log.file &
done
time wait 2>/dev/null

Pádraig.



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell