PreviousNext
Help > PARALLEL PROCESSES
PARALLEL PROCESSES

Rittle offers multitasking at ground level. The RVM takes care of background work while from programmer’s perspective the functionality is contained within only two reserved words – “pproc” and “ppterm”.

In an example:

 

func task1;

    ……. Something to do here …….

endfunc;

 

pproc task1;             ’ run task1 as a parallel process

    ……. Main body continues here while task1 now works in parallel …….

 

As it can be seen, parallel processes are normal functions (which can still be executed as such). The word “pproc” creates a separate time-sharing process in which the function with name following “pproc” runs. Once the corresponding “endfunc” is reached, the parallel process terminates just like a normal function exit. A function running as parallel process can still execute any other function (including itself), as well as contain nested functions. It can also start other parallel processes.

A parallel process can terminate itself in the standard ways to end a function. It is also possible the process to be terminated from the main program body (only) by using the word “ppterm” followed by the name of the process’ entry function as specified in “pproc”. An attempt to terminate a process from within another process will cause the program to exit with an error message.

NOTE: The main program body has priority over all other parallel processes. Once the main body finishes execution, all other parallel processes are also automatically terminated.