Skip to content

Commit 4e7895b

Browse files
authored
cleanup
1 parent c623524 commit 4e7895b

File tree

1 file changed

+4
-1
lines changed
  • Producer-consumer problem/Infinite buffer

1 file changed

+4
-1
lines changed

Producer-consumer problem/Infinite buffer/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ The program creates 9 producer and 9 consumer threads using the createThread fun
1616
## Running the program
1717
To compile and run the program, use the following commands:
1818

19-
```gcc -o infinite_buff infinite_buff.c -pthread./infinite_buff.out```
19+
```
20+
gcc -o infinite_buff infinite_buff.c -pthread
21+
./infinite_buff.out
22+
```
2023

2124
## Conclusion
2225
The infinite buffer producer consumer problem is a classic synchronization problem that arises in multi-threaded programming. The solution presented in this program uses semaphores to ensure that the producer and consumer threads access the buffer in a mutually exclusive manner. The program creates multiple threads to simulate a real-world scenario, where multiple producers and consumers are working concurrently.

0 commit comments

Comments
 (0)