1. 23 Aug, 2006 1 commit
  2. 10 Aug, 2006 1 commit
  3. 16 Jun, 2006 1 commit
    • Simon Marlow's avatar
      Asynchronous exception support for SMP · b1953bbb
      Simon Marlow authored
      This patch makes throwTo work with -threaded, and also refactors large
      parts of the concurrency support in the RTS to clean things up.  We
      have some new files:
      
        RaiseAsync.{c,h}	asynchronous exception support
        Threads.{c,h}         general threading-related utils
      
      Some of the contents of these new files used to be in Schedule.c,
      which is smaller and cleaner as a result of the split.
      
      Asynchronous exception support in the presence of multiple running
      Haskell threads is rather tricky.  In fact, to my annoyance there are
      still one or two bugs to track down, but the majority of the tests run
      now.
      b1953bbb
  4. 08 Jun, 2006 2 commits
    • Simon Marlow's avatar
      fix possible ^C problems · 7434fb5b
      Simon Marlow authored
      Calling prodAllCapabilities() from interruptStgRts() was wrong, for
      the same reasons that we stopped doing it in handle_tick().  We now
      use the same mechanism (send a byte down the pipe to the IO manager
      thread), but abstract it in a wakeUpRts() function in the scheduler.
      7434fb5b
    • Simon Marlow's avatar
      New tracing interface · 5a2769f0
      Simon Marlow authored
      A simple interface for generating trace messages with timestamps and
      thread IDs attached to them.  Most debugging output goes through this
      interface now, so it is straightforward to get timestamped debugging
      traces with +RTS -vt.  Also, we plan to use this to generate
      parallelism profiles from the trace output.
      5a2769f0
  5. 07 Jun, 2006 2 commits
  6. 25 May, 2006 1 commit
  7. 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
  8. 27 Mar, 2006 1 commit
    • Simon Marlow's avatar
      Add a new primitive forkOn#, for forking a thread on a specific Capability · c520a3a2
      Simon Marlow authored
      This gives some control over affinity, while we figure out the best
      way to automatically schedule threads to make best use of the
      available parallelism.
      
      In addition to the primitive, there is also:
       
        GHC.Conc.forkOnIO :: Int -> IO () -> IO ThreadId
      
      where 'forkOnIO i m' creates a thread on Capability (i `rem` N), where
      N is the number of available Capabilities set by +RTS -N.
      
      Threads forked by forkOnIO do not automatically migrate when there are
      free Capabilities, like normal threads do.  Still, if you're using
      forkOnIO exclusively, it's a good idea to do +RTS -qm to disable work
      pushing anyway (work pushing takes too much time when the run queues
      are large, this is something we need to fix).
      c520a3a2
  9. 24 Mar, 2006 1 commit
    • Simon Marlow's avatar
      Add some more flexibility to the multiproc scheduler · 4368121d
      Simon Marlow authored
      There are two new options in the -threaded RTS:
       
        -qm       Don't automatically migrate threads between CPUs
        -qw       Migrate a thread to the current CPU when it is woken up
      
      previously both of these were effectively off, i.e. threads were
      migrated between CPUs willy-milly, and threads were always migrated to
      the current CPU when woken up.  This is the first step in tweaking the
      scheduling for more effective work balancing, there will no doubt be
      more to come.
      4368121d
  10. 17 Mar, 2006 1 commit
  11. 16 Mar, 2006 2 commits
  12. 15 Mar, 2006 1 commit
    • Simon Marlow's avatar
      Improvements to shutting down of the runtime · 5638488b
      Simon Marlow authored
      Yet another attempt at shutdown & interruption.  This one appears to
      work better; ^C is more responsive in multi threaded / SMP, and I
      fixed one case where the runtime wasn't responding to ^C at all.
      5638488b
  13. 13 Mar, 2006 1 commit
  14. 10 Mar, 2006 1 commit
  15. 07 Mar, 2006 1 commit
  16. 22 Feb, 2006 1 commit
  17. 12 Feb, 2006 1 commit
  18. 09 Feb, 2006 1 commit
    • Simon Marlow's avatar
      Merge the smp and threaded RTS ways · eba7b660
      Simon Marlow authored
      Now, the threaded RTS also includes SMP support.  The -smp flag is a
      synonym for -threaded.  The performance implications of this are small
      to negligible, and it results in a code cleanup and reduces the number
      of combinations we have to test.
      eba7b660
  19. 08 Feb, 2006 1 commit
    • Simon Marlow's avatar
      make the smp way RTS-only, normal libraries now work with -smp · beb5737b
      Simon Marlow authored
      We had to bite the bullet here and add an extra word to every thunk,
      to enable running ordinary libraries on SMP.  Otherwise, we would have
      needed to ship an extra set of libraries with GHC 6.6 in addition to
      the two sets we already ship (normal + profiled), and all Cabal
      packages would have to be compiled for SMP too.  We decided it best
      just to take the hit now, making SMP easily accessible to everyone in
      GHC 6.6.
      
      Incedentally, although this increases allocation by around 12% on
      average, the performance hit is around 5%, and much less if your inner
      loop doesn't use any laziness.
      beb5737b
  20. 23 Jan, 2006 1 commit
    • Simon Marlow's avatar
      implement clean/dirty TSOs · 9d909b3b
      Simon Marlow authored
      Along the lines of the clean/dirty arrays and IORefs implemented
      recently, now threads are marked clean or dirty depending on whether
      they need to be scanned during a minor GC or not.  This should speed
      up GC when there are lots of threads, especially if most of them are
      idle.
      9d909b3b
  21. 18 Jan, 2006 1 commit
  22. 28 Nov, 2005 1 commit
  23. 25 Nov, 2005 2 commits
  24. 24 Nov, 2005 1 commit
  25. 21 Nov, 2005 1 commit
  26. 18 Nov, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-11-18 15:24:12 by simonmar] · c5cd2343
      simonmar authored
      Two improvements to the SMP runtime:
      
        - support for 'par', aka sparks.  Load balancing is very primitive
          right now, but I have seen programs that go faster using par.
      
        - support for backing off when a thread is found to be duplicating
          a computation currently underway in another thread.  This also
          fixes some instability in SMP, because it turned out that when
          an update frame points to an indirection, which can happen if
          a thunk is under evaluation in multiple threads, then after GC
          has shorted out the indirection the update will trash the value.
          Now we suspend the duplicate computation to the heap before this
          can happen.
      
      Additionally:
      
        - stack squeezing is separate from lazy blackholing, and now only
          happens if there's a reasonable amount of squeezing to be done
          in relation to the number of words of stack that have to be moved.
          This means we won't try to shift 10Mb of stack just to save 2
          words at the bottom (it probably never happened, but still).
      
        - update frames are now marked when they have been visited by lazy
          blackholing, as per the SMP paper.
      
        - cleaned up raiseAsync() a bit.
      c5cd2343
  27. 08 Nov, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-11-08 15:07:08 by simonmar] · cbc83989
      simonmar authored
      SMP bugfix: if the thread we were just running blocked, then we are in
      a delicate state - we don't necessarily have access to the TSO we were
      just running, because we relinquished it when we put it on whatever
      blocking queue it is on.  It might even be running already.
      
      Previously I made the scheduler quickly loop again in this case.
      However, I made it loop too quickly: we should be sure to set the
      blackholes_need_checking flag if necessary, otherwise we can miss some
      wakeups.
      cbc83989
    • simonmar's avatar
      [project @ 2005-11-08 10:44:22 by simonmar] · 6e4e6a2a
      simonmar authored
      raiseAsync: fix bug that can cause a scavenge_stack panic for a thread
      that has just been killed.
      6e4e6a2a
  28. 07 Nov, 2005 1 commit
  29. 04 Nov, 2005 2 commits
  30. 03 Nov, 2005 2 commits
  31. 02 Nov, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-11-02 13:04:55 by simonmar] · db2468da
      simonmar authored
      when shutting down, don't allow a worker to exit until the run queue
      is empty, because the thread in exitScheduler() is waiting for this.
      db2468da
    • simonmar's avatar
      [project @ 2005-11-02 12:26:21 by simonmar] · d9dfeb2a
      simonmar authored
      scheduleHandleStackOverflow: fix bug in non-threaded RTS - if
      (task->tso != NULL), then (task->tso) is not necessarily the TSO we
      are running (in the threaded RTS it is).
      
      Also fix a few non-threaded warnings while I'm here.
      d9dfeb2a
  32. 27 Oct, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-10-27 15:26:06 by simonmar] · 677c6345
      simonmar authored
      - Very simple work-sharing amongst Capabilities: whenever a Capability
        detects that it has more than 1 thread in its run queue, it runs
        around looking for empty Capabilities, and shares the threads on its
        run queue equally with the free Capabilities it finds.
      
      - unlock the garbage collector's mutable lists, by having private
        mutable lists per capability (and per generation).  The private
        mutable lists are moved onto the main mutable lists at each GC.
        This pulls the old-generation update code out of the storage manager
        mutex, which is one of the last remaining causes of (alleged) contention.
      
      - Fix some problems with synchronising when a GC is required.  We should
        synchronise quicker now.
      677c6345