Pipes

An extension to TO variables has been added to the TLM. These are byte pipes, or byte oriented First In First Out, FIFO, structures. These are particularly useful when using tasks, refer to the demo. These pipes may be up to 256 bytes long and are used as TO variables. Values sent TO the pipe are placed in the next available byte. If the pipe is full the task is PAUSEd until the pipe is free. If a task tries to take a byte from an empty pipe, the task is PAUSEd until there is a byte to take.

If a pipe only links two tasks there is no need for a semaphore. Only if more that one task takes or puts data into a pipe is the semaphore required.

To define a pipe use:

10 BYTE-PIPE <name> <cr>

Before a pipe may be used it must be initialised. The size of the pipe and it's address in the variable space are saved when it is defined. To initialise it the address of the definition is required. A ', or ['] if in a colon definition, will provide the address for INIT-PIPE.

 Use: ' <name> INIT-PIPE <cr>

  or ['] <name> INIT-PIPE within a definition

Contents