Subj : Re: Hyper Threading / Multi-Threaded Queue / Application Freezes To : comp.programming.threads From : dayton Date : Wed Apr 13 2005 05:57 pm >> have an MFC application which contains a queue which is accessed by >> multiple threads. [...] >> My problem is this program has run great on 100's of machines for well >> over 12months, however recently has been tested on a Hyper-Threaded XP >> SP2 machine - and for some reasons the application locks up >> periodically. By "locks up", I mean the application frame freezes (not >> responding) for up to 10-20secs at a time and then returns to normal >> again. Of course it could just be Windows. We've had uniform trouble enabling hyperthreading in the BIOS in the machines here at work. Our Windows XP and Windows 2000 Server machines crash in 24-48 hours with a Blue Screen of Death, or just occasionally hang. These crashes occur under no load, that is, no applications, just Windows running. MFC critical sections, though, indicate an old fashioned programmer induced deadlock. Critical sections occur entirely in your application space. Look up the edge locking design pattern and apply it with enthusiasm. For that matter, look at the interlocked compare and swap functions. You probably don't even need critical sections. There are some papers you can find on the Web on implementing non-blocking concurrent queues. Make sure your application isn't doing anything fancy like using MFC extension DLLs, and COM. MFC has an infamous deadlock in load/unload library code. .