Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
peterh is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: report generator
Next Topic: Pie Chart in U++?
Goto Forum:
  


Current Time: Thu May 16 20:48:18 CEST 2024

Total time taken to generate the page: 0.02653 seconds