Hello guys,
This is the first time I am working with threads and so far it gave me a
good result in the speed of my code, using Ruby 1.8.6 in the native Mac
OS
X distribution. By I read in the book “The Ruby P.ming language”
that
the threads in the standard “C” Ruby 1.8.6 are not real OS threads and
they all share the same main Ruby thread. I have read also that JRuby
implements real OS threads.
My code triggers more than 200 threads each of them with one private
connection to a MySQL database.
Would it be a real advantage to use JRuby in this scenario?
Thanks,
Guillermo
El Martes, 24 de Junio de 2008, [email protected] escribió:
Hello guys,
This is the first time I am working with threads and so far it gave me a
good result in the speed of my code, using Ruby 1.8.6 in the native Mac OS
X distribution. By I read in the book “The Ruby P.ming language” that
the threads in the standard “C” Ruby 1.8.6 are not real OS threads and
they all share the same main Ruby thread. I have read also that JRuby
implements real OS threads.
Read this good document about Ruby threading:
The Futures of Ruby Threading
My code triggers more than 200 threads each of them with one private
connection to a MySQL database.
Would it be a real advantage to use JRuby in this scenario?
Well, Ruby threads are “green” threads, this is: they only exist into
the Ruby
process but not for the OS so all the threads runned into a Ruby process
share the same processor (you get not advantage of a multiprocessor
computer).
JRuby uses the Java virtual machine, and that uses real OS threads, but
that’s
all I know 
On Tue, Jun 24, 2008 at 6:29 PM, Iñaki Baz C. [email protected]
wrote:
Read this good document about Ruby threading:
share the same processor (you get not advantage of a multiprocessor
Same problem. But i solve it as DRb + fork.
El Martes, 24 de Junio de 2008, Zhukov P. escribió:
Same problem. But i solve it as DRb + fork.
Could you please give a tip of your solution using Drb + fork?
core app starts DRb server with self as front object. then, i fork
‘plugins’ that connect to core app and “register” youself in core’s
@plugin list.
Modified signal system provide communication between processes.
if you interested:
Google Code Archive - Long-term storage for Google Code Project Hosting. #core class
Google Code Archive - Long-term storage for Google Code Project Hosting.
#all plugins should be based on it
Google Code Archive - Long-term storage for Google Code Project Hosting.
#modified signal system
[email protected] wrote:
connection to a MySQL database.
Would it be a real advantage to use JRuby in this scenario?
If you would like your app to take advantage of multiple cores without
the complexity of cross-process communication, then JRuby would probably
be a great choice.
El Martes, 24 de Junio de 2008, Zhukov P. escribió:
Google Code Archive - Long-term storage for Google Code Project Hosting.
#modified signal system
Thanks a lot, it seems interesting.