1. 16 Jul, 2003 1 commit
    • sof's avatar
      [project @ 2003-07-16 17:40:38 by sof] · 788897b6
      sof authored
      - change prototype of async proc calls to
            typedef int (*DoProcProc)(void *param);
        i.e., have the proc return a result. Turned out that almost all
        uses of the primop ended up encoding a result via their 'param'.
      - when adding new I/O requests, shorten the time the IOManager
        lock is held. Helps to keep down the size of the thread pool.
  2. 12 Jul, 2003 1 commit
  3. 03 Jul, 2003 1 commit
    • sof's avatar
      [project @ 2003-07-03 15:14:56 by sof] · 18340925
      sof authored
      New primop (mingw only),
        asyncDoProc# :: Addr# -> Addr# -> State# RealWorld-> (# State# RealWorld, Int#, Int# #)
      which lets a Haskell thread hand off a pointer to external code (1st arg) for
      asynchronous execution by the RTS worker thread pool. Second arg is data passed
      in to the asynchronous routine. The routine is _not_ permitted to re-enter
      the RTS as part of its execution.
  4. 22 Feb, 2003 1 commit
    • sof's avatar
      [project @ 2003-02-22 04:51:50 by sof] · 557947d3
      sof authored
      Clean up code&interfaces that deals with timers and asynchrony:
      - Timer.{c,h} now defines the platform-independent interface
        to the timing services needed by the RTS. Itimer.{c,h} +
        win32/Ticker.{c,h} defines the OS-specific services that
        creates/destroys a timer.
      - For win32 plats, drop the long-standing use of the 'multimedia'
        API timers and implement the ticking service ourselves. Simpler
        and more flexible.
      - Select.c is now solely for platforms that use select() to handle
        non-blocking I/O & thread delays. win32/AwaitEvent.c provides
        the same API on the Win32 side.
      - support threadDelay on win32 platforms via worker threads.
      Not yet compiled up on non-win32 platforms; will do once checked in.
  5. 21 Feb, 2003 1 commit
    • sof's avatar
      [project @ 2003-02-21 05:34:12 by sof] · 5b4f5a6a
      sof authored
      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.]