[USRP-users] setting thread priority during multi threading

kamal kumar jeldi jeldi.kamal2011 at gmail.com
Wed Apr 29 05:17:07 EDT 2015


Hi All,

I am working with rx_samples_to_file.cpp code, I have implemented multi
threading in order to receive the data and to process it. I am creating
three threads( UHD_SAFE_MAIN thread, DataAcqusitionThread,
DataProcessingThread). I didn't set any priority to the above three
threads. I'm getting the following warning during execution.
UHD Warning:
    Unable to set the thread priority. Performance may be negatively
affected.
    Please see the general application notes in the manual for instructions.
    EnvironmentError: OSError: error in pthread_setschedparam.


I have been set main thread priority to
highest.(uhd::set_thread_priority_safe(1.0, true)), DataAcquistion Thread
to second priority(uhd::set_thread_priority_safe(0.75, true)) and
Processing thread(uhd::set_thread_priority_safe(0.5, true)) to least by
placing uhd::set_thread_priority_safe(priority_value, real_time) in their
respective functions. Still I'm getting the UHD Warning as above until and
unless i keep real_time value to false. Kindly explain the working of
set_thread_priority_safe(). How can i handle these threads synchronously?

I'm also getting Timeout while streaming error(ERROR_CODE_TIMEOUT) when
executed. kindly tl me why this error is coming. I didn't  get this error
when i was running rx_samples_to_file.cpp without threading.

wbrs,
kamal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20150429/76bb1df5/attachment-0002.html>


More information about the USRP-users mailing list