Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scheduling question



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/scheduler/chapter_8_section_4.html#//apple_ref/doc/uid/TP30000905-CH211-BAB
HGEFA
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.