On Dec 18, 2010, at 6:24 PM, Charles Oliver Nutter wrote:

> If you need to parallelize, processes are only one tool, and perhaps
> the most blunt tool. In-process concurrency opens up many options that
> are difficult or impossible with processes.

> This is how you do parallel processing for your work. It's not the
> only way, and being able to pass whole in-memory object graphs over to
> another thread is distinctly more elegant than having to marshal it
> through a memory-mapped file or IO pipe.

> Perhaps you can't fork, but you can use real
> concurrent threads, which are almost certainly easier (provided you
> don't share mutable data, as with processes).

Before I say this, I need to state that I love and use JRuby.  The reasons are that it completely rocks at some things, like Java integration.

Of course, like anything, there are tradeoffs and JRuby sucks at other things, like manipulating processes in a POSIX environment.  I don't use it in these scenarios and you know that I've filed bugs for the specific problems I've run into (some of those have been partially addressed).

All that said, I think you were pretty harsh on using processes for concurrency in general.  That "blunt tool" is pretty much the core of the Unix operating system, which I think a lot of us are found of.  I often find it easier to work with processes that threads myself, though obviously some programmers think the other way.

On the contrary, threading is so challenging to get right that "threading is hard" is a popular saying:

  http://www.google.com/search?q=%22threading+is+hard%22

It bugs me that people are so harsh on fork().  I avoided it like the plague when I was a younger programmer because everyone had me convinced it was evil.  I'm now far more dangerous because I took the time to learn it and understand it.  I strongly recommend all programmers do the same.  (By the way, ara.t.howard taught me most of what I know about processes, directly and indirectly!)

So JRuby is good at threads and not so good at processes, in my opinion. rocesses are also not at all evil.  Judge not lest ye be judged.  ;)

James Edward Gray II