Skip to content

Disable spin-waiting in some cases when CPU quota is limited by default #112869

Open
@kouvel

Description

@kouvel
  • In environments where the CPU quota is limited, spin-waiting will eat some of the CPU quota
  • It's unpredictable whether eating up CPU quota from spin-waiting would leave less CPU time for more useful work later. Even an adaptive spin-waiting scheme that is aware of the scenario would have difficulty making a useful compromise due to the unpredictability in these scenarios.
  • Environments where CPU quota is limited often tend to be more efficiency-oriented than throughput-oriented, in the sense useful work done per CPU time used is more valued than the throughput
  • A better default for those environments would be to disable spin-waiting in at least cases that typically contribute noticeably to spin-waiting CPU time, such as the thread pool and locks
  • The change should be configurable. In environments where the CPU quota is typically not reached (even with spin-waiting), and where throughput is more valued than efficiency, spin-waiting may still be beneficial.

Metadata

Metadata

Assignees

Labels

area-System.Threadingin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

Status

UserStories + Epics

Relationships

None yet

Development

No branches or pull requests

Issue actions