I created processes. One of them prints "1" 30 times
. Another prints "2" 30 times
.I want these processes to print their numbers in turn.
Like this:
1
2
1
2
...
But every time I run the program, the numbers are displayed differently:
1,2,2,1; 1,2,1,2,2,1,1,2.
Can someone tell me,please,how to solve this problem?