16
System / Sf::Thread
« on: June 04, 2008, 12:31:02 pm »
I am writing a little file shredding program (Linux and Windows).
The file shred class sets up a thread to do the work, while the main thread still should be able to display the main window (updating the status information and so on).
Now I am encountering a problem with threads:
Thread.Launch() does not even return before the shredding thread finished, though I even use Sleep() in the shredding function to force a task switch thus making other Threads possible to work. This is surely not the purpose of threads, is it?
I have often enough implemented threads by CreateThread in Windows to know it should be working (at least in Windows) like I planned...
The shredding functions are all working properly (in Windows I even reversed my own code to check if it works correctly).
The file shred class sets up a thread to do the work, while the main thread still should be able to display the main window (updating the status information and so on).
Now I am encountering a problem with threads:
Thread.Launch() does not even return before the shredding thread finished, though I even use Sleep() in the shredding function to force a task switch thus making other Threads possible to work. This is surely not the purpose of threads, is it?
I have often enough implemented threads by CreateThread in Windows to know it should be working (at least in Windows) like I planned...
The shredding functions are all working properly (in Windows I even reversed my own code to check if it works correctly).