Aug 28, 2014 at 7:58am
When 11 is executed it will read the value of i from main, but you don't know when this will happen so you don't know what the value is going to be.
Aug 30, 2014 at 12:39am
This is what I thought, but since i is assigned before the thread is created i still found the output
thread--- 0
thread--- 0
strange.
Last edited on Aug 30, 2014 at 10:23pm
Aug 30, 2014 at 8:03am
It's not strange. You set i to 0 again in the last loop.
Last edited on Aug 30, 2014 at 8:03am
Aug 31, 2014 at 6:20am
Hi,
That is a nice thread.
I have a question, where is the mutex being locked by each thread?
I only see it getting unlocked by each thread.
Thank you.
BTW, where did you gain that Linux knowledge?
I'm trying to get into Operating Systems world, and into Linux specifically.