Hi!
I've built a daemon which spawns up to 32 threads.
This part is ok, everything thing runs smoothly.
Now i'd like to make these threads realtime threads as they are time critical and mustn't be delayed.
I've tried many things but none seems to work (i check with htop / top to see the priority and GetThreadPriority on each of these thread inside the main thread).
procedure TMyThread.Create( ); override
begin
inherited Create( True );
/* .. some initialization stuff .. */
priority := tpTimeCritical;
ThreadSetPriority( GetCurrentThreadId, 15);
resume;
end;
Looking back at the thread in top/htop the thread stayed at priority 20.
Trying ThreadSetPriority( GetCurrentThreadId, 15) always returns false (i'm root).
What am i doing wrong ? Is top/htop the right place to see this information ?