[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] Support for interruptible Poke programs

From: Jose E. Marchesi
Subject: [COMMITTED] Support for interruptible Poke programs
Date: Fri, 31 Jan 2020 11:24:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi people!

I just pushed support for interrupting Poke programs, based on the work
Luca did in Jitter recently.

(poke) while (1) {}

Below is an excerpt from HACKING:

Signal Handling

When the PVM is about to execute a program, it installs a signal
handler that, at the moment, handles ``SIGINT``.  This signal handler
is defined in the ``late-c`` block in pvm.jitter, and records the
signal in the PVM internal state.

Then, when a ``sync`` instruction is executed, it checks the PVM
internal state and raises a ``PVM_E_SIGNAL`` exception if there is
some pending signal.  The default signal handler just ignores this
signal, but the user can also intercept it if desired.  The PKL
compiler generates ``sync`` instructions in strategic places, such as
before backward jumps in loops.

The ``exit`` PVM instruction clears the pending signals in the
internal PVM state.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]