1 // Copyright (c) 2015-2017 Hartmut Kaiser 2 // 3 // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #if !defined(HPX_THREADS_SCHEDULER_MODE_AUG_27_2017_1136AM) 7 #define HPX_THREADS_SCHEDULER_MODE_AUG_27_2017_1136AM 8 9 namespace hpx { namespace threads { namespace policies 10 { 11 /// This enumeration describes the possible modes of a scheduler. 12 enum scheduler_mode 13 { 14 nothing_special = 0, ///< As the name suggests, this option 15 ///< can be used to disable all other options. 16 ///< 17 do_background_work = 0x1, ///< The scheduler will periodically 18 ///< call a provided callback function from a special HPX thread 19 ///< to enable performing background-work, for instance driving 20 ///< networking progress or garbage-collect AGAS. 21 reduce_thread_priority = 0x02, ///< The kernel priority of the 22 ///< os-thread driving the scheduler will be reduced below normal. 23 ///< 24 delay_exit = 0x04, ///< The scheduler will wait for some 25 ///< unspecified amount of time before exiting the scheduling loop 26 ///< while being terminated to make sure no other work is being 27 ///< scheduled during processing the shutdown request. 28 fast_idle_mode = 0x08, ///< Some schedulers have the capability 29 ///< to act as 'embedded' schedulers. In this case it needs to 30 ///< periodically invoke a provided callback into the outer scheduler 31 ///< more frequently than normal. This option enables this behavior. 32 enable_elasticity = 0x10, ///< This option allows for the 33 ///< scheduler to dynamically increase and reduce the number of 34 ///< processing units it runs on. Setting this value not succeed for 35 ///< schedulers that do not support this functionality. 36 default_mode = do_background_work | reduce_thread_priority | delay_exit 37 ///< This option represents the default mode. 38 }; 39 }}} 40 41 #endif 42 43