Why using mutex ?. The Critical-Section Problem Example: P1: repeat counter= counter +1; until false register1=counter; register1=register1+1; counter=register1;.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
The Critical-Section Problem
counter= counter +1;
counter =counter -1;
If one process is in its critical section, then no other processes can be executing in their critical section
Process: a program in execution.
Thread: (lightweight process)
a basic unit of CPU utilization, and consists of a program counter
a register set
its code section,
OS resources (files, etc)
Threads need less context switch time
You may have to pass parameters to the function
when creating threads.
Try: man thr_create to get on line help on this.