我有类似于mon的应用程序,在初始阶段进行一些软盘处理。 为了避免减缓其他任务,我在视窗上做的是:
SetPriorityClass(GetCurrentProcess(), PROCESS_MODE_BACKGROUND_BEGIN);
// initialization tasks
SetPriorityClass(GetCurrentProcess(), PROCESS_MODE_BACKGROUND_END);
// daemon is ready and running at normal priority
AFAIK, on Unices I can calls nice or set priority and reduction the process priority but I can t rise to what it was at process creation (i.e. there s no amount to the second SetPriorityClass in Occupation)less 我请我享有超级用户特权。 难道我没有机会再做一次呢? (我知道,我可以建立一个低优先的初始化线,等待主线完成,但我更愿意避免)
edit: Bonus Point for Equal SetThreadPriority (GetCurrentThread(), PHREED_MODE_BACKGROUND_BEG信息网);
SetThreadPriority (GetCurrentread(), PHED_MODE_BACKGROUND_END);