mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 10:00:16 +02:00
DiskCache: make Writer thread low-priority
This commit is contained in:
1 parent
af9b438eec
commit
c3fb6ccaaa
7 files changed
+39
-17
No files matched your search
@@ -316,7 +316,7 @@ namespace DiskCache {
|
||||
}
|
||||
|
||||
if (IsWritingDiskCache()) {
|
||||
Writer = fextl::make_unique<WorkQueueThread>();
|
||||
Writer = fextl::make_unique<WorkQueueThread>(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
namespace FEXCore::Threads {
|
||||
static fextl::unique_ptr<FEXCore::Threads::Thread> CreateThread_Default(ThreadFunc Func, void* Arg) {
|
||||
static fextl::unique_ptr<FEXCore::Threads::Thread> CreateThread_Default(ThreadFunc Func, void* Arg, bool LowPriority) {
|
||||
ERROR_AND_DIE_FMT("Frontend didn't setup thread creation!");
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ static FEXCore::Threads::Pointers Ptrs = {
|
||||
.CleanupAfterFork = CleanupAfterFork_Default,
|
||||
};
|
||||
|
||||
fextl::unique_ptr<FEXCore::Threads::Thread> FEXCore::Threads::Thread::Create(ThreadFunc Func, void* Arg) {
|
||||
return Ptrs.CreateThread(Func, Arg);
|
||||
fextl::unique_ptr<FEXCore::Threads::Thread> FEXCore::Threads::Thread::Create(ThreadFunc Func, void* Arg, bool LowPriority) {
|
||||
return Ptrs.CreateThread(Func, Arg, LowPriority);
|
||||
}
|
||||
|
||||
void FEXCore::Threads::Thread::CleanupAfterFork() {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
namespace FEXCore {
|
||||
|
||||
WorkQueueThread::WorkQueueThread() {
|
||||
Thread = FEXCore::Threads::Thread::Create(ThreadEntry, this);
|
||||
WorkQueueThread::WorkQueueThread(bool LowPriority) {
|
||||
Thread = FEXCore::Threads::Thread::Create(ThreadEntry, this, LowPriority);
|
||||
}
|
||||
|
||||
WorkQueueThread::~WorkQueueThread() {
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace FEXCore::Threads {
|
||||
using ThreadFunc = void* (*)(void* user_ptr);
|
||||
|
||||
class Thread;
|
||||
using CreateThreadFunc = fextl::unique_ptr<Thread> (*)(ThreadFunc Func, void* Arg);
|
||||
using CreateThreadFunc = fextl::unique_ptr<Thread> (*)(ThreadFunc Func, void* Arg, bool LowPriority);
|
||||
using CleanupAfterForkFunc = void (*)();
|
||||
|
||||
struct Pointers {
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
* @name Calls provided API functions
|
||||
* @{ */
|
||||
|
||||
static fextl::unique_ptr<Thread> Create(ThreadFunc Func, void* Arg);
|
||||
static fextl::unique_ptr<Thread> Create(ThreadFunc Func, void* Arg, bool LowPriority = false);
|
||||
|
||||
static void CleanupAfterFork();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
virtual void Run() = 0;
|
||||
};
|
||||
|
||||
WorkQueueThread();
|
||||
WorkQueueThread(bool LowPriority = false);
|
||||
~WorkQueueThread();
|
||||
|
||||
void QueueWork(fextl::unique_ptr<WorkItem> Work);
|
||||
|
||||
Reference in new issue
Block a user