EmbLogic's Blog

Project 4: Client Server Program Using Threads, Mutex,Semaphore,Msg Queue

Implemented
#The client server program using thread, mutex,semaphore and msg queue. In the program created thread for each request from the client and at client side created 1 thread for sendg and receiving different requests.. Program ran for 381 clients and then hangs..
Issues Faced::
1)When running simultaneous clients>5 in the background the  output of some client reaching some other client.Not able to successfully run more than 5 threads on my PC in parallel…. Resolved by sleep(1)..

Faced problem 1) because was using pipes for processing clients and the was using 1 mutex for each processing client and the mutex were locked and unlocked in the child and parent process respectively. This was creating a problem as the client was working on a copy of mutex… Solved by locking the mutex before fork()
2)Couldnt implement the above program using fifo as different clients take each others data so used queues and specified type for each client..found FIFO unsuccessful to implement client server using thread

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>