scheduler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_FUCHSIA_SCHEDULER_H_
  5. #define BASE_FUCHSIA_SCHEDULER_H_
  6. #include "base/strings/string_piece.h"
  7. #include "base/time/time.h"
  8. namespace base {
  9. // Scheduling interval to use for realtime audio threads.
  10. // TODO(crbug.com/1224707): Add scheduling period to Thread::Options and remove
  11. // this constants.
  12. constexpr TimeDelta kAudioSchedulingPeriod = Milliseconds(10);
  13. // Reserve 30% of one CPU core for audio threads.
  14. // TODO(crbug.com/1174811): A different value may need to be used for WebAudio
  15. // threads (see media::FuchsiaAudioOutputDevice). A higher capacity may need to
  16. // be allocated in that case.
  17. constexpr float kAudioSchedulingCapacity = 0.3;
  18. // Scheduling interval to use for display threads.
  19. // TODO(crbug.com/1224707): Add scheduling period to Thread::Options and remove
  20. // this constants.
  21. constexpr TimeDelta kDisplaySchedulingPeriod = Seconds(1) / 60;
  22. // Reserve 50% of one CPU core for display threads.
  23. // TODO(crbug.com/1181421): Currently DISPLAY priority is not enabled for any
  24. // thread on Fuchsia. The value below will need to be fine-tuned when it's
  25. // enabled.
  26. const float kDisplaySchedulingCapacity = 0.5;
  27. } // namespace base
  28. #endif // BASE_FUCHSIA_SCHEDULER_H_