Common Lisp Package: LPARALLEL.QUEUE

Blocking FIFO queue for communication between threads.

README:

FUNCTION

Public

MAKE-QUEUE (&REST ARGS)

Create a queue. The queue contents may be initialized with the keyword argument `initial-contents'. By default there is no limit on the queue capacity. Passing a `fixed-capacity' keyword argument limits the capacity to the value passed. `push-queue' will block for a full fixed-capacity queue.

PEEK-QUEUE (QUEUE)

If `queue' is non-empty, return (values element t) where `element' is the frontmost element of `queue'. If `queue' is empty, return (values nil nil).

PEEK-QUEUE/NO-LOCK (QUEUE)

Like `peek-queue' but does not acquire the lock. Use inside `with-locked-queue'.

POP-QUEUE (QUEUE)

Remove the frontmost element from `queue' and return it. If `queue' is empty, block until an element is available.

POP-QUEUE/NO-LOCK (QUEUE)

Like `pop-queue' but does not acquire the lock. Use inside `with-locked-queue'.

PUSH-QUEUE (OBJECT QUEUE)

Push `object' onto the back of `queue'.

PUSH-QUEUE/NO-LOCK (OBJECT QUEUE)

Like `push-queue' but does not acquire the lock. Use inside `with-locked-queue'.

QUEUE-COUNT (QUEUE)

Return the number of elements in `queue'.

QUEUE-COUNT/NO-LOCK (QUEUE)

Like `queue-count' but does not acquire the lock. Use inside `with-locked-queue'.

QUEUE-EMPTY-P (QUEUE)

Return true if `queue' is empty, otherwise return false.

QUEUE-EMPTY-P/NO-LOCK (QUEUE)

Like `queue-empty-p' but does not acquire the lock. Use inside `with-locked-queue'.

QUEUE-FULL-P (QUEUE)

Return true if `queue' is full, otherwise return false.

QUEUE-FULL-P/NO-LOCK (QUEUE)

Like `queue-full-p' but does not acquire the lock. Use inside `with-locked-queue'.

TRY-POP-QUEUE (QUEUE)

Non-blocking version of `pop-queue'. If `queue' is non-empty, remove the frontmost element from `queue' and return (values element t) where `element' is the element removed. If `queue' is empty, return (values nil nil).

TRY-POP-QUEUE/NO-LOCK (QUEUE)

Like `try-pop-queue' but does not acquire the lock. Use inside `with-locked-queue'.

Private

Undocumented

%MAKE-QUEUE (&KEY FIXED-CAPACITY INITIAL-CONTENTS)

CALL-WITH-LOCKED-CONS-QUEUE (FN QUEUE)

CALL-WITH-LOCKED-QUEUE (FN QUEUE)

CALL-WITH-LOCKED-VECTOR-QUEUE (FN QUEUE)

CONS-QUEUE-FULL-P (QUEUE)

CONS-QUEUE-FULL-P/NO-LOCK (QUEUE)

SIMPLE-STYLE-WARNING (MESSAGE &REST ARGS)

MACRO

Public

WITH-LOCKED-QUEUE (QUEUE &BODY BODY)

Execute `body' with the queue lock held. Use the `/no-lock' functions inside `body'.

Private

Undocumented

DEFINE-QUEUE-FN (NAME PARAMS CONS-NAME VECTOR-NAME)

CONDITION

Private

Undocumented

SIMPLE-STYLE-WARNING (MESSAGE &REST ARGS)