Hi can someone explain why result is 5 and not 10 ? We do change the value of x so how come it's not changed ? Is this because at this exact time the thread might not have been started to run yet ? I don't think that's the answer though but i haven't recieved any answer on this yet. Thank you.
Yes , it seems that only because the thread might not have been started yet.. the result is so.... if we introduce sleep of even 1 ms u will get 10.(i ran it so) i ran it with sleep(0)... it gave me 5.. I wonder what would a thread do for sleep(0)??? sreek
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking