[previous] [up] [next]     [contents] [index]
Next: Garbage Collection Up: Memory Management Previous: Weak Boxes

Will Executors

A will executor manages a collection of values and associated will procedures. The will procedure for each value is invoked when the value has been proven unreachable -- except through will executors, weak boxes, and custodians -- by the automatic memory manager.

Each will executor e only executes a single will at a time. A will is executed by e

In the latter case, the thread blocks its normal execution as long as e is invoking a will. Note that if two threads have the same will executor, only one thread executes a will at any time, so only one thread blocks during the will executions. When a will is executed via will-executor-try, no threads are blocked except the thread performing the will-executor-try application.

If a value is registered with multiple wills, then the wills are executed in the reverse order in which they were registered. Furthermore, executing a single will procedure makes the value reachable again. The value must be proven unreachable once again before another will is executed for the value.

If the content value of a weak box is registered with a will executor, the weak box's content is not changed to #f until all wills have been executed for the value and the value has been proven unreachable again.


[previous] [up] [next]     [contents] [index]
Next: Garbage Collection Up: Memory Management Previous: Weak Boxes

PLT