1. 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.
      557947d3
  2. 16 Aug, 2002 1 commit
  3. 17 Jul, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-07-17 09:21:48 by simonmar] · 7457757f
      simonmar authored
      Remove most #includes of system headers from Stg.h, and instead
      #include any required headers directly in each RTS source file.
      
      The idea is to (a) reduce namespace pollution from system headers that
      we don't need, (c) be clearer about dependencies on system things in
      the RTS, and (c) improve via-C compilation times (maybe).
      
      In practice though, HsBase.h #includes everything anyway, so the
      difference from the point of view of .hc source is minimal.  However,
      this makes it easier to move to zero-includes if we wanted to (see
      discussion on the FFI list; I'm still not sure that's possible but
      at least this is a step in the right direction).
      7457757f
  4. 27 Nov, 2001 2 commits
    • sof's avatar
      [project @ 2001-11-27 01:57:59 by sof] · 78a0cc3d
      sof authored
      make prev. commit compile on non-win32 boxes
      78a0cc3d
    • sof's avatar
      [project @ 2001-11-27 01:51:23 by sof] · e30e0fb8
      sof authored
      Rearranged how the virtual timer 'subsystem' is brought up and down:
      
      * "int startVirtTimer(nat ms)" now starts the vtimer/ticker.
      * "int stopVirtTimer()" shuts down the ticker.
      
      i.e., removed install_vtalrm_handler() and initialize_virtual_timer().
      e30e0fb8
  5. 26 Nov, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-11-26 12:58:17 by simonpj] · d6181fe1
      simonpj authored
      In the Win32 build, don't call initProfTimer unless PROFILING
      is on.  This mirrors the Unix deal.   Indeed initProfTimer
      isn't defined if PROFILING is on.
      
      I don't know how this works for anyone else on Win32!
      Sigbjorn: have I done this right, or am I misunderstanding?
      d6181fe1
  6. 22 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-22 14:25:11 by simonmar] · db61851c
      simonmar authored
      Retainer Profiling / Lag-drag-void profiling.
      
      This is mostly work by Sungwoo Park, who spent a summer internship at
      MSR Cambridge this year implementing these two types of heap profiling
      in GHC.
      
      Relative to Sungwoo's original work, I've made some improvements to
      the code:
      
         - it's now possible to apply constraints to retainer and LDV profiles
           in the same way as we do for other types of heap profile (eg.
           +RTS -hc{foo,bar} -hR -RTS gives you a retainer profiling considering
           only closures with cost centres 'foo' and 'bar').
      
         - the heap-profile timer implementation is cleaned up.
      
         - heap profiling no longer has to be run in a two-space heap.
      
         - general cleanup of the code and application of the SDM C coding
           style guidelines.
      
      Profiling will be a little slower and require more space than before,
      mainly because closures have an extra header word to support either
      retainer profiling or LDV profiling (you can't do both at the same
      time).
      
      We've used the new profiling tools on GHC itself, with moderate
      success.  Fixes for some space leaks in GHC to follow...
      db61851c
  7. 21 Nov, 2001 1 commit
    • sof's avatar
      [project @ 2001-11-21 20:55:10 by sof] · b88636e4
      sof authored
      initialize_virtual_timer: Robustified win32 version; don't
      assume that the minimal resolution is one millisec, consult
      the underlying impl via timeGetDevCaps().
      b88636e4
  8. 13 Nov, 2001 1 commit
  9. 14 Aug, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-08-14 13:40:07 by sewardj] · bc5c8021
      sewardj authored
      Change the story about POSIX headers in C compilation.
      
      Until now, all C code in the RTS and library cbits has by default been
      compiled with settings for POSIXness enabled, that is:
         #define _POSIX_SOURCE   1
         #define _POSIX_C_SOURCE 199309L
         #define _ISOC9X_SOURCE
      If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
      before including headers.
      
      This scheme has some bad effects:
      
      * It means that ccall-unfoldings exported via interfaces from a
        module compiled with -DNON_POSIX_SOURCE may not compile when
        imported into a module which does not -DNON_POSIX_SOURCE.
      
      * It overlaps with the feature tests we do with autoconf.
      
      * It seems to have caused borkage in the Solaris builds for some
        considerable period of time.
      
      The New Way is:
      
      * The default changes to not-being-in-Posix mode.
      
      * If you want to force a C file into Posix mode, #include as
        the **first** include the new file ghc/includes/PosixSource.h.
        Most of the RTS C sources have this include now.
      
      * NON_POSIX_SOURCE is almost totally expunged.  Unfortunately
        we have to retain some vestiges of it in ghc/compiler so that
        modules compiled via C on Solaris using older compilers don't
        break.
      bc5c8021
  10. 02 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-02 10:52:15 by simonmar] · ac76dbc4
      simonmar authored
      Don't context switch on the timer if the flag +RTS -C0 is given.  This
      gives us reliable/repeatable runs with -C0 (I've been running with a
      similar change for months now, debugging is virtually impossible
      without it).
      ac76dbc4
  11. 27 Feb, 2001 1 commit
    • rrt's avatar
      [project @ 2001-02-27 12:43:45 by rrt] · 6339f4b0
      rrt authored
      mingwin "fixes": getourtimeofday now returns the right units, and awaitEvent
      fudged to use WinSock select(), so that although it doesn't work for file
      handles, at least it doesn't cause nasty crashes; instead it just blocks.
      6339f4b0
  12. 13 Feb, 2001 1 commit
    • rrt's avatar
      [project @ 2001-02-13 11:10:28 by rrt] · 7b76c2c1
      rrt authored
      Use MM timers on Windows even when not profiling, as threadDelay needs it
      to work properly.
      
      Flush stdout when quitting (in RtsUtils), as Linux glibc probably works now,
      and it reveals error messages that are otherwise truncated when one's
      program segfaults.
      7b76c2c1
  13. 06 Oct, 2000 1 commit
  14. 11 Sep, 2000 1 commit
    • rrt's avatar
      [project @ 2000-09-11 15:04:08 by rrt] · 1448475b
      rrt authored
      Implemented gettimeofday on Windows by calling GetTickCount(). This
      only seems to have a resolution of 1/100s, but that's just about OK
      for threadDelay, which only needs 50 ticks per second.
      1448475b
  15. 25 Aug, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-08-25 13:12:07 by simonmar] · 5a4ec937
      simonmar authored
      Change the way threadDelay# is implemented.
      
      We now use a list of sleeping threads sorted in increasing order by
      the time at which they will wake up.  This avoids us having to
      traverse the entire queue on each context switch.
      5a4ec937
  16. 03 Aug, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-08-03 11:28:35 by simonmar] · 66f7a41d
      simonmar authored
      Implement +RTS -C<n>, the context switch interval flag.  This was
      previously advertised in the usage message, but there was a note in
      the Users' Guide stating that it didn't work.  Anwyay, I'm going to
      consider it a bug and backport to 4.08.1.
      66f7a41d
  17. 17 Jul, 2000 1 commit
  18. 20 Jun, 2000 1 commit
  19. 03 Apr, 2000 1 commit
  20. 21 Mar, 2000 1 commit
  21. 20 Mar, 2000 1 commit
    • andy's avatar
      [project @ 2000-03-20 09:42:49 by andy] · 90a6918a
      andy authored
      Adding an alternative to the "delay" system used for
      threads that are waiting for time to pass.
      
      This works on a target time basis, eliminating the
      need to use the ticky style counter.
      
      It is only enabled under:
      
      #if defined(INTERPRETER) && !defined(HAVE_SETITIMER)
      90a6918a
  22. 14 Mar, 2000 1 commit
    • sof's avatar
      [project @ 2000-03-14 01:43:27 by sof] · cfab6b90
      sof authored
      * 'inlined' subset of the MM protos needed to compile this module, i.e.,
        don't require whoever does a 'make' in ghc/rts/ to have extended their
        <windows.h>
      * right Win32 proto for handle_tick()
      cfab6b90
  23. 28 Feb, 2000 1 commit
  24. 13 Jan, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-01-13 12:40:15 by simonmar] · be587a37
      simonmar authored
      - remove AllBlocked scheduler return code.  Nobody owned up to having
        created it or even knowing what it was there for.
      
      - clean up fatal error condition handling somewhat.  The process
        exit code from a GHC program now indicates the kind of failure
        for certain kinds of exit:
      
      	general internal RTS error	254
      	program deadlocked		253
      	program interrupted (ctrl-C)	252
      	heap overflow			251
      	main thread killed		250
      
        and we leave exit codes 1-199 for the user (as is traditional at MS,
        200-249 are reserved for future expansion, and may contain
        undocumented extensions :-)
      be587a37
  25. 01 Dec, 1999 1 commit
  26. 16 Sep, 1999 1 commit
    • sof's avatar
      [project @ 1999-09-16 08:33:54 by sof] · f2419006
      sof authored
      Disable timer ticks on 'pure' Win32 platforms unless really needed
      (for profiling) -- no reason to enable it elsewhere as the Win32 bits
      doesn't currently support thread{Delay,Wait{Read,Write}}#
      f2419006
  27. 25 Aug, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-08-25 16:11:43 by simonmar] · c6ab4bfa
      simonmar authored
      Support for thread{WaitRead,WaitWrite,Delay}.  These should behave
      identically to the 3.02 implementations.
      
      We now have the virtual timer on during all program runs, which ticks
      at 50Hz by default.  This is used to implement threadDelay, so you
      won't get any better granularity than the tick frequency
      unfortunately.  It remains to be seen whether using the virtual timer
      will have a measurable impact on performance for non-threadDelaying
      programs.
      
      All operations in the I/O subsystem should now be non-blocking with
      respect to other running Haskell threads.  It remains to be seen
      whether this will have a measurable performance impact on
      non-concurrent programs (probably not).
      c6ab4bfa
  28. 03 Mar, 1999 1 commit
  29. 05 Feb, 1999 1 commit
  30. 02 Dec, 1998 1 commit
  31. 07 Jul, 1997 1 commit
  32. 14 Mar, 1997 1 commit
  33. 21 Jan, 1997 1 commit
  34. 11 Jan, 1996 1 commit
  35. 08 Jan, 1996 1 commit