We have a task based multithreaded engine set up where a scheduler passes the task to the threads lock-free queue. The engine is in C++ with DirectX for the rendering and we are using boost::thread for creating the threads. When in windowed mode, it randomly slows down for a second or so and then speeds back up. It seems that it's something that Vista seems to be causing, but we can't figure out how to solve it properly.
One thing that we tried that seemed to help with the random slowdowns was making the thread sleep for a millisecond after each task has been processed, but it causes other problems and isn't really a great solution.