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

Optimize jobserver try_acquire #1037

Merged
merged 8 commits into from
Apr 20, 2024
Merged

Optimize jobserver try_acquire #1037

merged 8 commits into from
Apr 20, 2024

Commits on Apr 18, 2024

  1. Bump dep jobserver from 0.1.20 to 0.1.30

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    0304e07 View commit details
    Browse the repository at this point in the history
  2. Add parallel::OnceLock impl copied from std::sync::OnceLock

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    173e649 View commit details
    Browse the repository at this point in the history
  3. Optimize inherited_jobserver acquire

    First try `jobserver::Client::try_acquire`, which will work:
     - If a fifo is used as jobserver
     - On linux and:
        - preadv2 with non-blocking read available (>=5.6)
        - /proc is available
     - On Windows
     - On wasm
    
    if not, we will simply fallback to help thread implementation, spawning one
    thread to maintain compatibility with other platforms.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    e9ce514 View commit details
    Browse the repository at this point in the history
  4. Use OnceLock in JobTokenServer::new

    Also impls `Send`, `Sync`, `RefUnwindSafe` and `UnwindSafed` when the `T`
    meets the criterior.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    4e9adfe View commit details
    Browse the repository at this point in the history
  5. Replace vendored OnceLock with dep once_cell

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    2d3c859 View commit details
    Browse the repository at this point in the history
  6. Fix dep: once_cell is needed on all targets

    whenever feature parallel is enabled.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    3361c4d View commit details
    Browse the repository at this point in the history
  7. Refactor: ActiveJobTokenServer::new no longer returns Result

    There is no need to, it never fails.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    2847b2c View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2024

  1. Add back TODO

    NobodyXu committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    852df91 View commit details
    Browse the repository at this point in the history