Does anyone know, what priority property means?
I created two threads (both incremented/decremented the same Int64, it's not recommended behavior, is it the cause?), the first had "highest" priority, the second "lowest" (I didn't try "realtime" or "idle"). The results didn't differ from both "normal": sometimes the first was slightly ahead, sometimes the second, no visible advantage of the favored one... (I can provide source if wanted.)
Mailing lists / fpc-devel / 2006-04
thread priority (win32)
6 messages · 3 people ·
- ППётр Косаревский 3
- Iik 2
- PPaul Davidson 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
IIRC thread priority is not implemented on Darwin, and possibly other FPC platforms
Пётр Косаревский wrote 12 lines
P Davidson
Corax Networks Inc.
http://CoraxNetworks.com
Does anyone know, what priority property means? I created two threads (both…
The Windows Kernel works in a priority level of program execution (main process) and sub processes (child process).
Each priority tells Windows what queue to place the processes. If your parent process is "Norma" then the child process does not have effect except that it's priority on executing will be higher when executing the parent process.
If I understand your question, I hope that will answer it.
Ido
Пётр Косаревский wrote 6 lines
Show quoted text 8 lines
Thank you.
Do you know, what can I do
either start thread (through some hack?) with other priority
or change the priority of the main application (by FPC? or should I use WinAPI "directly"?)
It's been a while since I developed for Windows, so I do not know if the following function is deprecated or not, or even will work on all Windows versions:
SetPriorityClass
You can set the process priority at runtime as far as I remember (please take a look at MSDN for better information :)).
Ido
Пётр Косаревский wrote 20 lines
Show quoted text 9 lines
Thank you, the function is not deprecated (I have looked up MSDN).
However, it seems that property I asked about is not very useful: with such functions (and receiving handle of main process and so on) it would not be MORE difficult to change threads priorities in alike way.
