| Age | Commit message (Collapse) | Author |
|
Verified with a hwtest and implemented based on reverse engineering.
Thread A's priority will get bumped to the highest priority among all the threads that are waiting for a mutex that A holds.
Once A releases the mutex and ownership is transferred to B, A's priority will return to normal and B's priority will be bumped.
|
|
|
|
|
|
Switch mutexes are no longer kernel objects, they are managed in userland and only use the kernel to handle the contention case.
Mutex addresses store a special flag value (0x40000000) to notify the guest code that there are still some threads waiting for the mutex to be released. This flag is updated when a thread calls ArbitrateUnlock.
TODO:
* Fix svcWaitProcessWideKey
* Fix svcSignalProcessWideKey
* Remove the Mutex class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
starvation.
Ported from citra PR #3091
The delay specified here is from a Nintendo 3DS, and should be measured in a Nintendo Switch.
This change is enough to prevent Puyo Puyo Tetris's main thread starvation.
|
|
|
|
|
|
* CoreTiming: New CoreTiming; Add Test for CoreTiming
|
|
|
|
This is kinda crufty, but we need it for now to update guest state variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Conflicts:
# src/core/CMakeLists.txt
# src/core/arm/dynarmic/arm_dynarmic.cpp
# src/core/arm/dyncom/arm_dyncom.cpp
# src/core/hle/kernel/process.cpp
# src/core/hle/kernel/thread.cpp
# src/core/hle/kernel/thread.h
# src/core/hle/kernel/vm_manager.cpp
# src/core/loader/3dsx.cpp
# src/core/loader/elf.cpp
# src/core/loader/ncch.cpp
# src/core/memory.cpp
# src/core/memory.h
# src/core/memory_setup.h
|
|
|
|
Memory: Add overloads for ReadBlock and WriteBlock that operate on a specific process.
|
|
|
|
|
|
Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken
|
|
|
|
when it is awoken.
This change makes for a clearer (less confusing) path of execution in the scheduler, now the code to execute when a thread awakes is closer to the code that puts the thread to sleep (WaitSynch1, WaitSynchN). It also allows us to implement the special wake up behavior of ReplyAndReceive without hacking up WaitObject::WakeupAllWaitingThreads.
If savestates are desired in the future, we can change this implementation to one similar to the CoreTiming event system, where we first register the callback functions at startup and assign their identifiers to the Thread callback variable instead of directly assigning a lambda to the wake up callback variable.
|
|
creating it.
Don't automatically assume that Thread::Create will only be called when the parent process is currently scheduled. This assumption will be broken when applets or system modules are loaded.
|
|
Don't expose Memory::current_page_table as a global.
|
|
Kernel/Memory: Give each process its own page table and allow switching the current page table upon reschedule
|
|
context switch from an idle thread into a thread in the same process.
We were unnecessarily clearing the cache when going from Process A -> Idle -> Process A, this caused extreme performance regressions.
|
|
|
|
a new process.
This is necessary for loading multiple processes at the same time.
The main thread will be automatically scheduled when necessary once the scheduler runs.
|
|
Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in
case you already have an rvalue.
|
|
|
|
|
|
creating a thread and remove the priority clamping code.
|
|
priority clamping code from Thread::SetPriority.
|
|
Don't yield execution in SleepThread(0) if there are no available threads to run
|
|
Kernel: Removed the priority boost code for starved threads.
|
|
available threads to run.
With this we avoid an useless temporary deschedule of the current thread.
|
|
|
|
After hwtesting and reverse engineering the kernel, it was found that the CTROS scheduler performs no priority boosting for threads like this, although some other forms of scheduling priority-starved threads might take place.
For example, it was found that hardware interrupts might cause low-priority threads to run if the CPU is preempted in the middle of an SVC handler that deschedules the current (high priority) thread before scheduling it again.
|
|
|
|
the objects that a thread is waiting on.
|