[GHC] #7353: Make system IO interruptible on Windows
GHC
cvs-ghc at haskell.org
Wed Oct 24 15:23:21 CEST 2012
#7353: Make system IO interruptible on Windows
---------------------------------+------------------------------------------
Reporter: joeyadams | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: libraries/base | Version: 7.6.1
Keywords: | Os: Windows
Architecture: Unknown/Multiple | Failure: Incorrect result at runtime
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Changes (by simonmar):
* difficulty: => Unknown
* component: Runtime System => libraries/base
* milestone: => 7.8.1
Comment:
There are a few options:
* maybe `foreign import ccall interruptible` will work for the FFI calls
in the network package. It causes `CancelSynchronousIo()` to be called
when the thread is the target of an exception, but I have no idea whether
this will actually work to interrupt the operation or not.
* make a version of `threadWaitRead` that works for sockets. This is
easy; see #5797. However, this won't necessarily cancel the operation
when an exception is raised, you'll need to arrange that separately
somehow.
* Implement an IO manager for Windows. This is of course the best
solution, but it's a lot of work. You'd need to bind all the appropriate
APIs in the base package, maybe copying or moving bits of the Win32
package into base. Ideally instead of FDs in the IO library we would use
Win32 `HANDLE`s, so there would need to be Win32 replacements for
`GHC.IO.FD` and `GHC.IO.Handle.FD`. This would have the nice effect of
eliminating both the mingw and msvcrt layers from the IO library on Win32.
Then the IO manager can use Win32 overlapped I/O.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7353#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list