|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Socket Select the server how to achieve integration and multithreading?
1 :
Serversocket.Accept NewSocket = int ();
If (fork () ====== 0)
{
Serversocket.Close ();
....
Select ()
.....
2 :
....
Select ()
If (FD_ISSET (. . . . ))
If (fork () ====== 0)
{
Serversocket.Accept NewSocket = int ();
....
What should be the approach will be better?
You do not select or process used.
Multi-process or not select? |
Socket Select the server how to achieve integration and multithreading?
Rt |
Socket Select the server how to achieve integration and multithreading?
Select and combine the use of threads are relatively good, if the use of thread pool, then all the better. |
Socket Select the server how to achieve integration and multithreading?
No tests were always thought of switching between systems cost hundreds of threads almost unacceptable. |
| |