Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent deadlocks in EagerIterators by making prefetch optional. #185

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

thetorpedodog
Copy link
Contributor

Previously, if you provided a thread pool that was too small and an EagerIterator could not create a new preloading thread, the iterator would deadlock, since it would wait for the new thread to be created forever and not try to just do the work itself. This change instead uses preloading as an optional optimization, and if the preload has not yet been completed, computes the next value itself.

Previously, if you provided a thread pool that was too small and an
EagerIterator could not create a new preloading thread, the iterator
would deadlock, since it would wait for the new thread to be created
forever and not try to just do the work itself. This change instead
uses preloading as an optional optimization, and if the preload
has not yet been completed, computes the next value itself.
Copy link
Member

@ebezzi ebezzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks Paul!

@thetorpedodog thetorpedodog merged commit 61f6cc9 into main Jan 10, 2024
6 checks passed
@thetorpedodog thetorpedodog deleted the eager-iter-no-deadlocks branch January 10, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants