This prepares for fitting the revised Pack.c of packman into the
parallel GHC runtime system. The module should not export any
functions without need, and prefix all exported ones with "pm".
Exported:
int pmtryPackToBuffer(StgClosure* closure, StgArrWords* mutArr);
StgClosure* pmUnpackGraphWrapper(StgArrWords* packBufferArray, Capability* cap);
A number of threads serialize the same data, while the test function
accesses the original in different ways (prone to blackholing).
Test runs with 10 threads by default, which is enough to trigger
some blackhole exceptions (the duplicate function will retry).
Old code was wasting a lot of space by packing tags for stack values
to indicate their pointer-hood. Instead, the new version packs the
original bitmap and uses it for unpacking.
The bitmap is actually present at the receiver side, but as part of
the function info table - the function arrives later so it cannot be
used from there.
There is code for the large bitmap case, but it is not activated yet.
Old code was wasting a lot of space by packing tags for stack values
to indicate their pointer-hood. Instead, the new version packs the
original bitmap and uses it for unpacking.
The bitmap is actually present at the receiver side, but as part of
the function info table - the function arrives later so it cannot be
used from there.
There is code for the large bitmap case, but it is not activated yet.
Pack.c should now be thread-safe for unpacking and packing,
as its functions pass around an explicitly allocated state.
changes should eventually go back into the RTS code (but we
need to see the performance first).
The PAP case has not been rewritten yet, it should be revised
to pack the bitmap instead of tagging the packed stack elements.