Skip to content

A queue for unique indices with constant-time lookup and removal backed by Vec

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Rufflewind/index_queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

index_queue

Documentation Crates.io Build Status

A queue for unique indices (integers) with O(1) push/pop and O(1) lookup/removal. It is a doubly-linked list with all its nodes stored inside a single Vec. The queue is most memory efficient when the integers are relatively small and densely packed. The implementation is similar to ixlist, but index_queue is more specialized: it allows querying whether an index already exists as well as removal by index, but does not allow duplicate indices.

The queue works well with indices obtained from array-based allocators such as vec_arena or slab.

This crate was originally created to implement a cooperative FIFO task scheduler (synchrotron).

About

A queue for unique indices with constant-time lookup and removal backed by Vec

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages