[plug] POP goes the threading

Brad Campbell brad at seme.com.au
Fri May 19 17:03:44 WST 2000


Christian wrote:
> 
> On Thu, May 18, 2000 at 06:44:07PM +0800, Leon Brooks wrote:
> > Christian wrote:
> > > A guy I know wrote
> > > a full POP3 server that did all it's IO from a single process using
> > > select() -- no forking at all.  Apparently it was hell fast compared
> > > with normal forking POP3 servers.
> >
> > Maybe on Solaris or NT, unlikely on Linux - unless he also left most of
> > the brains out of his POP server. (-:
> 
> It was entirely written and implemented on Linux actually.  He also
> wrote a version of the code which did the normal fork()'ing and compared
> the two for speed with the select()-based version being *significantly*
> faster.  As has already been stated, POP3 servers in particular
> demonstrate the speed of this approach since each client transaction is
> generally very short.

The idea of a select() based server is such that you distribute the data
over small slices, therefore even if you were sending a large mailbox, your
not going to block the system as you only send as much as the system will
let you in one chunk, then you wait on select() to sell you to send some more.
I have distributed some very large transactions over a number of different
connections using a select() based server, you just have to know how to thread
the code right. Experience in writing very complex systems for small microcontrollers
that don't have a multitasking core helps a lot here :p)


-- 
Brad....
"The ultimate result is that some innovations that would
truly benefit consumers never occur for the sole reason
that they do not conincide with Microsoft's self-interest"
- Judge Thomas Penfield Jackson
         /"\
         \ /     ASCII RIBBON CAMPAIGN
          X      AGAINST HTML MAIL
         / \



More information about the plug mailing list