Open
Description
An issue to keep track of API discussion
Standard must-haves
-
proc Queue(type eltType)
- an optional size argument?
- some param/const flags?
- an optional "targetLocales"?
-
proc enqueue(elt :eltType)
- possibly a vararg implementation
-
proc dequeue(): (bool, eltType)
-
proc clear()
-
proc length
-
proc size (equivalent to length)
-
proc isEmtpy
Some brainstorming:
Utilities:
-
iter these()
- Most likely the whole 4 iterators: sequential, leader, follower,
standalone
- Most likely the whole 4 iterators: sequential, leader, follower,
-
proc copy() -- or clone, something for deep-copy
Handling asynchrony:
- proc sync()
- proc asyncEnqueue(elt :eltType)
- proc asyncDequeue(elt :eltType): (bool, eltType)
- Maybe you can allow both synchronous and asynchronous operations to
the queue? Then you'd need something like these. If the queue
doesn't allow asynchrony due to some configuration parameters
(likely params), you can throw a compiler warning in these functions
and fallback to regular enqueue/dequeue
- Maybe you can allow both synchronous and asynchronous operations to
Bulk operations:
-
proc enqueueBulk(elt: [] eltType)
-
proc dequeueBulk(numElems): (bool, [] eltType)
-
proc concat(otherQueue)
- Obviously the same thing as enqueueBulk, you can pick one or have
both signatures available
- Obviously the same thing as enqueueBulk, you can pick one or have
-
proc +=(q: Queue, elts)
-
proc +=(q: Queue, otherQueue)
- Such operators are supported in sparse and associative domains
Bounded queue:
- proc capacity
- proc requestCapacity(newCap)
- proc isFull
Metadata
Metadata
Assignees
Labels
No labels