aj7700 has asked for the wisdom of the Perl Monks concerning the following question:
I have a perl program "crit.pl" with crictical section code.
"crit.pl" can be invoked by mutiple threats simultaneously(handling race condition with flock).
Is there a way to achieve a queue in the processing? (i.e. The thread that calls "crit.pl" first gets executed first, 2nd execute 2nd, so on..)
Example: Call1 to crit.pl - running Call2 - waiting for lock Call3 - waiting for lock ..
In this case call2 should execute after call1 completes, followed by call3.
crit.pl flock :LOCK_EX //Critical section flock :LOCK_UN
Thank you
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Critical section FCFS
by neilwatson (Priest) on Jul 13, 2016 at 18:59 UTC | |
by aj7700 (Initiate) on Jul 14, 2016 at 03:13 UTC | |
by RonW (Parson) on Jul 14, 2016 at 21:52 UTC | |
Re: Critical section FCFS
by oiskuu (Hermit) on Jul 14, 2016 at 21:31 UTC | |
Re: Critical section FCFS
by Anonymous Monk on Jul 13, 2016 at 19:44 UTC | |
by Anonymous Monk on Jul 14, 2016 at 02:44 UTC | |
by Anonymous Monk on Jul 14, 2016 at 04:13 UTC | |
by aj7700 (Initiate) on Jul 14, 2016 at 05:19 UTC | |
by Anonymous Monk on Jul 14, 2016 at 18:49 UTC | |
by BrowserUk (Patriarch) on Jul 14, 2016 at 18:56 UTC | |
Re: Critical section FCFS
by naren88 (Initiate) on Jul 15, 2016 at 17:50 UTC |