Wednesday, May 09, 2007

Threads - ugh!

[via Joe Gregorio] Guido takes aim at a well deserving target - the industry's current fixation with the notion that threads are the right way to handle parallelism:
    "Just because Java was once aimed at a set-top box OS that didn't support multiple address spaces, and just because process creation in Windows used to be slow as a dog, doesn't mean that multiple processes (with judicious use of IPC) aren't a much better approach to writing apps for multi-CPU boxes than threads.

    Just Say No to the combined evils of locking, deadlocks, lock granularity, livelocks, nondeterminism and race conditions."

Amen to that.

This threading thing erupts regularly in the Python world because of the Global Interpreter Lock.

To paraphrase Jamie Zawinski on regular expressions: Some people, when confronted with a problem, think “I know, I’ll use threads.” Now they have two problems.

Threading is the right answer in s/w dev in the same way that manual memory management is the right answer in s/w dev. In *extreme* nich areas you are gonna need it but if you use it day-to-day for everything you are in a world of pain - needlessly.

This issue is, I think, the biggest issue facing s/w dev in the early 21st century. The h/w folks are steaming ahead with bazillion CPU cores in the offing while us s/w folk are largely rabbits in the headlights.

Tuesday, May 08, 2007

A little knowledge is a dangerous thing