Pthread VS select
I was curious about the issues and major differences between using Pthread and select to handle multiple clients that will be logged on for an undetermined amount of time.
One way I see is to make detached threads handle every client, each client has a thread devoted to listening to him, and it takes the data, processes it, and returns it on another thread.
the other way is using select, check for input, if so, process and go on.
is there one better or worse than the other? easier or harder? are there any major issues using 2 different threads to communicate with a client on the same socket addr? (is there still an issue if you used multex lock?)
Kris
|