Source

Hard real-time queues / README

Full commit
Functional queues for Mythryl with hard real-time operations, based on
lazy lists and memoization. This implementation is based on techniques
described in "Purely Functional Data Structures" by Chris Okasaki,
1996.

https://bitbucket.org/rev22/hard-real-time-queues

This code was written in Mythryl: http://www.mythryl.org

Licensing:

Please consult the individual files for the copyright notices.   I
(Michele) will release them with a BSD-style or the MIT license given
a small compensation for the ~5 hours work (at least 90 EUR or 15
BTC).

Performance:

According to measurements, the maximum number of recursive calls
(including mutual recursion) performed during the execution of each
individual operation (enqueue/dequeue) is just 2, confirming the
the hard real-time constraint.

When comparing by average execution time, operations were measured to
be about 6 to 10 times slower than the same operations performed on
finger queues (https://bitbucket.org/rev22/finger-deques), on queues
with sizes in the order of one million of elements.

Files:

real-time-queue.pkg    		 Main library code.
real-time-queue--verbatim.pkg    Near-verbatim implementation
real-time-queue--complexity.pkg  Complexity measuring implementation