Ticket #3210 (closed feature request: fixed)

Opened 4 years ago

Last modified 18 months ago

Allow programs to change the number of capabilities

Reported by: NeilMitchell Owned by:
Priority: low Milestone: 7.4.1
Component: Compiler Version: 6.10.2
Keywords: Cc: ndmitchell@…, shelarcy@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

It would be useful for a program to choose the number of capabilities it has, perhaps in response to a flag. i.e. I'd like users to type hlint -j3 rather than hlint +RTS -N3.

To support this change one option would be to allow increasing the number of capabilities after a program has started. Another option would be to provide a primitive restartWithCapabilities :: Int -> IO () that aborted the program, and restarted main but with the required settings.

Using RTS flags is unsuitable for people who use Haskell programs but aren't really Haskell developers. As more programs go multi-core, this feature will probably become more desirable. However, it's not too important and can always be solved by a little shell script.

Change History

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12 branch

Changed 3 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 3 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 3 years ago by shelarcy

  • cc shelarcy@… added
  • failure set to None/Unknown

Changed 2 years ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 2 years ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 20 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 18 months ago by simonmar

commit 92e7d6c92fdd14de424524564376d3522f2a40cc

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Tue Dec 6 15:12:07 2011 +0000

    Allow the number of capabilities to be increased at runtime (#3729)
    
    At present the number of capabilities can only be *increased*, not
    decreased.  The latter presents a few more challenges!

 docs/users_guide/using.xml |   14 +++-
 includes/rts/Threads.h     |   10 +++
 rts/Capability.c           |   66 ++++++++++++-----
 rts/Capability.h           |    6 ++-
 rts/Linker.c               |    1 +
 rts/Schedule.c             |  172 ++++++++++++++++++++++++++++++++++++--------
 rts/Stats.c                |    2 +-
 rts/Task.c                 |   28 +++++++
 rts/Task.h                 |    5 ++
 rts/Trace.c                |    7 ++
 rts/Trace.h                |    1 +
 rts/eventlog/EventLog.c    |   27 ++++++--
 rts/eventlog/EventLog.h    |    1 +
 rts/sm/GC.c                |   50 ++++++++-----
 rts/sm/GC.h                |    2 +-
 rts/sm/Storage.c           |   70 +++++++++++--------
 rts/sm/Storage.h           |    4 +
 17 files changed, 358 insertions(+), 108 deletions(-)

Changed 18 months ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

I think we now handle the use case given in this ticket, and we also have #3729 which covers the remaining issues, so I'll close this one.

Note: See TracTickets for help on using tickets.