Hi Guilhem,

> I am using the fthread to implement a server MMO server at SolarGames.
> 
> I know that the fthread is deprecated. I have 2 questions about them:
> 
> - do the pthreads are efficient in term of memory (the server is 
> expected to have more than 5k connections, each one in a thread), and 
> are they more or less efficient than the fthreads?
Pthread are more efficient than Fthread as each Fthread is backed up with
exactly one Pthread. 

Generally speaking, I'm not sure it would a good idea to start a fresh thread
for each HTTP connection established on the server. Using a thread pool
is probably a good idea. 

> - do the fthread are blocked during a read call such as (read-line 
> (socket-input-port socket))? In this case is there a simple method to 
> allow the scheduler to schedules the other fthreads during the wait?
No. You can use non blocking IOs with fthreads but, once again,
blocking/non-block IOs is not a critical problem is you use pthreads.

I repeat my advice, have a look at Hop. Even if at the end of day you
prefer not to use it, I'm pretty certain that you will find answers to
many of your questions about the efficient implementation of a Web
server.

Cheers,

-- 
Manuel

Reply via email to