-
- Downloads
Use message-passing to implement throwTo in the RTS
This replaces some complicated locking schemes with message-passing in the implementation of throwTo. The benefits are - previously it was impossible to guarantee that a throwTo from a thread running on one CPU to a thread running on another CPU would be noticed, and we had to rely on the GC to pick up these forgotten exceptions. This no longer happens. - the locking regime is simpler (though the code is about the same size) - threads can be unblocked from a blocked_exceptions queue without having to traverse the whole queue now. It's a rare case, but replaces an O(n) operation with an O(1). - generally we move in the direction of sharing less between Capabilities (aka HECs), which will become important with other changes we have planned. Also in this patch I replaced several STM-specific closure types with a generic MUT_PRIM closure type, which allowed a lot of code in the GC and other places to go away, hence the line-count reduction. The message-passing changes resulted in about a net zero line-count difference.
Showing
- includes/rts/Constants.h 12 additions, 10 deletionsincludes/rts/Constants.h
- includes/rts/storage/ClosureMacros.h 0 additions, 10 deletionsincludes/rts/storage/ClosureMacros.h
- includes/rts/storage/ClosureTypes.h 9 additions, 13 deletionsincludes/rts/storage/ClosureTypes.h
- includes/rts/storage/Closures.h 24 additions, 1 deletionincludes/rts/storage/Closures.h
- includes/rts/storage/SMPClosureOps.h 19 additions, 7 deletionsincludes/rts/storage/SMPClosureOps.h
- includes/rts/storage/TSO.h 10 additions, 9 deletionsincludes/rts/storage/TSO.h
- includes/stg/MiscClosures.h 4 additions, 2 deletionsincludes/stg/MiscClosures.h
- rts/Capability.c 42 additions, 25 deletionsrts/Capability.c
- rts/Capability.h 23 additions, 5 deletionsrts/Capability.h
- rts/ClosureFlags.c 3 additions, 7 deletionsrts/ClosureFlags.c
- rts/Exception.cmm 19 additions, 24 deletionsrts/Exception.cmm
- rts/FrontPanel.c 1 addition, 1 deletionrts/FrontPanel.c
- rts/HeapStackCheck.cmm 2 additions, 3 deletionsrts/HeapStackCheck.cmm
- rts/LdvProfile.c 1 addition, 1 deletionrts/LdvProfile.c
- rts/PrimOps.cmm 6 additions, 6 deletionsrts/PrimOps.cmm
- rts/Printer.c 8 additions, 10 deletionsrts/Printer.c
- rts/ProfHeap.c 2 additions, 26 deletionsrts/ProfHeap.c
- rts/RaiseAsync.c 273 additions, 239 deletionsrts/RaiseAsync.c
- rts/RaiseAsync.h 7 additions, 10 deletionsrts/RaiseAsync.h
- rts/RetainerProfile.c 3 additions, 3 deletionsrts/RetainerProfile.c
Loading
Please register or sign in to comment