* Chris Dolan <[EMAIL PROTECTED]> [2008-11-01 22:25]: > On Nov 1, 2008, at 10:39 AM, Dr.Ruud wrote: >> I think it was Randal Schwartz who said something like: If the >> answer involves threads, then the question was wrong. > > Most likely that quote comes from a year when multi-processor > systems were not ubiquitous.
No, it’s as true as ever. Threads suck. They are a different beast in Perl than in other languages because Perl goes to great lengths not to make variables shared between threads unless explicitly asked to, but of course that makes Perl threads suck for an entirely different set of reasons. The fact of the matter is that hardware-level concurrency in Perl code on an OS without fork() is a non-starter. In other languages, you might have something like STM, or maybe the Erlang model, or some other approach – things which actually make sense and make it safe and sane to write concurrent code (like fork() does on Unix). Threads are always the wrong answer. To quote Brendan Eich[1], My default answer to questions such as the one I got at last May’s Ajax Experience, “When will you add threads to JavaScript?” is: “over your dead body!” [1]: http://weblogs.mozillazine.org/roadmap/archives/2007/02/threads_suck.html Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>