Re: Thread critical sections
Re: Thread critical sections
- Subject: Re: Thread critical sections
- From: Steve Checkoway <email@hidden>
- Date: Fri, 28 Oct 2005 21:20:29 -0700
On Oct 28, 2005, at 8:00 PM, Solra Bizna wrote:
On 10/28/05, Steve Checkoway <email@hidden> wrote:
Is there a way to get behavior similar to Carbon's Thread Manager
functions ThreadBeginCritical() and ThreadEndCritical() using
pthreads
or mach threads?
I think this is impossible with pthreads.
So I'm beginning to realize.
Let me elaborate further on what I'm trying to do so that maybe
someone will have a suggestion for how to proceed.
Ideally, what happens is we are getting a current time stamp and then
asking the sound hardware (or its driver) for it's position. The
example that was given to me by another programmer is, "we can say
'the sound was at 33.5secs at 5:33:20pm.' "
This is not an issue with multiple threads executing the code at the
same time or with multiply threads reading and writing data at the
same time. The issue is if we get the current time and then we are
preempted before we get the time from the sound hardware, it
introduces errors. Millisecond timing is of utmost importance so the
errors introduced by this are potentially nontrivial.
One idea is to raise the priority of the thread to realtime for the
short time that this code is executing and then lower it back to its
old priority. Since this is expected to happen 60 times each second
(or so), will doing this cause undue strain for the scheduler that
would impact performance in other ways negating any benefits gained
by (hopefully) not being preempted during that short bit of time?
- Steve
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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