From: MenTaLguY Date: 2007-05-10T04:35:09+09:00 Subject: Re: basic threading question: can ruby use real threads? On Thu, 10 May 2007 04:03:57 +0900, "Kyle Schmitt" wrote: > If you fork, is there even a way to create objects that are shared > between the two forks? Or do you have to rely on rpc/ipc stuff > instead? Totally RPC. You could use DRb to do this in a Rubyesque fashion. It's worth noting that no matter _what_ threading approach you use, it's absolutely best to minimize the number of objects shared between threads. > If someone were to... write a c extension who's objects were threaded, > via pthreads, would it be a nightmare? Yes, somewhere between nightmare and flesh-rending terror. At least if you're planning on manipulating Ruby objects from each thread. You might want to consider using JRuby instead. It's compatible enough with MRI that it runs Rails, and it uses "real" threads for multi-CPU goodness. -mental