I'm getting hopelessly confused by some code that has multiple
layers of critical timing stuff going on (or will have by the time
I'm finished). My mind gave up and drifted onto some electronics
philosophy:
Code being executed by a processor is actually equivalent to a
gear. The CPU's clock oscillator advances it one instruction (tooth
of a gear) per instruction cycle, similar to a mechanical clock
escapement. The more instructions (teeth), the larger the effective
size of the gear, and the slower the whole thing is to run. If
that's too slow, you turn the gear faster, billions of 'teeth' a
second as necessary, to keep any absurdly-sized gear turning fast
enough. Then you have today's multi-GHz processors turning the many
millions of teeth that each modern program has, at a speed that's
still acceptable.
Then at certain points in its rotation, the main processor (gear)
can engage other processors which are in effect smaller gears
spinning faster to execute shorter programs in parallel.
Maybe this isn't anything particularly insightful, but there is an
underlying truth to it because the oscillator (likely using a
quartz crystal) that's the root source of a fast processor's clock
signal, is by necessity technically mechanical (the quartz vibrates
to generate the alternating signal). It increments (turns) the
instruction counter, which thereby advances through the program.
Every other mechanism of this electronic gearbox is abstract and
motionless, but it's all still turned by a mechanical oscillator,
like a gearbox connected to a steam engine centuries ago.
More thoughts:
What's the electronic equivalent to a windmill? An analogue
computer, advanced by the flow of signals rising and falling over
time?
What mechanism would a quantum computer be equivalent to? A
compass, driven by physical interactions within an environment that
assigns them meaning?
How about a tree though? What sort of computer could you design
based on that?