mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Set SCHED_BATCH priority on the loadblk thread.
While reading another PR I saw a mention of #6358. The use case for SCHED_BATCH is to hint to the kernel that the thread is running a non-interactive workload that consumes a lot of CPU time. This is helpful on desktop machines where the loadblk thread can interfere with interactive applications. More details can be found in the sched(7) man page.
This commit is contained in:
@@ -357,4 +357,13 @@ std::unique_ptr<T> MakeUnique(Args&&... args)
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* On platforms that support it, tell the kernel the calling thread is
|
||||
* CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
|
||||
*
|
||||
* @return The return value of sched_setschedule(), or 1 on systems without
|
||||
* sched_setchedule().
|
||||
*/
|
||||
int ScheduleBatchPriority(void);
|
||||
|
||||
#endif // BITCOIN_UTIL_H
|
||||
|
||||
Reference in New Issue
Block a user