mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
utils: remove thread priority elevation
Remove UHD call to elevate thread priority to realtime from utils, and add warning in documentation of set_thread_priority function. Setting all threads to the same realtime priority can cause the threads to not share access to the network interface fairly, which adversely affects operation of the worker threads in UHD.
This commit is contained in:
parent
9863161320
commit
1c79742231
@ -20,8 +20,10 @@ static const float default_thread_priority = float(0.5);
|
||||
/*!
|
||||
* Set the scheduling priority on the current thread.
|
||||
*
|
||||
* A new thread or calling process should make this call
|
||||
* with the defaults this to enable realtime scheduling.
|
||||
* To enable realtime scheduling on a new thread, call this function with
|
||||
* the default values. Warning: realtime scheduling can cause UHD worker
|
||||
* threads to not share resources such as network interfaces fairly,
|
||||
* potentially causing it to malfunction.
|
||||
*
|
||||
* A priority of zero corresponds to normal priority.
|
||||
* Positive priority values are higher than normal.
|
||||
|
||||
@ -319,8 +319,6 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
uhd::set_thread_priority_safe();
|
||||
|
||||
const char* formats[] = {"sc16", "fc32", "fc64"};
|
||||
constexpr size_t rx_spp = 2000;
|
||||
constexpr size_t tx_spp = 1000;
|
||||
|
||||
@ -82,8 +82,6 @@ int query_clock_sensors(const std::string& args)
|
||||
|
||||
int UHD_SAFE_MAIN(int argc, char* argv[])
|
||||
{
|
||||
uhd::set_thread_priority_safe();
|
||||
|
||||
std::string args;
|
||||
|
||||
// Set up program options
|
||||
|
||||
@ -32,8 +32,6 @@ static void tx_thread(uhd::usrp::multi_usrp::sptr usrp,
|
||||
uhd::tx_streamer::sptr tx_stream,
|
||||
const double tx_wave_ampl)
|
||||
{
|
||||
uhd::set_thread_priority_safe();
|
||||
|
||||
// set max TX gain
|
||||
usrp->set_tx_gain(usrp->get_tx_gain_range().stop());
|
||||
|
||||
|
||||
@ -31,8 +31,6 @@ static void tx_thread(uhd::usrp::multi_usrp::sptr usrp,
|
||||
const double tx_wave_freq,
|
||||
const double tx_wave_ampl)
|
||||
{
|
||||
uhd::set_thread_priority_safe();
|
||||
|
||||
// set max TX gain
|
||||
usrp->set_tx_gain(usrp->get_tx_gain_range().stop());
|
||||
|
||||
|
||||
@ -28,8 +28,6 @@ static void tx_thread(uhd::usrp::multi_usrp::sptr usrp,
|
||||
const double tx_wave_freq,
|
||||
const double tx_wave_ampl)
|
||||
{
|
||||
uhd::set_thread_priority_safe();
|
||||
|
||||
// set max TX gain
|
||||
usrp->set_tx_gain(usrp->get_tx_gain_range().stop());
|
||||
|
||||
|
||||
@ -1037,8 +1037,6 @@ std::vector<size_t> get_channels(const std::string& channel_list, size_t max = -
|
||||
* Main code + dispatcher
|
||||
**********************************************************************/
|
||||
int UHD_SAFE_MAIN(int argc, char *argv[]){
|
||||
uhd::set_thread_priority_safe();
|
||||
|
||||
//variables to be set by po
|
||||
std::string args;
|
||||
double duration;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user