problem with select() in conjunction with Unix Domain sockets (platform: HP-UX)
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > problem with select() in conjunction with Unix Domain sockets (platform: HP-UX)




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    problem with select() in conjunction with Unix Domain sockets (platform: HP-UX)  
Somdutt Patnaik


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-11-04 10:49 PM

Hi,

I am writing a client-server module using Unix Domain sockets. The
server side uses select() to poll for incoming client-connections
which are local processes. The client side uses select() to poll for
its own connection FD. Things work smoothly with as few as 10 clients,
but it goes wildly unstable when there are in-excess of 50 concurrent
clients connecting to the server. The client and server have as many
as 7 states of alternate read and write interactions. My concerns are
as follows:

1. Select frequently returns an errno which means:"Interrupted system
call" error.
2. Is select() thread safe?
3. Are there any synchronizations issues for Unix Domain sockets?
4. There is often a deadlock in one of the interaction states which
causes either the client or server to time-out due to nothing returned
by select().

Finally are there any suggestions for the timeout parameters of the
client and server select()s?

Please let me know of any information or URLs that would resolve my
concerns.
Thanks in anticipation,
Somdutt.





[ Post a follow-up to this message ]



    Re: problem with select() in conjunction with Unix Domain sockets (platform: HP-UX)  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-30-04 01:09 AM


"Somdutt Patnaik" <sdpatzz@rediffmail.com> wrote in message
news:411c6c10.0409110701.6dc39cd7@posting.google.com...

> 1. Select frequently returns an errno which means:"Interrupted system
> call" error.

Yes, if you interrupt it with a signal, it will do that.

> 2. Is select() thread safe?

Yes, provided the structures you pass to and from 'select' are properly
protected.

> 3. Are there any synchronizations issues for Unix Domain sockets?

No, unless you try to change their modes.

> 4. There is often a deadlock in one of the interaction states which
> causes either the client or server to time-out due to nothing returned
> by select().

Then your state machine is broken.

> Finally are there any suggestions for the timeout parameters of the
> client and server select()s?

Sure, timeout as soon as you have something else to do. If you aren't
going to do anything else until you receive a packet, don't time out. If you
are going to do something in 500mS if you don't receive a packet, then time
out in 500mS.

DS







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:11 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register