Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all , first of all excuse me for my horrible english. I am using named pipes on a client server model. The client consists of 2 threads and share ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    1

    C server-client and named pipes


    Hi all , first of all excuse me for my horrible english.

    I am using named pipes on a client server model.
    The client consists of 2 threads and share a memory segment with the server.
    All i am trying to do is make the client communicate with the server through these pipes but i cant find a way to synchronize them.
    When the client ( consists of 2 threads) is done with the shared memory manipulation the server should check if everything went fine.
    When the server is done with his job on the shared memory , he should send 2 same messages to these threads at the same time.
    The threads should read that messages and terminate .
    I don't know how to implement that , should i use 2 different pipes or just 1 is enough ?
    if i use 1 how can i synchronize these threads so they both read the same value?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,578
    Have you thought about using posix message queues? That is a better choice for this sort of thing than named pipes.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •