Multithreading Programming Problem

Hi guys ;

I'm trying to solve as much as possible multithreading problems in regard of getting a job ; I've

seen this problem of multithreading:

https://www.youtube.com/watch?v=JT90KoarNjw&feature=youtu.be



In the video explains the problem with complete solution but I didn't really understand how printf will print those possibilities:

(in the video mentioned that printf maybe not atomic)



2 1

1 1

2 2

1 2



could anyone please help me to illustrate in simple words the explanation that's found on the video? I already seen

the video but Im confused on his explanation and didn't understand how do I solve correctly with understandings that problem that's

found on the video (two threads racing over each other on print function).





thanks.
Topic archived. No new replies allowed.