mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
better scheduling parameters
This commit is contained in:
parent
1872148320
commit
36c0a0fd2e
@ -36,17 +36,22 @@ ThreadSimpleManager *ThreadSimpleManager::_global_ptr;
|
||||
ThreadSimpleManager::
|
||||
ThreadSimpleManager() :
|
||||
_simple_thread_epoch_timeslice
|
||||
("simple-thread-epoch-timeslice", 0.01,
|
||||
("simple-thread-epoch-timeslice", 0.05,
|
||||
PRC_DESC("When SIMPLE_THREADS is defined, this defines the amount of time, "
|
||||
"in seconds, that should be considered the "
|
||||
"typical timeslice for one epoch (to run all threads once).")),
|
||||
_simple_thread_volunteer_delay
|
||||
("simple-thread-volunteer-delay", 0.0001,
|
||||
PRC_DESC("When SIMPLE_THREADS is defined, this defines the amount of time, "
|
||||
"in seconds, for which a task that voluntarily yields should "
|
||||
"be delayed.")),
|
||||
_simple_thread_window
|
||||
("simple-thread-window", 1.0,
|
||||
PRC_DESC("When SIMPLE_THREADS is defined, this defines the amount of time, "
|
||||
"in seconds, over which to average all the threads' runtimes, "
|
||||
"for the purpose of scheduling threads.")),
|
||||
_simple_thread_low_weight
|
||||
("simple-thread-low-weight", 0.1,
|
||||
("simple-thread-low-weight", 0.2,
|
||||
PRC_DESC("When SIMPLE_THREADS is defined, this determines the relative "
|
||||
"amount of time that is given to threads with priority TP_low.")),
|
||||
_simple_thread_normal_weight
|
||||
@ -106,7 +111,7 @@ enqueue_ready(ThreadSimpleImpl *thread, bool volunteer) {
|
||||
// sleep for the duration of the timeslice, so it won't interfere
|
||||
// with timeslice accounting for the remaining ready threads.
|
||||
double now = get_current_time();
|
||||
thread->_wake_time = now + _simple_thread_epoch_timeslice;
|
||||
thread->_wake_time = now + _simple_thread_volunteer_delay;
|
||||
_volunteers.push_back(thread);
|
||||
push_heap(_volunteers.begin(), _volunteers.end(), CompareStartTime());
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ private:
|
||||
public:
|
||||
// Defined within the class to avoid static-init ordering problems.
|
||||
ConfigVariableDouble _simple_thread_epoch_timeslice;
|
||||
ConfigVariableDouble _simple_thread_volunteer_delay;
|
||||
ConfigVariableDouble _simple_thread_window;
|
||||
ConfigVariableDouble _simple_thread_low_weight;
|
||||
ConfigVariableDouble _simple_thread_normal_weight;
|
||||
|
Loading…
x
Reference in New Issue
Block a user