Heh... I think the multi-threading conversation just clarified a bit in my head (given that I have little knowledge of parallel processing and threading). It appears that one camp says that threading has a lot of overhead, the other saying it has almost none.
I think you're both right, just using different metrics. The first camp is looking at all the work being done by the OS, scheduler, and whatnot on all cores in all threads as the overhead, the other camp is looking at the overhead in just the main thread. That simple setting of a wait handle kicks off a certain amount of processing by the rest of the system to get the other thread to run, even if that call itself returns to the main thread very quickly.
I am, of course, likely to be completely wrong in my interpretation of things.
I want to clarify what I was getting at with my posts.
I'm not against using threading in the future. At some point down the road we could see some significant performance improvements by implementing it. Normally if you implement threading when you first start writing your code, it's not very difficult at all. However, when you want to take a program that's already been designed and written, it can be infinitely more difficult. I'm simplifying it for explanation, but you esssentially must go back and find every single piece of data which two threads could possibly try to access at the same time. You're almost always going to have to rethink a lot of the ways you did things before as well. Toady has basically said he doesn't have a huge amount of threading experience, which is bad when combined with the rather large amount of code he's written over roughly 5 years.
What I believe is that threading is not addressing the real issue, which in my opinion is poorly written algorithms which do not scale well at all. This is the reason the game runs fine when you first embark, but later on slows down for various reasons (in some cases to an absolute crawl). The current code needs to be improved significantly before any thought of threading is considered.
In terms of the overhead of using threads, there is very little. I can't speak for Windows, but Linux implements threads almost exactly like normal processes, which are already extremely efficient and quick. The difficulty is in determining how to divide the actual work among the threads, and how to have them communicate amongst themselves and with the parent process. None of us, except Toady, has any real idea of how that should be done because we don't have the source code, and therefore can only speculate about how the game actually works.