Skip to content

Use a dynamic bound for the queue #15255

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oriongonza
Copy link

If the queue is at capacity (100) and we push something to it it will grow, but the push_bounded will still block when there's plenty of space left.

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 2, 2025
@ehuss
Copy link
Contributor

ehuss commented Mar 2, 2025

Thanks for the PR! I don't think the capacity of VecDeque is guaranteed to be exact. Can you say more about why this is needed?

@oriongonza
Copy link
Author

This is not exactly needed, but this solves the issue mentioned above, the unfortunate situation when the sender blocks when it doesn't need to.

I don't think the capacity of VecDeque is guaranteed to be exact

https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/job_queue/mod.rs#L485 I don't think you care ;)

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

but the push_bounded will still block when there's plenty of space left.

The bound is expected to be static if I understand the code correctly.

Why does this need to support a dynamic bound? Any Cargo bad behavior you saw?

@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 15, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants