Windows overlapped IO

Simon Marlow simonmarhaskell at
Fri Nov 16 04:58:39 EST 2007

Felix Martini wrote:
> I have made a prototype for overlapped IO that works with a modified
> version of Takano Akio's SSC library.

Great!  (I don't know what Takano Akio's SSC library is though)

> I have been trying to add it to
> GHC's IO implementation but there are some issues. Instead of file
> descriptors windows handles are needed.

Yes, I thought that might be a problem.  You will probably have to replace 
the existing FD in a Handle with a more complex type, maybe something like

type WinHandle
   = FileHandle HANDLE
   | Socket FD

perhaps pipes fit into FileHandle, I'm not sure.  Maybe there should be an 
alternative for Console?

I think we should be avoiding the CRT for I/O and using Win32 exclusively. 
  I can believe this might be a lot of work, though.

> The GHC handle implementation
> is currently based around fd's and many functions would need a
> separate windows API version. In some cases there is no simple
> conversion of existing functionality like the binary/text modes.

binary/text would have to be implemented in the Haskell IO library?

> An
> additional complication is that Haskell handles can be a lot of things
> other than files. Finally, a threaded rts is needed for the worker
> pool that processes the IO completions, so the current single threaded
> IO support must also remain.

At least getting the threaded RTS version working first would be a good 
step, then we can think about how to do the single-threaded version.


More information about the Glasgow-haskell-users mailing list