diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-08 12:50:03 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-15 23:32:40 -0500 |
commit | 7553aa973f352d48abbf5f8fc67530a5a64c108d (patch) | |
tree | b721770292751e8eef853bcccd3e78f40368208f /Transceiver52M/UHDDevice.cpp | |
parent | 7e4e536b1bfc9b20df6b30d427de29e3cc5bf5cf (diff) |
Transceiver52M: Set variable thread priority levels
The transceiver and underlying device drivers are threaded. use
the following priority levels.
0.50 - UHD driver internal threads
0.45 - Receive device drive thread
0.44 - Transmit device drive thread
0.43 - UHD asynchronous update thread (error reporting)
0.42 - Receive burst processing thread(s)
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/UHDDevice.cpp')
-rw-r--r-- | Transceiver52M/UHDDevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 224ebd0..660bce4 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -218,7 +218,7 @@ public: bool start(); bool stop(); void restart(uhd::time_spec_t ts); - void setPriority(); + void setPriority(float prio); enum TxWindowType getWindowType() { return tx_window; } int readSamples(std::vector<short *> &bufs, int len, bool *overrun, @@ -308,6 +308,8 @@ private: void *async_event_loop(uhd_device *dev) { + dev->setPriority(0.43); + while (1) { dev->recv_async_msg(); pthread_testcancel(); @@ -673,8 +675,6 @@ bool uhd_device::start() return false; } - setPriority(); - // Register msg handler uhd::msg::register_handler(&uhd_msg_handler); @@ -703,9 +703,9 @@ bool uhd_device::stop() return true; } -void uhd_device::setPriority() +void uhd_device::setPriority(float prio) { - uhd::set_thread_priority_safe(); + uhd::set_thread_priority_safe(prio); return; } |