next up previous contents
Next: Performing Non-Standard I/O Up: Using the Standard User Previous: Adding User Titles   Contents

Replacing the Main Event Loop

EVMAIN is the heart of SNOMAN, for each event EVMAIN executes one cycle of the main event loop. This could be a simple series of processor calls as specified by a $processor_list command or a more complicated event loop program (the programmable event loop is described in section 9).

If you want even more control over the event loop then simply replace EVMAIN. You are now free to call whatever processors you like in whatever order you like, but should still use USER_DEFINE_TASK to request them. It is also necessary to disable the processor sequence (whether it is given by the variable cuser_pro_seq, an event loop program, or the JOBP bank) because the processors given in the sequence would get initialised. This can be achieved by setting the ignore_pro_seq flag in USER_DEFINE_TASK. This has the additional effect of making the JOB bank optional, although it is safer to provide it, unless replacing, or not using, the software units that rely on it.

It should be noted that QNEXT calls EVMAIN a maximum number of times as specified by the event limit given in the JOB titles bank and, on return from EVMAIN, wipes the memory ready for the next event. If the concept of an event loop is not appropriate, then just treat EVMAIN as the top level execution routine and don't return at all. Instead, call ZEND when ready to terminate. One word of warning: ZTELL errors that force execution onto the ``next event '' will result in EVMAIN being called again. This can be detected by examining the variable NEV of the common /PCQNEX/ (see QNEXT).


next up previous contents
Next: Performing Non-Standard I/O Up: Using the Standard User Previous: Adding User Titles   Contents
sno Guest Acct 2009-09-09