#7353: Make system IO interruptible on Windows
-----------------------------------------+----------------------------------
Reporter: joeyadams | Owner:
Type: bug | Status: new
Priority: normal | Component: Runtime System
Version: 7.6.1 | Keywords:
Os: Windows | Architecture: Unknown/Multiple
Failure: Incorrect result at runtime | Testcase:
Blockedby: | Blocking:
Related: |
-----------------------------------------+----------------------------------
Currently, IO operations (connect, read, etc.) cannot be interrupted on
Windows. Additionally, threadWaitRead and threadWaitWrite do not work on
Windows (IIRC, they can't tell if the given file descriptor is a socket or
not, so they assume it's not).
The reason is that GHC does not have an IO manager for Windows like it
does for *nix. For Windows with -threaded, the network package uses
blocking FFI calls, which cannot be interrupted by asynchronous
exceptions. Thus, System.Timeout and killThread can't be used to time out
and interrupt network IO.
I'm working on a program that needs to run on a Windows XP machine for
long periods of time, interacting with a couple intermittent network
services. This issue is making things very difficult for me, so I want to
get it fixed. I do not need to support thousands of concurrent
connections efficiently; I just need my program to run reliably.
What needs to happen for IO to be interruptible on Windows with -threaded
? I'm willing to put in the work, but there's a lot I'd have to learn
about windows IO and GHC IO handling. One question to get started: are
threadWaitRead/threadWaitWrite even possible to implement on Windows, or
might Windows assign overlapping HANDLE numbers to sockets and regular
files?
This issue spans both GHC and the network package, but I'd like to collect
information about it in one place. Related issues:
* http://trac.haskell.org/network/ticket/2
* https://github.com/haskell/network/issues/36
* http://hackage.haskell.org/trac/ghc/ticket/3937
* http://hackage.haskell.org/trac/ghc/ticket/5797
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7353>
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