Starting with this post I’m launching a series about multithreading where I’ll share my experience and my ideas about the future. I will not provide basic educational material. Instead, I’ll describe my work on primitives and patterns. If you are looking for a place to start learning, consider the following links:
http://en.wikipedia.org/wiki/Multithreading
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndllpro/html/msdn_threads.asp
What makes threads interesting is not spawning and terminating them but rather the constraints implied by their concurrent execution. Everything boils down to safe resource sharing (without losing too much performance). That is known as thread safety. Interestingly enough, thread safety implies a very small number of synchronization primitives and design patterns, which makes it a very attractive target for improvements. And that’s what I did – I designed and implemented a set of primitives and patterns that make multithreading programming rather commodity than craft.
I’ll try to keep the posts short as opposed to writing long articles. I’ll explain how I got motivated to do that and, of course, I’ll discuss details of the implementation.