Improve core timing accuracy (#5257)
* Improve core timing accuracy * remove wrong global_ticks, use biggest ticks over all cores for GetGlobalTicks * merge max slice length change
This commit is contained in:
parent
d11d600b61
commit
57aa18f52e
5 changed files with 62 additions and 28 deletions
|
@ -111,7 +111,7 @@ void ThreadManager::SwitchContext(Thread* new_thread) {
|
|||
// Save context for previous thread
|
||||
if (previous_thread) {
|
||||
previous_process = previous_thread->owner_process;
|
||||
previous_thread->last_running_ticks = timing.GetGlobalTicks();
|
||||
previous_thread->last_running_ticks = cpu->GetTimer().GetTicks();
|
||||
cpu->SaveContext(previous_thread->context);
|
||||
|
||||
if (previous_thread->status == ThreadStatus::Running) {
|
||||
|
@ -344,7 +344,7 @@ ResultVal<std::shared_ptr<Thread>> KernelSystem::CreateThread(
|
|||
thread->entry_point = entry_point;
|
||||
thread->stack_top = stack_top;
|
||||
thread->nominal_priority = thread->current_priority = priority;
|
||||
thread->last_running_ticks = timing.GetGlobalTicks();
|
||||
thread->last_running_ticks = timing.GetTimer(processor_id)->GetTicks();
|
||||
thread->processor_id = processor_id;
|
||||
thread->wait_objects.clear();
|
||||
thread->wait_address = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue