<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pure/tests/clock-back.c, branch master</title>
<subtitle>Verified execution runtime unifying state, persistence, and replication.
</subtitle>
<id>http://git.yeowoo.org/pure/atom?h=master</id>
<link rel='self' href='http://git.yeowoo.org/pure/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.yeowoo.org/pure/'/>
<updated>2026-09-30T02:17:59Z</updated>
<entry>
<title>Wait on the monotonic clock everywhere a deadline is waited for</title>
<updated>2026-09-30T02:17:59Z</updated>
<author>
<name>eunhhu</name>
<email>necpition205@gmail.com</email>
</author>
<published>2026-09-30T02:17:59Z</published>
<link rel='alternate' type='text/html' href='http://git.yeowoo.org/pure/commit/?id=385754c2d00ba3f4c74a22f55d4756e101f215b1'/>
<id>urn:sha1:385754c2d00ba3f4c74a22f55d4756e101f215b1</id>
<content type='text'>
Review 004's timer fix (103) counted the deadlines on the monotonic
clock, but the owner still slept until a wall-clock time: with the
clock set back an hour a node's timers would stop for that hour. So
would a wire's pause between tries, and a lone commit after a group
would wait an hour for the others to join it. The test's LD_PRELOAD
moves only what the process reads, so there each wait ended at once
instead, and the timers went on ticking while the owner spun a core.

core/wait.h makes conditions that wait on the monotonic clock
(pthread_condattr_setclock; macOS keeps the wall clock) and deadlines
on it. The owner's waits, the wire's pauses and the group commit's
gathering use them.

clock-back.so can now move the clock forward too (CLOCK_SHIFT_S), and
check.py server_clocks moves it an hour each way under a node with a
timer and a wire to a port no one listens on, and under a document
server whose three threads commit together, then one alone. Before:
back, 159 % CPU and 50,886 tries in 1.2 s; forward, 1 tick, 1 try, and
a lone commit that never ended. After: 59 ticks, 0 % CPU, 4 tries and a
lone commit of 2.6 ms, both ways.
</content>
</entry>
<entry>
<title>Tick a stateless app's timers, and wait for them on the monotonic clock</title>
<updated>2026-09-29T17:04:43Z</updated>
<author>
<name>eunhhu</name>
<email>necpition205@gmail.com</email>
</author>
<published>2026-09-29T17:04:24Z</published>
<link rel='alternate' type='text/html' href='http://git.yeowoo.org/pure/commit/?id=8fe9ce66573be53ff56fe2a8afc693dabeae9585'/>
<id>urn:sha1:8fe9ce66573be53ff56fe2a8afc693dabeae9585</id>
<content type='text'>
run_timers ticked nothing in an app without states, taking a timer to
be able to change nothing else; but a tick may send, and the outbox is
the app's state (the host gives such an app an owner for it). A timer
that only sends never ticked (review 004, F4). Now an app ticks when it
has states or outputs; one with neither runs on every connection thread
and has nothing a tick could do.

When a timer is due was reckoned on the wall clock: set back, a timer
waited for the time it had reached again (review 004, an earlier P2).
The next tick is now reckoned on the monotonic clock; events still see
the wall clock (now).

check.py's server_timers runs the review's heartbeat (a timer, an
output, no state) and sees it tick, then again with the wall clock set
back an hour 0.2 s in (build/clock-back.so, an LD_PRELOAD of
clock_gettime): 29 ticks in 0.6 s, where the server before this stops at
9.
</content>
</entry>
</feed>
