Add support for the IO manager thread on Windows
authorSimon Marlow <simonmar@microsoft.com>
Fri, 1 Dec 2006 14:48:23 +0000 (14:48 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Fri, 1 Dec 2006 14:48:23 +0000 (14:48 +0000)
commit80a766fdb6864eae613962e43ad9eb371e0ce80c
tree85bb6589d0b8f138b721f01d4b5337ff87ba9b11
parentde6c8e5293c9ef68b597ab2e6d55c3f42a283489
Add support for the IO manager thread on Windows
Fixes #637.
The implications of this change are:
  - threadDelay on Windows no longer creates a new OS thread each time,
    instead it communicates with the IO manager thread in the same way as
    on Unix.
  - deadlock detection now works the same way on Windows as on Unix; that
    is the timer interrupt wakes up the IO manager thread, which causes
    the scheduler to check for deadlock.
  - Console events now get sent to the IO manager thread, in the same way as
    signals do on Unix.  This means that console events should behave more
    reliably with -threaded on Windows.

All this applies only with -threaded.  Without -threaded, the old
ConsoleEvent code is still used.

After some testing, this could be pushed to the 6.6 branch.
includes/RtsExternal.h
rts/Prelude.h
rts/RtsStartup.c
rts/Schedule.c
rts/ThrIOManager.h [new file with mode: 0644]
rts/posix/Signals.h
rts/win32/ConsoleHandler.c
rts/win32/ConsoleHandler.h
rts/win32/ThrIOManager.c [new file with mode: 0644]