Background copy hangs using F2 or send to background
Moderators: Hacker, petermad, Stefan2, white
Background copy hangs using F2 or send to background
I've noticed that during large or long copy operations, the process will hang. All I have to do to resume is focus on the background progress dialog.
Tonight, copying several 10Gb files, it's happening after each file. Used F2 this time.
Tonight, copying several 10Gb files, it's happening after each file. Used F2 this time.
- ghisler(Author)
- Site Admin
- Posts: 50549
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This can be caused by the Windows disk cache in some cases - the file is written to the cache, and only flushed to disk when the file is closed. This can hang CloseFile for a considerable amount of time. Just be patient.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50549
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
In the foreground, the copy thread and user interface thread are different. In the background, the background transfer window belongs to the copy thread so they are separate from the main TC window.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50549
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Because in the background when the copy thread hangs, it's the same as the user interface thread of the dialog. In the foreground, the copy thread is a different thread than the user interface thread. I would have to use two threads for background transfer and background user interface to prevent that, but it could cause other problems...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Well, I think there's something else going on. I see disk I/O in real time and can see the cache at work as free memory rises towards the end of the copy. Long after physical I/O has ceased, if I focus on the progress dialog, the next copy will begin. It's almost like the UI is hung. Somewhat odd that focus alone resumes the copy.
I've noticed this for a while but just dealt with it and didn't pursue it further. Back then it would happen even when copying many not so large files. Need to test on another system. Could be some quirky problem just on the desktop.
I've noticed this for a while but just dealt with it and didn't pursue it further. Back then it would happen even when copying many not so large files. Need to test on another system. Could be some quirky problem just on the desktop.
- ghisler(Author)
- Site Admin
- Posts: 50549
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, as I said, the CloseFile function can hang for a considerable amount of time in some situations. There is nothing I can do to prevent that, sorry.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
If CloseFile is hanging, I'm still confused why clicking on the progress dialog will instantly un-hang it. If it does hang for a considerable amount of time occasionally, it seems unlikely that I could instantly un-hang it by focusing on the progress dialog.
It's almost like the progress dialog has not recognized that the copy is complete. Perhaps CloseFile does hang for a short bit of time as the cache is flushed in my case, but the UI seems to quit polling for status while in the background. But then you're saying while in the background the UI and copy are in the same thread. So I can see why you might think CopyFile is hung. To me it seems like the UI is hung because I can un-hang it every time by focusing.
It's almost like the progress dialog has not recognized that the copy is complete. Perhaps CloseFile does hang for a short bit of time as the cache is flushed in my case, but the UI seems to quit polling for status while in the background. But then you're saying while in the background the UI and copy are in the same thread. So I can see why you might think CopyFile is hung. To me it seems like the UI is hung because I can un-hang it every time by focusing.
- ghisler(Author)
- Site Admin
- Posts: 50549
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I cannot reproduce that.If CloseFile is hanging, I'm still confused why clicking on the progress dialog will instantly un-hang it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com