I am trying to optimize thread performance and it almost works
perfectly. What I am trying to do is to signal a high-priority
secondary thread to wakeup and execute as soon as possible when
certain criteria is met on a core-audio thread. I am using
semaphore_signal to signal to the secondary thread. I also am
having the secondary thread sleep only for the appropriate number
of nanoseconds with semaphore_timedwait in an attempt to have just
wake-up on time. The problem I am running into is that the
secondary thread will sleep sometimes for more than 30 milliseconds
even after being signaled by the semaphore mechanism.
Is there a way to tell the scheduler to immediately place the
secondary thread at the front of the queue?
I have tried setting real-time priority with
THREAD_TIME_CONSTRAINT_POLICY but it does not seem to make any
difference. In fact it actually works better if I simply set a high
priority using THREAD_PRECEDENCE_POLICY.
kern_return_t semaphore_signal_thread(sempahore_t sem, thread_t thread);
_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden