This is the jpl-queues Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:31:22 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
jpl-queues
A few different kinds of queues, with optional multithreading synchronization.
J.P. Larocque
J.P. Larocque
ISC-style permissive
0.1
bordeaux-threads
(system).
jpl-util
(system)., at least version "0.2"
interface.lisp
(file).
bounded-fifo.lisp
(file).
lossy-bounded-fifo.lisp
(file).
unbounded-fifo.lisp
(file).
unbounded-random.lisp
(file).
synchronized.lisp
(file).
package.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
jpl-queues/jpl-queues.asd
jpl-queues/interface.lisp
jpl-queues/bounded-fifo.lisp
jpl-queues/lossy-bounded-fifo.lisp
jpl-queues/unbounded-fifo.lisp
jpl-queues/unbounded-random.lisp
jpl-queues/synchronized.lisp
jpl-queues/package.lisp
jpl-queues/interface.lisp
package.lisp
(file).
jpl-queues
(system).
capacity
(generic function).
dequeue
(generic function).
dequeue-object
(generic function).
dequeue-object-if
(generic function).
empty?
(generic function).
enqueue
(generic function).
full?
(generic function).
queue
(class).
size
(generic function).
jpl-queues/bounded-fifo.lisp
interface.lisp
(file).
package.lisp
(file).
jpl-queues
(system).
bounded-fifo-queue
(class).
capacity
(method).
dequeue
(method).
dequeue-object-if
(method).
enqueue
(method).
initialize-instance
(method).
print-object
(method).
size
(reader method).
test-bounded-fifo-queue-dequeue-object-if
(function).
jpl-queues/lossy-bounded-fifo.lisp
bounded-fifo.lisp
(file).
interface.lisp
(file).
package.lisp
(file).
jpl-queues
(system).
enqueue
(method).
full?
(method).
lossy-bounded-fifo-queue
(class).
jpl-queues/unbounded-fifo.lisp
interface.lisp
(file).
package.lisp
(file).
jpl-queues
(system).
capacity
(method).
dequeue
(method).
dequeue-object-if
(method).
enqueue
(method).
size
(reader method).
unbounded-fifo-queue
(class).
buffer
(reader method).
jpl-queues/unbounded-random.lisp
interface.lisp
(file).
package.lisp
(file).
jpl-queues
(system).
capacity
(method).
dequeue
(method).
dequeue-object-if
(method).
enqueue
(method).
initialize-instance
(method).
size
(method).
unbounded-random-queue
(class).
jpl-queues/synchronized.lisp
interface.lisp
(file).
package.lisp
(file).
jpl-queues
(system).
capacity
(method).
dequeue
(method).
dequeue-object
(method).
dequeue-object-if
(method).
empty?
(method).
enqueue
(method).
full?
(method).
print-object
(method).
size
(method).
synchronized-queue
(class).
Packages are listed by definition order.
jpl-queues
common-lisp
.
bounded-fifo-queue
(class).
capacity
(generic function).
dequeue
(generic function).
dequeue-object
(generic function).
dequeue-object-if
(generic function).
empty?
(generic function).
enqueue
(generic function).
full?
(generic function).
lossy-bounded-fifo-queue
(class).
queue
(class).
size
(generic function).
synchronized-queue
(class).
unbounded-fifo-queue
(class).
unbounded-random-queue
(class).
buffer
(generic reader).
test-bounded-fifo-queue-dequeue-object-if
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Returns the number of elements that can be stored
at once in the given QUEUE, or NIL if there is no limit.
Most implementations will take constant time.
synchronized-queue
)) ¶unbounded-random-queue
)) ¶unbounded-fifo-queue
)) ¶bounded-fifo-queue
)) ¶Removes an element from QUEUE, returning the
element.
After this function returns, FULL? must return false.
It is the caller’s responsibility to determine whether QUEUE has an
element available for reading. The consequences are undefined if it
doesn’t.
Most implementations will take constant time.
synchronized-queue
)) ¶unbounded-random-queue
)) ¶unbounded-fifo-queue
)) ¶bounded-fifo-queue
)) ¶Prematurely dequeues OBJECT from QUEUE.
TEST is a function of two arguments that is used to compare OBJECT
with the result of KEY applied to each enqueued element. When TEST
returns true, the element is deleted. Zero or more elements may be
matched and removed.
If anything was actually removed, FULL? must return false.
Most implementations will have the same time complexity as DELETE-OBJECT-IF.
synchronized-queue
) &key test key) ¶Prematurely dequeues elements from QUEUE that
PREDICATE returns true for.
PREDICATE is called with the result of KEY applied to each enqueued
element. When PREDICATE returns true, the element is deleted. Zero
or more elements may be matched and removed.
If anything was actually removed, FULL? must return false.
Most implementations will take time in linear proportion to the number of enqueued elements.
synchronized-queue
) &key key) ¶unbounded-random-queue
) &key key) ¶unbounded-fifo-queue
) &key key) ¶bounded-fifo-queue
) &key key) ¶Returns a boolean indicating whether the given
QUEUE cannot have any more elements dequeued from it. When this
function returns false, it is safe to call DEQUEUE.
Most implementations will take constant time.
synchronized-queue
)) ¶Writes OBJECT to QUEUE.
After this function returns, EMPTY? must return false.
It is the caller’s responsibility to determine whether QUEUE has room for another element. The consequences are undefined if it doesn’t.
Most implementations will take constant time.
synchronized-queue
)) ¶unbounded-random-queue
)) ¶unbounded-fifo-queue
)) ¶lossy-bounded-fifo-queue
)) ¶bounded-fifo-queue
)) ¶Returns a boolean indicating whether the given
QUEUE cannot have any more elements enqueued to it. When this
function returns false, it is safe to call ENQUEUE.
This is subtly different than saying its SIZE is equal to its CAPACITY: a lossy queue may have a capacity, and it may be "full" in that sense, but it will still accept new elements to be enqueued.
Most implementations will take constant time.
synchronized-queue
)) ¶lossy-bounded-fifo-queue
)) ¶Returns the number of elements stored in QUEUE.
Most implementations will take constant time.
synchronized-queue
)) ¶unbounded-random-queue
)) ¶unbounded-fifo-queue
)) ¶The number of elements in BUFFER.
size
.
bounded-fifo-queue
)) ¶The number of elements queued in BUFFER.
size
.
bounded-fifo-queue
) &key capacity &allow-other-keys) ¶unbounded-random-queue
) &key capacity &allow-other-keys) ¶synchronized-queue
) stream) ¶bounded-fifo-queue
) stream) ¶A bounded FIFO queue. The queue capacity (a
positive integer less than ARRAY-DIMENSION-LIMIT) must be specified
with the :CAPACITY keyword parameter.
Space usage is constant after instantiation, in proportion to the capacity. Conses little, if at all, for any operation.
A ring buffer of elements, oldest first, that have yet to be read.
vector
The number of elements queued in BUFFER.
jpl-util:array-dimension
0
size
.
This slot is read-only.
The index into BUFFER of its oldest element.
jpl-util:array-index
0
A bounded FIFO queue that throws away old entries
when ENQUEUE is called and the queue is full. A queue capacity (a
positive integer less than ARRAY-DIMENSION-LIMIT) must be specified
with the :CAPACITY keyword parameter.
Space usage is constant after instantiation, in proportion to the capacity. Conses little, if at all, for any operation.
Abstract class for queues.
Unless noted otherwise, subclasses do no synchronization. It is the
client’s responsibility to ensure no two operations occur
simultaneously.
The usual time complexity for each operation is documented in the generic function for the operation. Per-method exceptions should be documented.
Wraps another QUEUE (given by the :QUEUE keyword
parameter), synchronizing operations for safe multithreaded access.
After instantiating this queue, the wrapped QUEUE must not be directly
used for the duration of this queue.
When ENQUEUE is called on this QUEUE and the wrapped QUEUE is full,
blocks until it is no longer full. When DEQUEUE is called on this
QUEUE and the wrapped QUEUE is empty, blocks until it is no longer
empty. This blocking also ensures that the internal state of the
wrapped QUEUE won’t become corrupt by calling DEQUEUE when empty or
ENQUEUE when full.
Operations that should return no useful value will return no values.
The time and space complexity for this queue and all its operations are equal to those of the wrapped QUEUE, plus any locking overhead imposed by the system, except that ENQUEUE and DEQUEUE may block indefinitely.
The wrapped QUEUE for which operations are synchronized.
jpl-queues:queue
(error "must specify :queue.")
:queue
The LOCK which must be held during each operation.
(bordeaux-threads:make-lock)
Condition variable that is notified each time an element has been enqueued.
(bordeaux-threads:make-condition-variable)
Condition variable that is notified each time an element has been dequeued.
(bordeaux-threads:make-condition-variable)
An unbounded FIFO queue.
Space usage is proportional to the number of queued elements at any given point in time. Conses for each enqueued element.
A list of elements, oldest first, that have
yet to be read.
The cells of the list do not share structure with anything outside the queue.
list
(quote nil)
This slot is read-only.
The last cons cell of BUFFER, or NIL if BUFFER is empty.
(or cons null)
A virtually unbounded, random-order
queue. (Strictly speaking, the queue size is limited by
ARRAY-DIMENSION-LIMIT.)
Space usage is proportional to the peak number of queued elements over the lifetime of the queue. An initial queue capacity (a positive integer less than ARRAY-DIMENSION-LIMIT) may optionally be specified with the :CAPACITY keyword parameter; the capacity will be grown as required. Conses for an enqueued element only when the current queue capacity is reached and needs to be extended.
A buffer of elements, in unspecified order, that have yet to be read.
vector
unbounded-fifo-queue
)) ¶A list of elements, oldest first, that have
yet to be read.
The cells of the list do not share structure with anything outside the queue.
Jump to: | B C D E F G I M P S T |
---|
Jump to: | B C D E F G I M P S T |
---|
Jump to: | B D E L Q S |
---|
Jump to: | B D E L Q S |
---|
Jump to: | B C F I J L P Q S U |
---|
Jump to: | B C F I J L P Q S U |
---|