Hi, I am writing a real-time application and am in the optimization phase right now, playing with priorities and scheduling parameters. The critical thread in my application is a loop around recv() that is waiting for UDP packages and processes them upon reception. It should react on incoming packages as quickly as possible and get the processing done in a certain time. Now I'm wondering what's better suited for my thread: Real-time scheduling (guaranteeing my thread a certain time slice) or a "regular" thread with an insanely high priority? I tried some code snippets I found, one of them* is setting my thread to THREAD_TIME_CONSTRAINT_POLICY, the other is setting it to THREAD_PRECEDENCE_POLICY, in addition to setting threadExtendedPolicy.timeshare = 0. I tried them both, and with each of them my application performed much better than with standard threading. But still, it could be a tad better, and I guess I should start tweaking the parameters I pass to the functions. Before I spend too much time doing that, I wonder what will give me better results: time constraint or precedence policy? Will changing the process' priority improve anything or are my threads scheduled independently of the process? Thanks, Stefan *) http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming... HGEFA _______________________________________________ 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)
-
Stefan Werner