Re: Thread critical sections
Re: Thread critical sections
- Subject: Re: Thread critical sections
- From: Steve Checkoway <email@hidden>
- Date: Fri, 28 Oct 2005 22:40:15 -0700
On Oct 28, 2005, at 9:48 PM, Ed Wynne wrote:
You can't solve this problem the way you want with the available
tools, but a slightly different approach should be workable.
Assuming preemption events are rare (which they should be), you can
detect failures instead of guaranteeing success. Something like:
do {
time1 = get_time_stamp();
position = get_sound_position();
time2 = get_time_stamp();
} while((sw_time2 - sw_time1) > SOME_THRESHOLD);
time = (time1 + time2) / 2;
All you need to do is calibrate the SOME_THRESHOLD value with a
timing loop at runtime.
This looks like an excellent idea. I will look into it.
I'd like to thank everybody for their input.
- 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