[project @ 2003-02-21 05:34:12 by sof]
authorsof <unknown>
Fri, 21 Feb 2003 05:34:17 +0000 (05:34 +0000)
committersof <unknown>
Fri, 21 Feb 2003 05:34:17 +0000 (05:34 +0000)
commit5b4f5a6aa8f384573f0f11bc744d5637a1f3bc09
tree11ff6b2dd41d2c6910553437ada99a67b9d0cbb3
parente434189798bb3ca2125ac8978b4177511030582b
[project @ 2003-02-21 05:34:12 by sof]
Asynchronous / non-blocking I/O for Win32 platforms.

This commit introduces a Concurrent Haskell friendly view of I/O on
Win32 platforms. Through the use of a pool of worker Win32 threads, CH
threads may issue asynchronous I/O requests without blocking the
progress of other CH threads. The issuing CH thread is blocked until
the request has been serviced though.

GHC.Conc exports the primops that take care of issuing the
asynchronous I/O requests, which the IO implementation now takes
advantage of. By default, all Handles are non-blocking/asynchronous,
but should performance become an issue, having a per-Handle flag for
turning off non-blocking could easily be imagined&introduced.

[Incidentally, this thread pool-based implementation could easily be
extended to also allow Haskell code to delegate the execution of
arbitrary pieces of (potentially blocking) external code to another OS
thread. Given how relatively gnarly the locking story has turned out
to be with the 'threaded' RTS, that may not be such a bad idea.]
16 files changed:
ghc/compiler/prelude/primops.txt.pp
ghc/includes/PrimOps.h
ghc/includes/StgMiscClosures.h
ghc/includes/TSO.h
ghc/rts/HeapStackCheck.hc
ghc/rts/Linker.c
ghc/rts/Makefile
ghc/rts/PrimOps.hc
ghc/rts/RtsStartup.c
ghc/rts/Select.c
ghc/rts/win32/AsyncIO.c [new file with mode: 0644]
ghc/rts/win32/AsyncIO.h [new file with mode: 0644]
ghc/rts/win32/IOManager.c [new file with mode: 0644]
ghc/rts/win32/IOManager.h [new file with mode: 0644]
ghc/rts/win32/WorkQueue.c [new file with mode: 0644]
ghc/rts/win32/WorkQueue.h [new file with mode: 0644]