Idea for capabilities

After looking at the source code in Capabilities.c I think a rudimentary implementation to add dynamic capabilities can work like this:

  1. Wait, until it is safe to change the capabilities structure.
  2. Allocate memory for number_of_capabilities + 1
  3. Copy old capabilities structure to new allocated one
  4. Relink to new memory location

To be honest, I don’t think it’s so easy; but at least this is a starting point I can use. Currently, I have to things to think about and which have to be solved before I can hack around in the code:

  1. How can I call C code in the RTS from Haskell?
  2. When is it safe to modify the capabilities structure?

Happy for any suggestions,
Michael

Leave a Reply