Skip to content
Snippets Groups Projects
Commit eb3c130e authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

new documenation

Rev: doc/precompiled/fifo:1.1
Rev: doc/precompiled/queue:1.1
parent a2b7251b
No related branches found
No related tags found
No related merge requests found
NAME
/precompiled/fifo - first in, first out object
DESCRIPTION
/precompiled/fifo implements a fixed length fifo. A fifo is a queue
of values and is often used as a stream of data between two threads.
SEE ALSO
/precompiled/queue
NOTA BENE
Fifos are only available on systems with POSIX threads support.
============================================================================
NAME
create - initialize the fifo
SYNTAX
#include <fifo.h>
void fifo->create(int size);
or
clone(Fifo);
or
clone(Fifo,size);
DESCRIPTION
The function create() is called when the fifo is cloned, if the
optional size argument is present it sets how many values can be
written to the fifo without blocking. The default size is 128.
============================================================================
NAME
write - queue a value
SYNTAX
#include <fifo.h>
void fifo->write(mixed value);
DESCRIPTION
This function puts a value last in the fifo. If there is no more
room in the fifo the current thread will sleep until space is
available.
============================================================================
NAME
read - read a value from the fifo
SYNTAX
#include <fifo.h>
mixed fifo->read();
DESCRIPTION
This function retreives a value from the fifo. Values will be
returned in the order they were written. If there are no values
present in the fifo the current thread will sleep until some other
thread writes a value to the fifo.
============================================================================
NAME
size - return number of values in fifo
SYNTAX
#include <fifo.h>
int fifo->size();
DESCRIPTION
This function returns how many values are currently in the fifo.
============================================================================
NAME
/precompiled/queue - a queue of values
DESCRIPTION
/precompiled/queue implements a queue, or fifo. The main differance
between /precompiled/queue and /precompiled/fifo is that queues
will never block in write, only allocate more memory.
SEE ALSO
/precompiled/fifo
NOTA BENE
Queues are only available on systems with POSIX threads support.
============================================================================
NAME
write - queue a value
SYNTAX
#include <fifo.h>
void queue->write(mixed value);
DESCRIPTION
This function puts a value last in the queue. If the queue is
to small to hold the value the queue will be expanded to make
room for it.
============================================================================
NAME
read - read a value from the queue
SYNTAX
#include <fifo.h>
mixed queue->read();
DESCRIPTION
This function retreives a value from the queue. Values will be
returned in the order they were written. If there are no values
present in the queue the current thread will sleep until some other
thread writes a value to the queue.
============================================================================
NAME
size - return number of values in queue
SYNTAX
#include <fifo.h>
int queue->size();
DESCRIPTION
This function returns how many values are currently in the queue.
============================================================================
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment