Dixi quod…

>basically we’ll need something that signals us at stathz intervals
>(or profhz), for this to work

We would want to use profhz = 1024 because 128 Hz is too much, still.

On i386, we could do something like this:

volatile sig_atomic_t counter = 0, run = 0;

on proftick do { run ^= 1; };
while (!run)
        /* nothing */;
while (run)
        ++counter;
on proftick do nothing;

This would get us one of the counters; do it twice then
debias VJ as cprng did. But

>(think about adding jytter later)

on a Pentium we can just use the TSC in the tight Jytter loop.


On SPARC, hardclock and statclock come from separate counters,
both of which are on the cache (!) chip though, so our probably
best bet is to just do the tight loop increase dance on hz.

We might also do a CPU “delay” style counter loop with reading
the timer counter before and after; this would, at least, involve
two chips… it counts up to (tick = 1'000'000 / hz), i.e. 10'000
with hz=100.


This is ugly, both of them architectures. Both solutions (the
i386 pseudo-code and the sparc delay style loop) would require
kernel code (and, thus, blocking the kernel, probably splhigh,
for 1/1024 or 1/100 second, respectively, every time). Jytter
doesn’t make use of the system having two sorts of clocks but
instead relies on variations of a tight loop and must be in
user space. Ideally we’d have a combination of both… I need to
figure out how to read the SPARC timer and the i386 MC146818
counter from userspace, I guess (and then use the Jytter idea
on it, modulo needing not-necessarily-constant-time operation).

Just for me to think about…
//mirabilos
-- 
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent

Reply via email to