Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Simplifying Queue and Pipe data structures. #602

Open
KarlSchimpf opened this issue May 18, 2017 · 0 comments
Open

Simplifying Queue and Pipe data structures. #602

KarlSchimpf opened this issue May 18, 2017 · 0 comments

Comments

@KarlSchimpf
Copy link
Contributor

The original intent of the Queue data structure was do define a data structure that allowed simultaneous reading and writing to it.

The "Queue.FirstPage" field was used to automatically clean up when streaming. However, because there was only one first page for both reading and writing, the Pipe concept could not be implemented.

A better solution is to add a "read" first page and a "write" first page concept. Each of these (shared) pointers keep track of the portion of the queue that is being used for reading and writing. Either page pointer may be null, if the corresponding concept is not being used.

If there is both a "read" and a "write" first page, the "read" page should always be behind the "write" first page, unless "eof" has been frozen (in which case the remainder of the input can be read).

In addition, advancement of read cursors should be limited to pages that appear before the first write page (only applies if first write page is non-null). This guarantees that the input is no longer changing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant