Thread prioritization
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 ? Thanks in advance, best Alex
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@acc.umu.se
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.
Allright all I needed to know !
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.
Makes sense and is completely acceptable if the above mentioned concept applies. Thanks, best Alex
On Thursday, November 20, 2014 05:27 PM, Alexander Carôt wrote:
Hello all,
is it correct that boost does not offer thread prioritization ?
There's nothing directly on the interface.
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 ?
Basically there's a platform specific back door: native_handle. http://www.boost.org/doc/libs/1_57_0/doc/html/thread/thread_management.html#... Ben
participants (3)
-
Alexander Carôt
-
Ben Pope
-
Lars Viklund