1. 11 Mar, 2010 1 commit
    • Simon Marlow's avatar
      Use message-passing to implement throwTo in the RTS · 7408b392
      Simon Marlow authored
      This replaces some complicated locking schemes with message-passing
      in the implementation of throwTo. The benefits are
      
       - previously it was impossible to guarantee that a throwTo from
         a thread running on one CPU to a thread running on another CPU
         would be noticed, and we had to rely on the GC to pick up these
         forgotten exceptions. This no longer happens.
      
       - the locking regime is simpler (though the code is about the same
         size)
      
       - threads can be unblocked from a blocked_exceptions queue without
         having to traverse the whole queue now.  It's a rare case, but
         replaces an O(n) operation with an O(1).
      
       - generally we move in the direction of sharing less between
         Capabilities (aka HECs), which will become important with other
         changes we have planned.
      
      Also in this patch I replaced several STM-specific closure types with
      a generic MUT_PRIM closure type, which allowed a lot of code in the GC
      and other places to go away, hence the line-count reduction.  The
      message-passing changes resulted in about a net zero line-count
      difference.
      7408b392
  2. 02 Aug, 2009 1 commit
    • Simon Marlow's avatar
      RTS tidyup sweep, first phase · a2a67cd5
      Simon Marlow authored
      The first phase of this tidyup is focussed on the header files, and in
      particular making sure we are exposinng publicly exactly what we need
      to, and no more.
      
       - Rts.h now includes everything that the RTS exposes publicly,
         rather than a random subset of it.
      
       - Most of the public header files have moved into subdirectories, and
         many of them have been renamed.  But clients should not need to
         include any of the other headers directly, just #include the main
         public headers: Rts.h, HsFFI.h, RtsAPI.h.
      
       - All the headers needed for via-C compilation have moved into the
         stg subdirectory, which is self-contained.  Most of the headers for
         the rest of the RTS APIs have moved into the rts subdirectory.
      
       - I left MachDeps.h where it is, because it is so widely used in
         Haskell code.
       
       - I left a deprecated stub for RtsFlags.h in place.  The flag
         structures are now exposed by Rts.h.
      
       - Various internal APIs are no longer exposed by public header files.
      
       - Various bits of dead code and declarations have been removed
      
       - More gcc warnings are turned on, and the RTS code is more
         warning-clean.
      
       - More source files #include "PosixSource.h", and hence only use
         standard POSIX (1003.1c-1995) interfaces.
      
      There is a lot more tidying up still to do, this is just the first
      pass.  I also intend to standardise the names for external RTS APIs
      (e.g use the rts_ prefix consistently), and declare the internal APIs
      as hidden for shared libraries.
      a2a67cd5
  3. 18 Nov, 2008 1 commit
    • Simon Marlow's avatar
      Add optional eager black-holing, with new flag -feager-blackholing · d600bf7a
      Simon Marlow authored
      Eager blackholing can improve parallel performance by reducing the
      chances that two threads perform the same computation.  However, it
      has a cost: one extra memory write per thunk entry.  
      
      To get the best results, any code which may be executed in parallel
      should be compiled with eager blackholing turned on.  But since
      there's a cost for sequential code, we make it optional and turn it on
      for the parallel package only.  It might be a good idea to compile
      applications (or modules) with parallel code in with
      -feager-blackholing.
      
      ToDo: document -feager-blackholing.
      d600bf7a
  4. 15 Nov, 2006 1 commit
  5. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.
      0065d5ab
  6. 09 Dec, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-12-09 11:35:44 by simonmar] · 39208cd2
      simonmar authored
      Make the front panel compile again, submitted by Duncan Coutts
      <duncan.coutts@worc.ox.ac.uk>.  From his email:
      
      Attached is a patch to port the GHC RTS font panel to Gtk+ 2.x rather
      than the obsolete Gtk+ 1.2.
      
      There were basically two changes needed. Change the configure check to
      look for the pkg-config utility rather than the old gtk-config. At it's
      just checking for Gtk+ 2.0 or later. It may be that the new code
      actually needs a slightly later version than that. I'm not quite sure.
      
      The other change was to convert the ghc-fontpanel.glade file to the
      glade-2 format using the libglade-convert script and then to re-generate
      the C code for constructing the GUI, that is the Vis*.c Vis*.h files in
      ghc/rts.
      
      The front panel has been bit-rotting for quite some time so it has not
      kept up with changes in the rts structures. So I had to comment out
      references to 3 bits that no longer exist. I've left FIXMEs in the code
      at the appropriate places so that someone wiser than me can make the
      appropriate changes.
      
      So the thing does now build though I have no doubt that it will not run,
      or at least will not do the right thing because it has not yet been
      updated to the current state of the rts. However hopefully now that it
      is at least buildable with a modern Gtk+ version someone else might be
      able to fix it up.
      
      This also relates to trac ticket #599:
      
      http://cvs.haskell.org/trac/ghc/ticket/599
      39208cd2
  7. 25 Jul, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-07-25 14:12:48 by simonmar] · e792bb84
      simonmar authored
      Remove the ForeignObj# type, and all its PrimOps.  The new efficient
      representation of ForeignPtr doesn't use ForeignObj# underneath, and
      there seems no need to keep it.
      e792bb84
  8. 13 Jun, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-06-13 12:29:48 by simonmar] · b07f3876
      simonmar authored
      Block allocator performance fix: instead of keeping the free list
      ordered, keep it doubly-linked, and introduce a new flag BF_FREE so we
      can tell when a block is free.  We can still coalesce blocks on the
      free list because block descriptors are kept consecutively in memory,
      so we can tell based on the BF_FREE flag whether to coalesce with the
      next higher/lower blocks when freeing a block.
      
      This (almost) make freeChain O(n) rather than O(n^2), and has been
      reported to help a lot when dealing with very large heaps.
      b07f3876
  9. 12 Sep, 2004 1 commit
  10. 03 Sep, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-09-03 15:28:18 by simonmar] · 95ca6bff
      simonmar authored
      Cleanup: all (well, most) messages from the RTS now go through the
      functions in RtsUtils: barf(), debugBelch() and errorBelch().  The
      latter two were previously called belch() and prog_belch()
      respectively.  See the comments for the right usage of these message
      functions.
      
      One reason for doing this is so that we can avoid spurious uses of
      stdout/stderr by Haskell apps on platforms where we shouldn't be using
      them (eg. non-console apps on Windows).
      95ca6bff
  11. 13 Aug, 2004 1 commit
  12. 24 Jun, 2003 1 commit
  13. 31 Oct, 2001 1 commit
  14. 16 Aug, 2001 1 commit
  15. 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
  16. 19 Jan, 2001 2 commits
  17. 01 Nov, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-11-01 11:57:29 by simonmar] · ece274b6
      simonmar authored
      Add the GLADE config for the front panel, tweak a few things.
      ece274b6
    • simonmar's avatar
      [project @ 2000-11-01 11:41:47 by simonmar] · 39a99171
      simonmar authored
      Add a basic "front panel" for GHC-compiled programs.
      
      How to use it:
      
      	- re-autoconf & configure to detect GTK+
      
      	- add "GhcRtsWithFrontPanel = YES" to mk/build.mk
      
      	- rebuild the RTS
      
      	- compile up a program, add `gtk-config --libs` to the
      	  link command line
      
      	- run with program with +RTS -f,
      
      	- sit back & watch the show :-)  Programs with lots of
      	  heap-resident data are the most interesting.  For extra
      	  kicks, turn up the number of generations & steps like so:
      	  +RTS -f -G5 -T3.
      
      	- Bootstrap your compiler, and see in glorious technicolor
      	  just how much of a lumbering beast GHC really is.
      
      This is a work in progress.  There's lots more stuff we could display
      on the panel: suggestions/comments are of course welcome.  The window
      layout was designed with GLADE, I'll commit the config file shortly.
      
      I haven't quite figured out how we're going to integrate this with the
      release yet (ie. whether we'll distribute two separate RTS's or what).
      39a99171