1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

LV2: Longer thread creation delay for low prio threads

This commit is contained in:
Elad.Ash 2024-03-09 23:37:35 +02:00 committed by GitHub
parent 38590e321e
commit 4cfdb71d3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1781,12 +1781,14 @@ bool lv2_obj::awake_unlocked(cpu_thread* cpu, s32 prio)
{
if (current_ppu->prio.load().prio > lowest_new_priority)
{
const bool is_create_thread = current_ppu->gpr[11] == 0x35;
// When not being set to All timers - activate only for sys_ppu_thread_start
if (current_ppu->gpr[11] == 0x35 || g_cfg.core.sleep_timers_accuracy == sleep_timers_accuracy_level::_all_timers)
if (is_create_thread || g_cfg.core.sleep_timers_accuracy == sleep_timers_accuracy_level::_all_timers)
{
if (!current_ppu->state.test_and_set(cpu_flag::yield) || current_ppu->hw_sleep_time != 0)
{
current_ppu->hw_sleep_time += 35; // Seems like 35us after extensive testing
current_ppu->hw_sleep_time += (is_create_thread ? 51 : 35);
}
else
{