[GHC] #11394: Base should use native Win32 IO on Windows

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Core | Version: 7.10.3 Libraries | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- There are a variety of issues caused by the impedance mismatch between GHC's use of Posix I/O interfaces on Windows (particularly with respect to console I/O), * #10542: Incorrect Unicode input on Windows Console * #7593: Unable to print exceptions of unicode identifiers * #4471: Incorrect Unicode output on Windows Console * #2189: hSetBuffering stdin NoBuffering doesn't work on Windows As pointed on in ticket:2189#comment:12 the ultimate solution to this would be to move all of GHC's IO to use the respective Win32 interfaces. = Also relevant = * #7353: Windows lacks support in the I/O manager * #806: hGetBufNonBlocking doesn't work on Windows * #3081: Double output after Ctrl+C on Windows -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * os: Unknown/Multiple => Windows -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): I think Joey's IOCP based manager from #11394 could be a good start for this. We should see how easy it is to bring his old code up to date on GHC now and how much of it can be re-used https://github.com/joeyadams/haskell- iocp Might also want to consider support for Registered I/O which would significantly up the throughput for Windows Based server programs. It's a recent addition to Windows 8+, but might be worth a look at https://technet.microsoft.com/en-us/library/hh997032.aspx. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * cc: Phyx- (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by simonpj: Old description:
There are a variety of issues caused by the impedance mismatch between GHC's use of Posix I/O interfaces on Windows (particularly with respect to console I/O),
* #10542: Incorrect Unicode input on Windows Console * #7593: Unable to print exceptions of unicode identifiers * #4471: Incorrect Unicode output on Windows Console * #2189: hSetBuffering stdin NoBuffering doesn't work on Windows
As pointed on in ticket:2189#comment:12 the ultimate solution to this would be to move all of GHC's IO to use the respective Win32 interfaces.
= Also relevant = * #7353: Windows lacks support in the I/O manager * #806: hGetBufNonBlocking doesn't work on Windows * #3081: Double output after Ctrl+C on Windows
New description: There are a variety of issues caused by the impedance mismatch between GHC's use of Posix I/O interfaces on Windows (particularly with respect to console I/O), * #10542: Incorrect Unicode input on Windows Console * #7593: Unable to print exceptions of unicode identifiers * #4471: Incorrect Unicode output on Windows Console * #2189: hSetBuffering stdin NoBuffering doesn't work on Windows As pointed on in ticket:2189#comment:12 the ultimate solution to this would be to move all of GHC's IO to use the respective Win32 interfaces. = Also relevant = * #7353: Windows lacks support in the I/O manager * #806: hGetBufNonBlocking doesn't work on Windows * #3081: Double output after Ctrl+C on Windows * #13440: `putStr` has different behaviour on Windows -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): I'm currently working on this and a few other things for my 8.4 contributions. But I'll refrain from mass assigning all these issues to me until I know for sure I can get it done. Currently it looks viable though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.6.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): Console part is implemented, file I/O is a bit more challenging to integrate as MIO isn't set up for asynchronous read/writes. It's taking a bit of time to iron out the correct interactions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Phyx- Type: task | Status: new Priority: normal | Milestone: 8.6.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * owner: (none) => Phyx- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Phyx- Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): All these are now handled correctly under the new I/O manager. Open tasks are tracking down a deadlock and implementing the non-threaded implementation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Phyx- Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): deadlock fixed (turns out to be how the scheduler saves and restores errors in TLS when the haskell threads are scheduled) and timer manager integrated into I/O manager, working on fixing signal handlers and seeing if I can get it to work correctly in cygwin hosts like mintty which have unfortunately become standard. Do still have an issue to fix where there seems to be an outstanding I/O request which never finishes.. I think this might be the `LockFile` request. Need to investigate. Also working on how to implement the non-threaded version. Now that I'm unstuck on the deadlock can make some decent progress again. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Phyx- Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): For the console I/O part I have implemented an alternative interface which is able to handle un-buffered reads. SO that works now as well on Windows. In un-buffered mode with processed inputs turned off, signal handlers won't work, as they'll be placed in the input stream one character at a time. I think this is an acceptable limitation so I won't spend the time to support this for now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11394: Base should use native Win32 IO on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Phyx- Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Core Libraries | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: 806, 2189, | 2408, 4471, 7353, 7593, 10542, | 12873, 14530 Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Old description:
There are a variety of issues caused by the impedance mismatch between GHC's use of Posix I/O interfaces on Windows (particularly with respect to console I/O),
* #10542: Incorrect Unicode input on Windows Console * #7593: Unable to print exceptions of unicode identifiers * #4471: Incorrect Unicode output on Windows Console * #2189: hSetBuffering stdin NoBuffering doesn't work on Windows
As pointed on in ticket:2189#comment:12 the ultimate solution to this would be to move all of GHC's IO to use the respective Win32 interfaces.
= Also relevant = * #7353: Windows lacks support in the I/O manager * #806: hGetBufNonBlocking doesn't work on Windows * #3081: Double output after Ctrl+C on Windows * #13440: `putStr` has different behaviour on Windows
New description: There are a variety of issues caused by the impedance mismatch between GHC's use of Posix I/O interfaces on Windows (particularly with respect to console I/O), * #10542: Incorrect Unicode input on Windows Console * #7593: Unable to print exceptions of unicode identifiers * #4471: Incorrect Unicode output on Windows Console * #2189: hSetBuffering stdin NoBuffering doesn't work on Windows As pointed on in ticket:2189#comment:12 the ultimate solution to this would be to move all of GHC's IO to use the respective Win32 interfaces. = Also relevant = * #7353: Windows lacks support in the I/O manager * #806: hGetBufNonBlocking doesn't work on Windows * #3081: Double output after Ctrl+C on Windows * #13440: `putStr` has different behaviour on Windows * #4942: `GHC.ConsoleHandler` does not call back application when Close button is pressed. -- Comment (by Phyx-): Started designing the last piece of the puzzle which is non-threaded RTS. The non-threaded I/O manager seems to have a completely different interface on Windows, going so far as to having 3 Windows only prim-ops. Trying to understand why... With the threaded RTS I still have to track down a race condition somewhere. I think it has to do with the foreign pointer's finalizers... Wonder if I can turn off GC completely. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11394#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC