QuantumLibrary
quantum_thread_traits.h
1 /*
2 ** Copyright 2018 Bloomberg Finance L.P.
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 #ifndef BLOOMBERG_QUANTUM_THREAD_TRAITS_H
17 #define BLOOMBERG_QUANTUM_THREAD_TRAITS_H
18 
19 #include <cstdint>
20 #include <chrono>
21 
22 namespace Bloomberg {
23 namespace quantum {
24 
25 //==============================================================================================
26 // struct ThreadTraits
27 //==============================================================================================
31 {
37  static std::chrono::milliseconds& yieldSleepIntervalMs()
38  {
39  static std::chrono::milliseconds value(0);
40  return value;
41  }
42  static std::chrono::microseconds& yieldSleepIntervalUs()
43  {
44  static std::chrono::microseconds value(10);
45  return value;
46  }
47 };
48 
49 }
50 }
51 
52 
53 #endif //BLOOMBERG_QUANTUM_THREAD_TRAITS_H
Definition: quantum_buffer_impl.h:22
static std::chrono::microseconds & yieldSleepIntervalUs()
Definition: quantum_thread_traits.h:42
static std::chrono::milliseconds & yieldSleepIntervalMs()
Dictates how long any thread should sleep on blocking calls when interacting with coroutines (e....
Definition: quantum_thread_traits.h:37
Allows application-wide settings for the various thread settings used by Quantum.
Definition: quantum_thread_traits.h:30