Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  web server

lyn at healthquiz.com
Posted: Sun Jun 20, 1999 8:41 pm Reply with quote
Guest
hi,

Looking through the inets code, It seems to me that the web server is
single threaded. The only spawns I saw were for the listen socket.
I'm wrong, right?

If not, what was the reason for this design decision?

-Lyn



Post generated using Mail2Forum (http://m2f.sourceforge.net)
klacke at bluetail.com
Posted: Mon Jun 21, 1999 9:30 pm Reply with quote
Guest
>
> hi,
>
> Looking through the inets code, It seems to me that the web server is
> single threaded. The only spawns I saw were for the listen socket.
> I'm wrong, right?

It's multithreaded allright, Looking at the code in
httpd_listener.erl I see the following sequence of
events.

- First a connection/4 is spawned in init/1

- A soon as as this process has accepted a socket, it
cast's a {create ... message to the server, which immediately
spawns a new connction/4 process.

Thus unless the number of active processes/socket go
over some config number there will always be one and exactly
one erlang process ready to accept the next socket.

The exception being the short interval between one
call to accept and the next, but there the kernel will
buffer the incoming connection request.

/klacke


Post generated using Mail2Forum (http://m2f.sourceforge.net)

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum