From: Tony Arcieri Date: 2011-10-29T03:40:43+09:00 Subject: Re: Ruby and threading --0015175cbad4d0e8c204b060395b Content-Type: text/plain; charset=ISO-8859-1 On Thu, Oct 27, 2011 at 9:28 PM, Alexey Petrushin wrote: > I don't understand this. Ruby has no support for parallel execution > (except jRuby and similar platforms), so no matter what technics do You > apply - the program always will be on the single processor core. > So use JRuby or Rubinius if you want real multicore concurrency. Problem solved. Threads are still useful even if you have a GIL. Rails can use threads to service more than one request at a time per Ruby interpreter. Without threads each connection to a web site requires a dedicated Ruby VM to service it. Seems bad, but people have made it work. > Clojure otherwise - allows You to use all available cores and makes it > simple by applying modern approaches of dealing with concurrency. Clojure has a lot of neat tools, like immutable persistent data structures, agents, and STM. However, none of these are a panacea for concurrency bugs. Clojure provides a very thin interop wrapper around the JVM and existing Java libraries, which you'll find yourself using all the time when you write Clojure programs. Since the Java libraries use mutable state and allow you to get below the abstractions Clojure otherwise provides, you can still wind up with thread safety bugs in your Clojure programs which are identical to the kind you'd find in Ruby programs. -- Tony Arcieri --0015175cbad4d0e8c204b060395b--