Apologies for the confusion.
1. FCFS = first come first serve
2. Re-framing the example
Critical section = CS
lets say the CS is writing time-stamp (of when crit.pl is called) to file.
Example:
Call1 to crit.pl - running CS
Call2 to crit.pl - waiting for lock on CS
Call3 to crit.pl - waiting for lock on CS
Time wise events
T1: Call1 locks CS, Call2 waits for the lock on CS
T2: Call1 still has lock on CS, Call2 waits + new Call3 arrives and also waits
T3: Call1 completes, Call2 acquires lock on CS, Call3 waits
T4: Call2 completes, Call3 acquires lock on CS
The CS time stamps should be ascending order
Hope this makes it clearer.
Please let know if this can be achieved.
Thank you |