> This makes the Log() function as quick as possible so the threads are > disturbed as little as possible. Unfortunately, the file doesn't get > written out if the program crashes. Does any one have a suggestion for > getting the file written if there the program crashes without causing > more time to be spent in the Log() function?
I would suggest you use a MMF instead. This is the fastest way to write to a file, plus you'll have all the data the program writes to the file before it dies. BTW, if the program aborts with an exception, it's useful to check out SetUnhandledExceptionFilter( ) as well. Your filter can log the complete exception information as well, which might be very useful for debugging. > I'm guessing that the threads are running at very different rates when > the CPU gets bogged down. We have one higher priority thread (that > needs to guarantee that we don't lose data), and we think that on slow > systems it starts hogging. > That's why I'd like to have a way to artificially block a thread > momentarily to change the order of execution. > > But that is just a guess. We're not even sure it is caused by high > data rates. Upping the data rate caused the crash on one computer in > the field, but upping the data rate on any of the computers in the > office didn't cause a problem. Can the high priority thread occassionally lower its priority to give the other threads a chance to execute, maybe? ------------- Ehsan Akhgari Farda Technology (http://www.farda-tech.com/) List Owner: [EMAIL PROTECTED] [ Email: [EMAIL PROTECTED] ] [ WWW: http://www.beginthread.com/Ehsan ] Do ever what you will - but first be such as can will. -Thus Spoke Zarathustra, F. W. Nietzsche
