[pypy-dev] A question about RPython's JIT in scheduler
Armin Rigo
arigo at tunes.org
Thu Feb 5 17:02:27 CET 2015
Hi,
For future reference: we discussed this question on IRC yesterday, Feb
4th (see logs). Let me repeat here the main answer: the JIT works
well because you're using a scheme where some counter is decremented
(and the soft-thread interrupted when it reaches zero) only once in
each app-level loop. The soft-thread switch is done by returning to
some scheduler, which will resume a different soft-thread by calling
it. It means the JIT can still compile each of the loops as usual,
with the generated machine code containing the
decrease-and-check-for-zero operation which, when true, exits the
assembler.
A bientôt,
Armin.
More information about the pypy-dev
mailing list