Re: Time constraint real-time threads
Re: Time constraint real-time threads
- Subject: Re: Time constraint real-time threads
- From: Stéphane Letz <email@hidden>
- Date: Tue, 31 May 2016 22:24:11 +0200
> Message: 1
> Date: Tue, 31 May 2016 10:46:52 +0200
> From: Julian Dessecker <email@hidden>
> To: email@hidden
> Subject: Time constraint real-time threads
> Message-ID:
> <CAPEb44W=email@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> I'm trying to create real-time threads via the
> THREAD_TIME_CONSTRAINT_POLICY.
> It works fine, an interrupt after each computation cycle can be seen inside
> the profiler (Instruments / System Trace) but the constraint seems to be
> ignored.
>
> I would expect a penalty after the constraint time is over but the thread
> stays on the CPU starving other threads.
>
> That's the way I initialize the time constraint policy:
>
> thread_time_constraint_policy_data_t time_constraints;
>
> time_constraints.period = (int) NanosecondsToAbsolute (1000000); // 1
> ms
>
> time_constraints.computation = (int) NanosecondsToAbsolute (250000); //
> 0.25 ms
>
> time_constraints.constraint = (int) NanosecondsToAbsolute(500000); //
> 0.5 ms
>
> time_constraints.preemptible = 1;
>
> thread_policy_set(mach_thread_self (), THREAD_TIME_CONSTRAINT_POLICY,
> (thread_policy_t) &time_constraints, THREAD_TIME_CONSTRAINT_POLICY_COUNT);
>
> Any ideas how to get the constraint working?
>
> Regards,
> Julian
> —
Have a look at JACK source code here (JackMachThread.h, cpp)
https://github.com/jackaudio/jack2/tree/master/macosx
Regards
Stéphane Letz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden