multiple tasks within the same thread
Posted on 2005-04-07
I have made a thread class to be used within a multi-threaded queue based application.
dozens of tasks are inserted in a listview queue, and depending on how many threads are created by the user the tasks are carried out.
its runs nicely except my code is hard to follow and read. There are several different tasks a thread can run so I was thinking about separating each task into a different unit instead of all the code being inside one unit.
Should I create a thread class for each type of task? Or just use one thread class?
I have tried breaking up my code into separate units for each task while still using one thread... but Im having probelms with "Synchronize".
How can I "Synchronize" a thread from a different unit, even if the thread is being used within that units code.
Should I just keep all my thread code within the same unit?
Instead of trying to make it more readable...