Re: Question about indirectees of BLACKHOLE closures

2018-03-29 Thread Ömer Sinan Ağacan
I still don't understand the whole story with blackholes but I'll update the comments around the BLACKHOLE stack frame and/or wiki pages once I get a better understanding. Ömer 2018-03-26 21:47 GMT+03:00 Ben Gamari : > Simon Marlow writes: > >> The

Re: Question about indirectees of BLACKHOLE closures

2018-03-26 Thread Ben Gamari
Simon Marlow writes: > The raise closure is declared to be a THUNK: > > https://phabricator.haskell.org/diffusion/GHC/browse/master/rts/Exception.cmm;60e29dc2611f5c1a01cfd9a870841927847a7b74$424 > > Another example of this is when an asynchronous exception is thrown, and we >

Re: Question about indirectees of BLACKHOLE closures

2018-03-26 Thread Simon Marlow
The raise closure is declared to be a THUNK: https://phabricator.haskell.org/diffusion/GHC/browse/master/rts/Exception.cmm;60e29dc2611f5c1a01cfd9a870841927847a7b74$424 Another example of this is when an asynchronous exception is thrown, and we update all the thunks/BLACKHOLEs pointed to by the

Re: Question about indirectees of BLACKHOLE closures

2018-03-24 Thread Brandon Allbery
I think I can at least answer the why: we're talking about threads referring to suspended computations within a thread whose stack is being "unwound". Those computations won't be resumable after the unwind (which makes their context go away). So they have to be overwritten with something to cause

Re: Question about indirectees of BLACKHOLE closures

2018-03-23 Thread Rahul Muttineni
Hi Omer, As per my understanding, a BLACKHOLE can point to a THUNK when an exception is thrown. An exception walks up the stack and overwrites the blackholes pointed to by the update frames as it walks with an stg_raise closure. That way, if any concurrent thread happens to evaluate a thunk that

Re: Question about indirectees of BLACKHOLE closures

2018-03-23 Thread Ömer Sinan Ağacan
Thanks Simon, that's really helpful. A few more questions: As far as I understand the difference between - BLACKHOLE pointing to a TSO - BLACKHOLE pointing to a BLOCKING_QUEUE is that in the former we don't yet have any threads blocked by the BLACKHOLE whereas in the latter we have and the

Re: Question about indirectees of BLACKHOLE closures

2018-03-20 Thread Simon Marlow
Added comments: https://phabricator.haskell.org/D4517 On 20 March 2018 at 14:58, Simon Marlow wrote: > Hi Omer, > > On 20 March 2018 at 13:05, Ömer Sinan Ağacan wrote: > >> Hi, >> >> I've been looking at BLACKHOLE closures and how the indirectee field

Re: Question about indirectees of BLACKHOLE closures

2018-03-20 Thread Simon Marlow
Hi Omer, On 20 March 2018 at 13:05, Ömer Sinan Ağacan wrote: > Hi, > > I've been looking at BLACKHOLE closures and how the indirectee field is > used > and I have a few questions: > > Looking at evacuate for BLACKHOLE closures: > > case BLACKHOLE: > { >

Question about indirectees of BLACKHOLE closures

2018-03-20 Thread Ömer Sinan Ağacan
Hi, I've been looking at BLACKHOLE closures and how the indirectee field is used and I have a few questions: Looking at evacuate for BLACKHOLE closures: case BLACKHOLE: { StgClosure *r; const StgInfoTable *i; r = ((StgInd*)q)->indirectee; if