On Sat, 23 Apr 2011 19:41:28 -0400
Ken Wesson <kwess...@gmail.com> wrote:
> > Well, Java servers probably are yes, but traditional Unix servers
> > would normally fork a new process for each incoming connection.
> 
> Poor man's threads. Although the insulation of each one against
> crashes in the others might be useful when you're coding in a language
> with memory management tools as primitive as C's. ;)

Or your tools for handling concurrency are as poor as C's (which is
unfortunately most popular languages), or you live in a universe where
cosmic rays can flip bits and other sources of hardware hiccups exist.

> > starting a pool of processes to avoid the startup time of a new process
> > when a new client connects.
> 
> With small lightweight C processes and some suitable system for IPC,
> this can work. With JVMs, not so much, unless you have RAM coming out
> of your ears. JVM processes tend to be fairly large; it wouldn't take
> many 64MB java.exe jobs to start the pagefile thrashing. Even with an
> 8GB server, you start paging at 128 simultaneous connections in that
> case, and you certainly can't handle thousands.

I would have expected large chunks of the JVM processes to be shared
between parent and child - especially before the first accept
returns. In particular, the VM implementation and the compiled JVM
bytecodes should all be shared. Data structures & JIT'ed code - well,
it will depend on a variety of implementation details, but they all
start on shared pages with a COW bit set.

Of course, if you're using threads in the parent for other things,
then forking to create new processes creates a bunch of interesting
things to deal with.

     <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to