> 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.
I wasn't sure that memory-mapped files actually write their info to disk as they go along so that there'd be nothing lost if there is a crash. Also, I figured that it can't be faster than just holding onto the strings in memory, but maybe it's not significantly slower. I'll change my class and experiment, then. > Can the high priority thread occasionally lower its priority > to give the > other threads a chance to execute, maybe? What is supposed to happen is that the high priority thread should get all the resources it needs because our prime directive is collecting data. If we lose data (because our buffer overflowed before the thread processed it), we might as well go home, since we can't do anything else without data. There is a case that the computer we're running on is just too slow so the buffer (that our driver fills and our high priority thread empties) overflows. We mark the data as incomplete and continue as best we can (While recommending that the user get a faster computer). That works ok, but it is a last resort. There is another case where one of the other worker threads needs to supply a file handle to the high priority thread, but is starved and isn't ready in time. At that time we block the high priority thread until the file is ready because there is no place to put the data. We hope that the buffer won't fill up before the thread comes back, but if it does, it is just like the case above.
