Boost logo

Boost Users :

Subject: Re: [Boost-users] Thread prioritization
From: Lars Viklund (zao_at_[hidden])
Date: 2014-11-20 04:50:22


On Thu, Nov 20, 2014 at 10:27:42AM +0100, Alexander Carôt wrote:
> Hello all,
>
> is it correct that boost does not offer thread prioritization ?
>
> I am dealing with an application with a number of threads, which all
> depend on the realtime-scheduled sound card callback thread.
>
> These threads must have the same realtime scheduling priority.
>
> Is there a way to achieve this ?

If BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE is defined,
boost::thread has a native_handle_type and a native_handle() function.

You can use those (pthread_t, HANDLE, whatnot) with your native platform
functionality of choice to adjust thread priority, if such a concept
exists.

A reason it doesn't exist in Boost is because not all platforms has an
uniform "priority" system with the same kind of absolute/relative
priorities and tiers.

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net