Opened 2 years ago

Last modified 2 days ago

#11394 new task

Base should use native Win32 IO on Windows

Reported by: bgamari Owned by: Phyx-
Priority: normal Milestone: 8.8.1
Component: Core Libraries Version: 7.10.3
Keywords: Cc: ekmett, Phyx-
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by simonpj)

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

Change History (10)

comment:1 Changed 2 years ago by bgamari

Operating System: Unknown/MultipleWindows

comment:2 Changed 2 years ago by Phyx-

I think Joey's IOCP based manager from #7353 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

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

Last edited 2 years ago by Phyx- (previous) (diff)

comment:3 Changed 2 years ago by Phyx-

Cc: Phyx- added

comment:4 Changed 18 months ago by Phyx-

Milestone: 8.4.1

comment:5 Changed 15 months ago by simonpj

Description: modified (diff)

comment:6 Changed 15 months ago 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.

comment:7 Changed 5 months ago by bgamari


This ticket won't be resolved in 8.4; remilestoning for 8.6. Do holler if you are affected by this or would otherwise like to work on it.

comment:8 Changed 7 weeks ago 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. Particularly when seeks are involved.

Last edited 7 weeks ago by Phyx- (previous) (diff)

comment:9 Changed 7 weeks ago by Phyx-

Owner: set to Phyx-

comment:10 Changed 2 days ago by bgamari


These won't be fixed for 8.6, bumping to 8.8.

Note: See TracTickets for help on using tickets.