These code snippets are used to simulate real life problems with the help of threads, mutex , locks , semaphores and conditional variable.
- Compile using
gcc q1.c -lpthread -o q1 - then run using
./q1
- Compile using
gcc q2.c -lpthread -o q2 - then run using
./q2
Server
- Compile using
g++ server.cpp -lpthread -o server - then run using
./server <number of working threads>eg :./server 7
Client
- Compile using
g++ client.cpp -lpthread -o client - then run using
./client