Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

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.



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com