Текущий архив: 2004.09.12;
Скачать: CL | DM;
Вниз
Приритет программы. Найти похожие ветки
← →
Реактор (2004-08-25 14:36) [0]Хочу присваоить своей программе самый низкий приоритет работы. Пишу в FormActivate следущую строку
SetThreadPriority ( GetCurrentThread, ??? );
Что должно стоять вместо знаков вопросов? Какие значения тамм вообще можно ставить и чему они соответствуют?
← →
Smithson (2004-08-25 14:41) [1]SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS)
Это для всего приложения
Для конкретного потока у TThread есть поле Priority, ставишь tpLower
← →
TUser © (2004-08-25 14:42) [2]THREAD_PRIORITY_IDLE
PS. Есть еще такая штука - приоритет процесса. Его тоже надо самым маленьким поставить. Подробно об этом пишут Тексейра и Пачеко.
PPS. Там где ты прочитал про ф-цию SetThreadPriority - там же должно быть и описание приоритетов
← →
Реактор (2004-08-25 14:45) [3]Про SetThreadPriority я прочитал в FAQ, там нет описания приоритетов.
А при использовании SetPriorityClass, кроме IDLE_PRIORITY_CLASS что еще можно ставить?
← →
TUser © (2004-08-25 14:50) [4]Надо было читать в SDK.
Priority Meaning
HIGH_PRIORITY_CLASS Specify this class for a process that performs time-critical tasks that must be executed immediately. The threads of the process preempt the threads of normal or idle priority class processes. An example is Windows Task List, which must respond quickly when called by the user, regardless of the load on the operating system. Use extreme care when using the high-priority class, because a high-priority class application can use nearly all available CPU time.
IDLE_PRIORITY_CLASS Specify this class for a process whose threads run only when the system is idle. The threads of the process are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle-priority class is inherited by child processes.
NORMAL_PRIORITY_CLASS Specify this class for a process with no special scheduling needs.
REALTIME_PRIORITY_CLASS Specify this class for a process that has the highest possible priority. The threads of the process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive.
← →
begin...end © (2004-08-25 14:52) [5]> [3] Реактор (25.08.04 14:45)
Товарищ Реактор, ну неужели нельзя открыть справку WinAPI и посмотреть описание функции SetPriorityClass?!
Страницы: 1 вся ветка
Текущий архив: 2004.09.12;
Скачать: CL | DM;
Память: 0.47 MB
Время: 0.04 c