Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update lockbench.py #145230

Closed
Closed
Labels
topic-free-threadingtriagedThe issue has been accepted as valid by a triager.type-featureA feature request or enhancement
@colesbury

Description

@colesbury

Feature or enhancement

The lockbench.py benchmarksPyMutex andPyThread_type_lock for various number of threads and length of critical section. You'll see similar benchmarks for other mutex implementations:Rust parking_lot,WebKit.

I'd like to make a few updates to this benchmark:

  • RemovePyThread_type_lock. It's now based onPyMutex, so this isn't really useful anymore.
  • Add--work-outside to adjust the amount work done whilenot holding the lock. This helps simulate low and moderate contention scenarios.
  • Add--num-locks. So if we run with 8 threads and 2 locks, each group of 4 threads is independently contending for a lock. This adds more concurrency and helps demonstrate the limits of excessive spinning.
  • Make number of threads configurable
  • Add--total-iters which configures each thread to run for a fixed number of iterations instead of the default of running the whole benchmark for 1 second. With this mode, the benchmarks is only as fast as the slowest thread. It's another way to measure the effect of "fairness".

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-free-threadingtriagedThe issue has been accepted as valid by a triager.type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp