04-05-2006 04:34 PM
04-06-2006 03:58 PM
04-11-2006 05:27 PM
04-11-2006 06:32 PM
Hi Tom.
You can avoid the problems you are seeing by handling all of your disk writes in a single, dedicated thread.
I would either set up multiple thread-safe queues (one per "writer" thread, using CmtNewTSQ() etc. from the Utility library), or use PostDeferredCallToThread() in each of the "writer" threads. Either method will free your threads from time-consuming disk I/O operations.
If you must perform disk access from multiple threads, use a thread lock or similar device to serialise write operations.
Regards,
Colin.
04-13-2006 12:21 PM
From the input I have received, it appears we can not do multiple writes to disk in a threaded environment in the threads themselves. It is not just writing to disk, it is also reading, accessing and manipulating several files per thread. It appears the only option to this it to create a critical section per write/read/create instance. It really is not that hard, just takes away some of the benefit of running threads in the first place. Any other suggestion, fire away.
Thanks again,
TOM B