A little piece of code?
secureDelete *newInstance = new secureDelete;
*newInstance = *this;
if(newInstancePtr)
{
*newInstancePtr = newInstance;
}
sf::Thread shredThread((shredPtr)(gutmann),newInstance);
shredThread.Launch();
return true;
gutmann(secureDelete* newInstance) is the function I am calling. It works fine but the call shredThread.Launch() does not return before the shredding operation has finished.
I tried to use different priorities (a feature that would be nice in sf::Thread), but even with parent-priority 15 and child priority 0 it did not work...
I dont think it is a bug, I think this is because Linux uses kind of globally I/O block preventing the whole process and all of its threads to execute code while in I/O operations.
This is a difference between Linux and Windows.
I am just wondering if there is a possibility to turn this off.
If you want to experience this problem first-hand you could try to write some 100 Megs into a file using a thread to perform the operation (on Linux platform).
Using unbuffered, direct IO (like a shredder HAS to do, thus avoiding the risk that a file might be only once overwritten by buffering) increases the problem.