#3729: Allow modification of capabilities at runtime
-------------------------------+--------------------------------------------
  Reporter:  mlesniak          |          Owner:                  
      Type:  task              |         Status:  closed          
  Priority:  normal            |      Milestone:  7.6.1           
 Component:  Runtime System    |        Version:  6.13            
Resolution:  fixed             |       Keywords:  capabilities    
        Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown      |     Difficulty:  Unknown         
  Testcase:                    |      Blockedby:                  
  Blocking:                    |        Related:                  
-------------------------------+--------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => fixed
  * milestone:  7.4.1 => 7.6.1


Comment:

 commit 9bae79159d3cb5cbb6491711341aa9b07d703ae6
 {{{
 Author: Simon Marlow <[email protected]>
 Date:   Tue Dec 13 13:09:46 2011 +0000

     Support for reducing the number of Capabilities with
 setNumCapabilities

     This patch allows setNumCapabilities to /reduce/ the number of active
     capabilities as well as increase it.  This is particularly tricky to
     do, because a Capability is a large data structure and ties into the
     rest of the system in many ways.  Trying to clean it all up would be
     extremely error prone.

     So instead, the solution is to mark the extra capabilities as
     "disabled".  This has the following consequences:

       - threads on a disabled capability are migrated away by the
         scheduler loop

       - disabled capabilities do not participate in GC
         (see scheduleDoGC())

       - No spark threads are created on this capability
         (see scheduleActivateSpark())

       - We do not attempt to migrate threads *to* a disabled
         capability (see schedulePushWork()).

     So a disabled capability should do no work, and does not participate
     in GC, although it remains alive in other respects.  For example, a
     blocked thread might wake up on a disabled capability, and it will get
     quickly migrated to a live capability.  A disabled capability can
     still initiate GC if necessary.  Indeed, it turns out to be hard to
     migrate bound threads, so we wait until the next GC to do this (see
     comments for details).
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3729#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to