Thread Priority
Thread Priority
- Subject: Thread Priority
- From: Marc Van Olmen <email@hidden>
- Date: Fri, 4 Nov 2005 14:20:17 -0500
hi,
I'm wondering if this is a good idea:
My application has 3 threads:
1. Reading
2. Image Composing
3. Display
The image composing thread (2) has a buffer of 15 frames, so 15
frames in advance can be generated. When ever a buffer comes
available the thread wakes up and generates another one.
The questions I have now is that I want to make sure that other
threads have more time available to increase responsiveness or even
in the future have more displays busy>
so I had the idea to play with thread priority.
When 15 frame buffers or free for rendering I give thread priority 80
When 14 frame buffers or free for rendering I give thread priority 73
...
When 1 frame buffers or free for rendering I give thread priority 20
0 frames the thread sleeps.
Would this be a good idea?
Or is it better that the thread has a constant priority?
Another question related, to make sure that my 2nd thread generates
enough frames in advance.
Should I also use the FixedPriority option:
if (mFixedPriority)
{
thread_extended_policy_data_t theFixedPolicy;
theFixedPolicy.timeshare = false; // set to true for a non-fixed thread
BAIL_MSG_OSERROR(thread_policy_set(aMachPort,
THREAD_EXTENDED_POLICY, (thread_policy_t)&theFixedPolicy,
THREAD_EXTENDED_POLICY_COUNT), "cOS_Thread::SetPriority: failed to
set the fixed-priority policy");
}
I don't care about user responsive I want my application to run
smooth so sending the frames out at correct timing for smooth animation.
regards,
mvo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden