Thread stuff
Steve Jardine
sjardine
Mon May 1 22:21:02 PDT 2006
Gentleman,
I appreciate your responses. It has been a great help indeed. I am well underway to recoding
using select. I will let you know what comes of it.
Thanks again..
Steve
On Sat, 29 Apr 2006 11:12:28 +0200
"Roger Oberholtzer" <roger at opq.se> wrote:
> On Fri, 2006-04-28 at 12:36 -0400, A. Khattri wrote:
> > On Fri, 28 Apr 2006, Steve Jardine wrote:
> >
> > > Yes, do nothing. I have a loop waiting for a socket connection from a remote
> > > server. At that time the thread buffers the information received. Once completed,
> > > the buffer is placed in a message queue and the thread goes back to polling for
> > > another connection.
> > >
> > > There has *got* to be a better way.
> >
> > This is what select() is for.
>
> Another advantage of select over blocking reads is that one thread can
> wait for many sockets at the same time. If that fits the general program
> design is a different issue.
>
> Another way which we use is to set the socket(s) so it sends you a
> signal (SIGIO) when data becomes available. Then, you do not even need
> the select(). When you get a signal, then do a poll() to see who has
> something. Very easy to set up.
>
> >
> > _______________________________________________
> > Linux-users mailing list ( Linux-users at linux-sxs.org )
> > Unsub/Password/Etc: http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
> >
> > Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
>
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc: http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
>
> Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
>
--
Steve Jardine
More information about the Linux-users
mailing list