Mach realtime thread with thread_policy_set
I am experimenting with Mach real time threads (thread_policy_set THREAD_TIME_CONSTRAINT_POLICY) and am having a problem where real time threads don't seem to be scheduled properly (far too often). I have a simple app that creates a pthread and then boosts the new pthread's priority via thread_policy_set; the pthread executes continuously and effectively stops the 'parent' thread from executing. I must note... that my real time pthread does some garbage calculation in a while(1) loop and calls YieldToAnyThread() to attempt to give up its time slice. Am I missing something obvious here? I would expect my real time thread to get regularly scheduled 'bits' of cpu time not 'continuous' cpu time. I am using 1ms for my computation value (workload takes .5ms) and 1000ms for my period value. I calculate computation and value with NanosecondsToAbsolute(). Is there an API that I can use to signal that my real time thread is done executing for this period? I have scoured the internet and have not found a good answer. Thanks Greg _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Greg Eigsti