>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  Help  User

Jbreak - Interrupt Execution

If J isn't responding you can signal it to interrupt execution. A J task can be signaled by another task called Jbreak. Jconsole is signaled by ctrl+c or Jbreak.

One signal stops execution at the start of the next sentence with an attention interrupt. Two signals stops execution in the middle of a sentence with a break. A signal when a program requests keyboard input (1!:1[1) stops execution with an input interrupt.

Windows install creates JBreak yellow J icon. To signal J, click the JBreak icon.

Mac install creates Jbreak yellow J icon. To signal J, click the Jbreak icon.

Linux install creates jbreak, a shell script, in the J bin folder. Create a shortcut to run jbreak as appropriate for your desktop for easy use. To signal J, run the jbreak shell script.

It is better to use a single signal to get an attention interrupt as the state of execution at the start of a line is clear. In a break it is not clear what has been executed and there is some chance of crash as it is difficult to ensure a clean state in all cases. Wait several seconds before getting impatient and giving the second signal.

Jbreak also signals Jconsole, although it is usually easier to use ctrl+c.

Tech Details

The JE (J Engine) tests a byte in memory for a signal. This byte can be shared with another task with a mapped file. The other task signals J by writing to the mapped byte.

9!:47 sets the name of the break file that is the shared mapping of the byte. 9!:46 returns the name of the break file.

Profile uses break.ijs (open 'break') to set a default break file. JBreak runs Jconsole with sentence break'' to write to all default break files. If you are working with only 1 J task, or if only one task is running then this works fine. However, if you have a running production J task while you are using break with another J task you will break both tasks unless you take specific steps.

If you want a task to not be affected by default break signals then it should use setbreak from break.ijs to give the task a break file with a different suffix. For example:
   setbreak_j_ 'production'
This task will not be affected by the default Jbreak. You can provide an argument to breaker.ijs to signal J tasks with a non default suffix.

>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  Help  User