Skip to main content

spawn_work_watch

Function spawn_work_watch 

Source
fn spawn_work_watch(
    workspace: Arc<Workspace>,
    slot: SessionSlot,
    first_read: Arc<Notify>,
    nudged: Arc<Notify>,
    stopped: Receiver<()>,
)
Expand description

One seat’s scan loop: the tree is watched, the poke reads it and walks the seat’s process tree and its files, and whatever moved goes to whoever is showing the seat.

The record’s read is the first pass. The subscribe path holds the seat and then encodes its snapshot from the stores, so that read is what the page’s first frame carries; this task waits for its mark, seeds from the stores it left, and announces a value the page does not already hold. The gate keeps the two reads from running together; a pass the tree moved under still reads and announces.

The work scan comes first in every pass. It is the cheapest of the three reads and the row a reader watches, so the process walk and the whole-tree index walk queue behind it rather than delay it.