Description: Written in the linux environment a console application, the program has a shared integer variable shared_var, the initial value of 0 create
A thread and make it run concurrently with the main thread immediately. The newly created thread and main thread are constantly circulating, and the output shared_var
Value. The main thread in a loop constantly on shared_var are incremented, that is plus 1 for each cycle shared_var and the new line created
Process is constantly on the shared_var decremented, that is, each cycle shared_var is decreased by 1. Observe the results of running the program, and you
To explain the phenomenon seen.
To Search:
File list (Check if you may need any files):
Pthread of linux.doc