Home » Community » Newbie corner » Program didn't exit in Task Manager after click [X]
Re: Program didn't exit in Task Manager after click [X] [message #55402 is a reply to message #55401] |
Sat, 07 November 2020 12:01 |
|
peterh
Messages: 108 Registered: November 2018 Location: Germany
|
Experienced Member |
|
|
So far I understand it, Windows will not terminate a thread forcefully, but will inject code to the thread, so the thread will terminate itself cleanly, when it runs this code.
This doesnt work, if the thread is IO waiting, because the thread doesnt run. In this case, if there is no IO timeout, the thread cannot self terminate.
So first the IO must be unblocked and ExitProcess does this for all IO in the process and threads. Also DLLS are detached cleanly from the threads.
I think, there is nothing wrong with this. Yes, it is system specific, but multithreading is always somewhat specific to the OS.
For console processes ExitProcess() is called automatically by Windows when Ctrl C is pressed, but not for GUI processes.
This is not a call from the debug API but from normal process API.
A cleaner way would be to set a termination flag which is polled by the threads, and I already tried this with no success.
The threads are blocked in some TCP Network call which obviously has no timeout. Maybe this can be improved, but I dont know.
I dont want to dig so deep into it.
[Updated on: Sat, 07 November 2020 13:17] Report message to a moderator
|
|
|
|
|
Program didn't exit in Task Manager after click [X]
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: mirek on Mon, 26 October 2020 08:47
|
|
|
Re: Program didn't exit in Task Manager after click [X]
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: peterh on Thu, 05 November 2020 13:51
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: peterh on Sat, 07 November 2020 07:53
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: Klugier on Sat, 07 November 2020 11:37
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: peterh on Sat, 07 November 2020 12:01
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: peterh on Sat, 07 November 2020 14:03
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: peterh on Sat, 07 November 2020 20:25
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: Oblivion on Sun, 08 November 2020 13:03
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: peterh on Sun, 08 November 2020 13:39
|
|
|
Re: Program didn't exit in Task Manager after click [X]
By: Oblivion on Sun, 08 November 2020 14:32
|
Goto Forum:
Current Time: Thu May 16 20:48:18 CEST 2024
Total time taken to generate the page: 0.02653 seconds
|