#1177: All I/O requests must complete before shutdown on Windows
-------------------------------+--------------------------------------------
Reporter: simonmar | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone: 6.6.2
Component: Runtime System | Version: 6.6
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Multiple | Os: Windows
-------------------------------+--------------------------------------------
In the non-threaded RTS, in order to fix problems with shutdown of DLLs we
made it so that the RTS would wait for any outstanding IO request threads
to exit before the RTS exits (otherwise the threads return later to find
the DLL is missing and crash).
Unfortunately this means if you fire off a long threadDelay and then the
program ends, the RTS won't exit until the threadDelay expires, even if
the original Haskell thread has been killed. In the threaded RTS, we
don't have the threadDelay problem (any more) because of the IO manager
thread, but we do have a similar problem with outstanding I/O requests
(untested).
It's perhaps worse in the threaded RTS, because we don't wait for these
I/O requests to exit - they are in foreign calls, and we don't currently
wait for foreign calls to complete before exiting (this is a bug, in fact,
similar to the original DLL shutdown bug).
I'm not sure what to do, here are some options:
* the I/O request threads should be terminated, somehow.
* maybe we need two ways to shut down the RTS: forcibly, for program
exit,
and more carefully, for DLL shutdown.
* when shutting down a DLL, we should wait for and/or terminate
outstanding
foreign call threads.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1177>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs