Windows I/O threads vs. managed I/O threads

A question recently came up on an internal discussion forum, which I’ll paraphrase:  The Windows QueueUserWorkItem API has an option to queue to an I/O thread.  Why doesn’t the managed ThreadPool.QueueUserWorkItem support this option? First, some background: In the Windows thread pool (the old one, not the new Vista thread pool), an “I/O thread” is…

2

When does it make sense to use Win32 Fibers?

This has been discussed fairly frequently on the Web.    Chris Brumme discusses this here: http://blogs.msdn.com/cbrumme/archive/2003/04/15/51351.aspx Raymond Chen discusses this here:  http://blogs.msdn.com/oldnewthing/archive/2004/12/31/344799.aspx.  There’s some discussion about the pros and cons of Fibers in SQL Server here: http://msdn.microsoft.com/en-us/library/aa175385.aspx   Those are just the first three relevant links from a simple search.  But still, the subject comes…

4

Fun programming problem: a simple lock-free algorithm

Can the program below ever print “oops?”    #include <stdio.h> #include <process.h>   struct Globals {     volatile int start;     int a;     int b;     volatile int end; };   Globals globals;   void WriterThread(void*) {     int i = 0;     while (true) {         globals.start = i;         globals.a = i;…

3