[Haskell-cafe] Simple question about blackholing

Kei Davis kei at lanl.gov
Wed Sep 16 17:37:19 UTC 2015


I suppose things could have changed since 2005, but taking "Haskell on a 
Shared-Memory Multiprocessor" (Harris, Marlow, Peyton Jones 2005) as the 
reference point, the figure in section 3.3 makes clear that a thunk's 
payload (free variables) remains valid until update with an indirection.

The paper is also clear that there is only one header word, i.e., that a 
copy of the original header word isn't stashed in the header and that 
this header word is replaced with a blackhole (code pointer or info 
pointer).  They do not state outright that such a copy isn't stashed in 
the payload together with the free variables, but if that were the case 
it would seem an odd omission given the level of detail otherwise.


On 09/16/2015 10:48 AM, Jan-Willem Maessen wrote:
> I *believe* the answer is "Black holing happens as / after the thunk
> contents are copied to the stack, so the contents of the thunk are now
> dead and the data is live on a stack somewhere."
> -Jan

Kei Davis
Applied Computer Science Group CCS-7, Mail Stop B287
Los Alamos National Laboratory
Los Alamos, NM 87545, U.S.A.

More information about the Haskell-Cafe mailing list