Find the answer to your Linux question:
Results 1 to 3 of 3
I have a server and a client program which communicate using Unix (AF_UNIX) domain sockets. When I SIGSTOP the client using kill -SIGSTOP pid_of_client The client is stopped but the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    30

    why server goes into interruptible sleep when I SIGSTOP the client??


    I have a server and a client program which communicate using Unix (AF_UNIX) domain sockets.
    When I SIGSTOP the client using kill -SIGSTOP pid_of_client
    The client is stopped but the server goes into interruptible sleep ..(i.e the server pauses where it is currently)
    And when I SIGCONT the client ,the server also starts from the point where i had SIGSTOP the client..
    Can anyone tell me what happens to the server when I SIGSTOP a client.. Does SIGSTOP signal uses sigpause(server_pid) function to pause the client??
    Plz help me out

  2. #2
    Just Joined!
    Join Date
    Nov 2010
    Posts
    9
    I would expect the server is waiting using poll() or select() for a client to pass it a new request to process. What would you expect the server to be doing if the only client is currently inactive?

    For the second question, no, clients do not normally signal the server (such a design would hve many downsides - it couldn't be made a remote server across a network, it would require that the server and client either both have the same owner or that the client run as root, it would mean the server could not serve multiple clients (if any of them suspended the server, the other clients would be locked out as well, I'm sure there are a lot of other good reasons not to use them for such a purpose.

  3. #3
    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,601
    I concur with jimseg's analysis of this. I expect that if you terminated the client, then the server would (or should, depending upon how it was programmed) go back to listening for new requests from new clients.
    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
  •