Linked by Kroc Camen on Sat 27th Dec 2008 20:52 UTC
Thread beginning with comment 341660
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Erm, afaik rails is not multithreaded. Or has that changed meanwhile? However, there is still the GIL in python and I believe in ruby, too. Before one can think of such parallel constructs one has to remove the GIL. Why is there even a GIL in those languages? Java hasn't a GIL, not even in interpreted mode (afaik).
However, there is still the GIL in python and I believe in ruby, too. Before one can think of such parallel constructs one has to remove the GIL.
That is a *very* common misconception. The GIL is a blessing, and not an impediment:
http://docs.python.org/library/multiprocessing.html#module-multipro...
The performance is astounding. And fibers are on the way to cover the cases where pure multiprocessing is not appropriate. In the mean time, multiprocessing and threading can be combined.
Erm, afaik rails is not multithreaded. Or has that changed meanwhile?
Rails has been thread-safe since version 2.2. Inside a single request, the application can choose to use threads, but doesn't have to.
However, there is still the GIL in python and I believe in ruby, too.
The Java and .NET implementations do not have a GIL and are fully concurrent.
Why is there even a GIL in those languages?
Makes implementation easier.
Why is parallelism even needed for a language that is used primarily to serve web scripts? Each and every thread on the web server is running concurrently... is that not enough?
That depends upon how one thinks of Ruby, of course. Is Ruby just "The language that Rails provides"? Arguably, yes. (People might quibble, and correct me for not saying "The language that Rails runs on". But, practically speaking, there isn't much difference.) And yet Ruby is a general purpose language, which happens not to have as complete library support as the other two major dynamic languages. But there is still potential. Anyone who wants to see Ruby succeed as a general purpose language might reasonably be thinking about methods of better solving the concurrency issue.
In contrast, PHP categorically has little need to worry about language-based concurrency features.
Edited 2008-12-28 01:14 UTC







Member since:
2006-02-06
Why is parallelism even needed for a language that is used primarily to serve web scripts? Each and every thread on the web server is running concurrently... is that not enough?