in reply to Re^3: Critical section FCFS
in thread Critical section FCFS

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

Replies are listed 'Best First'.
Re^5: Critical section FCFS
by BrowserUk (Patriarch) on Jul 14, 2016 at 18:56 UTC

    May I ask, what is the purpose of multi-tasking * the overall processing, if you are going to then seek some complicated mechanism to force them to run serially?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.