CPL
Page: (parallel)Top, Next: nonparallel, Prev: (graphics), Up: (cpl)Library

Parallel computing

Page: (parallel)SHARED, Next: PARALLEL, Up: Top

SHARED

Prefix to global variable declarations specifying that the declared variables are to be shared among parallel modules. Variables without this declaration have separate instances for each module, i.e. changing their value produces no effect outside. Example: SHARED ARRAY(0..100) OF REAL vec
Page: (parallel)PARALLEL, Next: synchronization, Prev: SHARED, Up: Top

PARALLEL

Prefix to either (cpl)MODULE or (cpl)LOOP that specifies parallel execution. A PARALLEL MODULE contains a block of code that gets executed in parallel with whatever follows (including possibly a sequence of other modules). Synchronization occurs at the end of the enclosing block: that is, the enclosing block does not end until all intervening modules are completed. A PARALLEL LOOP is a loop all instances of which occur in parallel. Synchronization occurs before the LOOP terminates and the program is allowed to continue.
Page: (parallel)synchronization, Next: tcpserver, Prev: PARALLEL, Up: Top

synchronization

Once parallel processes are running explicit synchronization can be achieved through shared variables. A process can be made to wait for a condition by the instruction SLEEP UNTIL <condition> In order to make all sleeping processes verify their condition and wake up as needed, the process modifying the condition must subsequently execute the command WAKEUP
Page: (parallel)nonparallel, Next: (symbolic), Prev: Top, Up: (cpl)Library

nonparallel.cpl

Fake parallel-computing package that provides void equivalents of the parallel.cpl extensions.