| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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?
| References: | |
| >scheduling question (From: "Stefan Werner" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.