1. 02 May, 2014 1 commit
    • Simon Marlow's avatar
      Per-thread allocation counters and limits · b0534f78
      Simon Marlow authored
      This tracks the amount of memory allocation by each thread in a
      counter stored in the TSO.  Optionally, when the counter drops below
      zero (it counts down), the thread can be sent an asynchronous
      exception: AllocationLimitExceeded.  When this happens, given a small
      additional limit so that it can handle the exception.  See
      documentation in GHC.Conc for more details.
      
      Allocation limits are similar to timeouts, but
      
        - timeouts use real time, not CPU time.  Allocation limits do not
          count anything while the thread is blocked or in foreign code.
      
        - timeouts don't re-trigger if the thread catches the exception,
          allocation limits do.
      
        - timeouts can catch non-allocating loops, if you use
          -fno-omit-yields.  This doesn't work for allocation limits.
      
      I couldn't measure any impact on benchmarks with these changes, even
      for nofib/smp.
      b0534f78
  2. 25 Oct, 2013 1 commit
  3. 12 Oct, 2013 1 commit
  4. 28 Sep, 2013 1 commit
  5. 22 Sep, 2013 2 commits
  6. 21 Sep, 2013 1 commit
  7. 18 Sep, 2013 1 commit
  8. 17 Sep, 2013 2 commits
  9. 08 Sep, 2013 2 commits
  10. 16 Aug, 2013 1 commit
  11. 14 Aug, 2013 1 commit
  12. 09 Jul, 2013 1 commit
  13. 16 Feb, 2013 2 commits
  14. 11 Dec, 2012 1 commit
  15. 10 Dec, 2012 1 commit
    • Simon Marlow's avatar
      Make a class for asynchronous exceptions in the exception hierarchy · 756a970e
      Simon Marlow authored
      Right now, we only have
      
      data AsyncException
        = StackOverflow
        | HeapOverflow
        | ThreadKilled
        | ...
      
      so it is not possible to add another async exception.  For instance,
      the Timeout exception in System.Timeout should really be an async
      exception.
      
      This patch adds a superclass for all async exceptions:
      
      data SomeAsyncException = forall e . Exception e => SomeAsyncException e
        deriving Typeable
      
      and makes the existing AsyncException and Timeout children of
      SomeAsyncException in the hierarchy.
      756a970e
  16. 27 Oct, 2012 1 commit
    • ian@well-typed.com's avatar
      Remove commented types in module export lists · fda30027
      ian@well-typed.com authored
      These comments are rather less useful now that haddock can give docs
      with the same informatino in the module synopsis.
      
      Having to maintain them when making changes to the library is a pain,
      and when people forget about doing so there is nothing that checks that
      the comments are right, so mistakes tend to linger.
      
      Of the comments that my script detected, 78 of 684 were already
      incorrect in one way or another, e.g. missing context:
          Text.Show.showsPrec
          Comment type: Int -> a -> ShowS
          Actual type:  Show a => Int -> a -> ShowS
      wrong context:
          Numeric.readInt
          Comment type: Integral a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
          Actual type:  Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
      not following a class change (e.g. Num losing its Eq superclass):
          Text.Read.Lex.readOctP
          Comment type: Num a => ReadP a
          Actual type:  (Eq a, Num a) => ReadP a
      not following the Exceptions change:
          GHC.Conc.childHandler
          Comment type: Exception -> IO ()
          Actual type:  SomeException -> IO ()
      or just always been wrong:
          GHC.Stable.deRefStablePtr
          Comment type: StablePtr a -> a
          Actual type:  StablePtr a -> IO a
      fda30027
  17. 25 Oct, 2012 1 commit
  18. 13 Sep, 2012 1 commit
  19. 14 Jun, 2012 1 commit
  20. 27 Apr, 2012 1 commit
  21. 24 Apr, 2012 1 commit
  22. 12 Apr, 2012 1 commit
  23. 19 Dec, 2011 1 commit
  24. 07 Dec, 2011 1 commit
  25. 06 Dec, 2011 1 commit
    • Simon Marlow's avatar
      add setNumCapabilities :: Int -> IO () · 637d7912
      Simon Marlow authored
      {- |
      Set the number of Haskell threads that can run truly simultaneously
      (on separate physical processors) at any given time.
      
      GHC notes: in the current implementation, the value may only be
      /increased/, not decreased, by calling 'setNumCapabilities'.  The
      initial value is given by the @+RTS -N@ flag, and the current value
      may be obtained using 'getNumCapabilities'.
      -}
      637d7912
  26. 25 Oct, 2011 1 commit
  27. 04 Oct, 2011 2 commits
  28. 27 Jul, 2011 1 commit
  29. 24 May, 2011 1 commit
  30. 24 Apr, 2011 1 commit
  31. 30 Mar, 2011 1 commit
    • Simon Marlow's avatar
      Export the affinity API from Control.Concurrent: forkOn and friends. · aec9d3e8
      Simon Marlow authored
      forkOn             :: Int -> IO () -> IO ThreadId
      forkOnWithUnmask   :: Int -> ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
      getNumCapabilities :: IO Int
      threadCapability   :: ThreadId -> IO (Int, Bool)
      
      Following discussion on the libraries list, I renamed forkOnIO to
      forkOn.  In due course we might want to also rename forkIO to fork.
      
      I left the Int argument as it is, it's quite useful to be able to
      specify a number to be interpreted modulo the actual number of
      processors.
      
      I also used the term "capability" consistently.  It might not be the
      best choice, but we have to pick something.
      aec9d3e8
  32. 29 Mar, 2011 1 commit
    • Simon Marlow's avatar
      add forkIOWithUnmask, forkOnIOWithUnmask; deprecate forkIOUnmasked · 54c33b21
      Simon Marlow authored
          
      With forkIOUnmasked it wasn't possible to reliably set up an exception
      handler in the child thread, because exceptions were immediately
      unmasked.
      
      forkIOWithUnmask   ::        ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
      forkOnIOWithUnmask :: Int -> ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
      54c33b21
  33. 01 Mar, 2011 1 commit
    • Simon Marlow's avatar
      add threadCapability :: ThreadId -> IO (Int,Bool) · 06c59e58
      Simon Marlow authored
      -- | returns the number of the capability on which the thread is currently
      -- running, and a boolean indicating whether the thread is locked to
      -- that capability or not.  A thread is locked to a capability if it
      -- was created with @forkOnIO@.
      06c59e58
  34. 22 Dec, 2010 2 commits