#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    16
    Rep Power
    0

    Question on concept of concurrency


    Bill is swiping his credit card in the supermarket. His wife is paying a bill online at home.
    Bill sees this on the screen:
    Your old balance is: $2000
    Your debit is: $100
    Your new balance is: $1850

    His wife sees this on the screen:
    Your old balance is: $2000
    Your debit is: $50
    Your new balance is: $1950

    Which one of the following could have occurred?

    (a) race condition
    (b) condition synchronisation
    (c) starvation
    (d) mutual exclusion

    I think this is a race condition. Am I right?
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,992
    Rep Power
    9397
    Why do you think it's a race condition? Explain your reasoning. Why would it not be any of the other three?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    16
    Rep Power
    0
    Originally Posted by requinix
    Why do you think it's a race condition? Explain your reasoning. Why would it not be any of the other three?
    Condition synchronization and mutual exclusion are not problem. So it's either race condition or starvation. In Starvation, my understanding it the processes wait for each other. Race condition is the process get interrupted. Therefore, I think it's race condition. But I'm not quite sure if my understanding is correct.

IMN logo majestic logo threadwatch logo seochat tools logo