Here's the problem:
I need to make a program in C that will create 5 threads using fork . Then, every thread will increase a global variable.
Now, only one thread can increase it at a specific time. So a mutual exclusion system has to be implemented.
Now : how do i go about creating that global counter that will be increased ?
I tried using a global variable and then access it's address through a pointer, but within every fork body, i get a different address
Any help .... please ?
I need to make a program in C that will create 5 threads using fork . Then, every thread will increase a global variable.
Now, only one thread can increase it at a specific time. So a mutual exclusion system has to be implemented.
Now : how do i go about creating that global counter that will be increased ?
I tried using a global variable and then access it's address through a pointer, but within every fork body, i get a different address
Any help .... please ?
