|
Boost Users : |
Subject: [Boost-users] Thread prioritization on OSX
From: Alexander Carôt (Alexander_Carot_at_[hidden])
Date: 2014-12-06 16:10:51
Hello all,
according to this:
http://www.boost.org/doc/libs/1_57_0/doc/html/thread/thread_management.html
#thread.thread_management.tutorial.attributes
I tried to change the thread priority to SCHED_RR on OS X via:
boost::thread::attributes attrs;
pthread_attr_setschedpolicy(attrs.get_native_handle(), SCHED_RR);
sendThread = boost::thread(attrs,&sender::sendItThreadFunction,this);
In that context I noticed that get_native_handle is not known so I used
attr.native_handle(), which compiled ok but finally threw an error here:
/boost/boost/bind/bind.hpp:313:9: Type 'boost::thread_attributes' does not
provide a call operator
I am still using boost 1.45 and wonder if this is the actual problem or if
something else is wrong.
Any help appreciated,
thanks
Alex
Am 20.11.14 10:53 schrieb "Ben Pope" unter <benpope81_at_[hidden]>:
>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.htm
>l#thread.thread_management.tutorial.attributes
>
>Ben
>
>
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users
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