Threads are Evil!

Myself and others have been talking about the problem that is threads quite a bit lately, and how bad they are as a tool for concurrency. What I didn’t realize is that there is actually a paper on it! I ran across it while reading a FAQ on SQLite’s homepage.

There’s a great line in the paper:

To offer a third analogy, a folk definition of insanity is to do the same thing over and over again and to expect the results to be different. By this definition, we in fact require that programmers of multithreaded systems be insane. Were they sane, they could not understand their programs.

There have been a number of days where I felt like that was so true. In many situations, threading has felt like it added more problems than it solved. Unfortunately, when you have no other tools at your disposal, you have to make due with what you have.

Fortunately, the Actor model seems to be catching on, and folks are starting to take a more serious look at the concurrency issue. Personally, I think we need a new language to really cope with concurrency. But there have been some other tools popping up that might be useful in current languages. There is Kilim for Java and a corresponding Google TechTalk. And there’s Kamaelia for Python. I’m eager to see what’s in store for the future, but worry about maintaining the junk we have now. :-(