Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - News > Syndicated Linux News
User Name
Syndicated Linux News This forum is for the discussion of Syndicated Linux News stories.


  Search this Thread
Old 06-04-2013, 01:50 AM   #1
LXer NewsBot
Registered: Dec 2005
Posts: 99,838

Rep: Reputation: 102Reputation: 102
LXer: Linux shell: Introduction to Flock

Published at LXer:

Recently a colleague of mine should run multiple parallel jobs on a server (around 20 in our specific case), every job does “an elaboration” and this can take a time longer or shorter in respect of the others, once a job finishes its task it must read from a text file the first line that indicate the ID of a new job, it removes that ID from the top of the text file and starts to elaborate it. Problem: On a long run (a run of 50K+ jobs) it happens “frequently” that 2 jobs finish at the same time and so both take the same ID causing problems to the whole process. The solution was to use the bash function flock.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Mastering The Linux Shell - Introduction LXer Syndicated Linux News 0 03-18-2013 11:50 PM
LXer: Bash Shell Variables an Introduction LXer Syndicated Linux News 0 11-10-2010 06:00 PM
LXer: Using flock to protect critical sections in shell scripts LXer Syndicated Linux News 0 01-12-2009 02:10 AM
LXer: Women flock to Linux talkfest LXer Syndicated Linux News 1 12-21-2006 11:16 AM
LXer: Flock beta rocks LXer Syndicated Linux News 0 06-17-2006 01:33 PM > Forums > Linux Forums > Linux - News > Syndicated Linux News

All times are GMT -5. The time now is 08:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration