From b8e6a2e5b8fc64ec47adfbe583b8a27200cc5a2e Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 19 Oct 2026 09:58:47 +0100 Subject: The modules an app ran are freed (research 115's next step): every app's module a Loaded with holds (each snapshot of it, each request read with it); one replaced is retired and freed on the apps thread once no app runs it, every connection thread has begun a pass since (woken for it), and nothing holds it; who keeps a module to ask later whether it is the same asks its serial (core: PureModule.serial, a reader's module_serial, pure_snapshot_module, pure_snapshot_release says it freed; serve: routes, groups, links, bindings, queries, the published snapshot), as an address may come back; a link binds under its receiver's lock, a link naming an input under binding_lock; 030's memory.py: 4,000 changes 0 bytes a change (was 19,284), 4,100 freed; stress.py: readers, view workers, push streams and a body across changes, 586 of 600 loads at a freed module's address, every answer right, ASan 1,000 changes clean; a push group that looked while its app resumed missed the new snapshot (published before the app took requests) and waited for its next save: woken again once it takes them (server_view_workers had failed once under load) --- .../experiments/030-app-lifecycle/items-body.aup | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 research/experiments/030-app-lifecycle/items-body.aup (limited to 'research/experiments/030-app-lifecycle/items-body.aup') diff --git a/research/experiments/030-app-lifecycle/items-body.aup b/research/experiments/030-app-lifecycle/items-body.aup new file mode 100644 index 0000000..dcb5477 --- /dev/null +++ b/research/experiments/030-app-lifecycle/items-body.aup @@ -0,0 +1,43 @@ +record Pick { + n = 0 +} +record Item { + n = 0 +} +state items: list of Item +state more: list of Item +state hits = 0 +input seed = message { n: number } +input grow = message { step: number } +input add = message { step: number } +on seed { + items.append(Item { n: seed.n }) +} +on grow { + for i in items { + more.append(Item { n: i.n + grow.step }) + } + for m in more { + items.append(Item { n: m.n }) + } + for m in more { + more.remove(m) + } +} +on add { + hits = hits + add.step +} +view count = count(i in items where i.n > 0) +view total = hits +view summed { + let t = 0 + for i in items { t = t + i.n } + return t +} +view picked { + let ps: list of Pick + for i in items { + if i.n > 9 { ps.append(Pick { n: i.n }) } + } + return ps.count +} -- cgit v1.2.3