Native Threading APIs in Windows Server 2008

Tue, January 29, 2008, 11:35 AM under Windows | Vista | WindowsServer2008
On 3 recent events I spent 20' talking about the new native threading APIs in Windows Vista and Windows Server 2008. Here are resources as promised.

1. Thread Pool – re-architected native ThreadPool that amongst other things allows multiple pools per process.

2. One-Time Initialization – think singletons for the native world with an interesting option of asynchronous initialization.

3. Slim Reader/Writer Lock (SRW) – finally a reader writer lock out of the box for native devs.

4. Condition Variables – addresses scenarios such as the classic producer/consumer pattern in a more efficient way than previous techniques.

5. Thread Ordering Service (TOS) – an interesting service that I cannot find a compelling use case for. If you've got one, let me know!

6. Wait Chain Traversal (WCT) – aids in programmatically debugging deadlocks and hangs.

The links above point to the MSDN documentation where you can click further to read the API descriptions and click further to see code examples. In addition, the MSDN Magazine has 3 articles that describe all of the above (except for the TOS):
- June 2007 – Describes Condition vars, SRW, and One-Time Init. Don't let the title fool you, these are even more applicable with the release of Windows Server 2008.
- July 2007 – Describes usage of the WCT from unsafe C# code to create a utility.
- October 2007 – Describes the New Thread Pool APIs.

Lastly, I have created some slides for the above. Nothing fancy, just very boring bullets with lots of text and API signatures with nothing additional than what you can find in the links above. Their only use is if you need to talk about this topic and cannot be bothered to create your own from scratch, you can use mine as a starting point. See slides 8-22 inclusive in this deck.