From: khaines@... Date: 2007-01-29T03:54:25+09:00 Subject: Re: Benefits of Multi-Threading? On Mon, 29 Jan 2007, Justin Collins wrote: > There are two main reasons for using multi-threaded applications, even on a > single processor: > > The first is performance. It's faster to switch between threads than it is > between processes, and it's (typically) even faster to switch between > user-level threads like Ruby has. Also, any asynchrony in your program (like That's a bit of a red herring, though. With Ruby's green threads, every active (i.e. not sleeping) thread that is added to a single process reduces the overall throughput of all of the threads, collectively, by a noticable amount. While two separate processes on a single processor may have less throughput than two threads in a single ruby process, those two threads will have less throughput than a single thread. So, a single thread solution will typically be more performant than multi-thread solution under Ruby's current threading model. Kirk Haines