[USRP-users] UHD and Thread Safety

Andy Walls andy at silverblocksystems.net
Thu Dec 11 15:27:25 EST 2014


FWIW, I use a custom GNURadio block for closed loop monitoring of GPSDO and USRP time between the host and the USRP.  Polling every two seconds, 25 msec after the PPS, I occasionally see UHD gripe about the GPRMC message not being available.  I never bothered to track down the cause.

-Andy

On December 11, 2014 3:16:41 PM EST, Ben Hilburn via USRP-users <usrp-users at lists.ettus.com> wrote:
>Okay, we are debating the safety of polling for sensor data here within
>the
>R&D team. At this point, we have flip-flopped several times.
>
>Balint will respond shortly with our final guidance =)
>
>Cheers,
>Ben
>
>On Thu, Dec 11, 2014 at 12:14 PM, Ben Hilburn <ben.hilburn at ettus.com>
>wrote:
>
>> Actually, what I just said is wrong, because calling those functions
>will
>> result in packets being sent from the device.
>>
>> So, no. Nothing is thread safe, and even polling for sensor data
>could
>> cause issues.
>>
>> Cheers,
>> Ben
>>
>> On Thu, Dec 11, 2014 at 12:12 PM, Ben Hilburn <ben.hilburn at ettus.com>
>> wrote:
>>
>>> Hi Nathan -
>>>
>>> Generally, any UHD function that doesn't involve streaming is *not
>*thread-safe.
>>> So if you called "get_time_now" from two separate threads at the
>same time,
>>> that is *not* a thread-safe operation.
>>>
>>> If all you are doing is polling sensors from a thread that is
>different
>>> from the thread in which you started streaming, you should be OK.
>But, it
>>> is not technically thread safe.
>>>
>>> Cheers,
>>> Ben
>>>
>>> On Tue, Dec 9, 2014 at 1:31 PM, Perelman, Nathan via USRP-users <
>>> usrp-users at lists.ettus.com> wrote:
>>>
>>>> I’ve been assuming that calls to UHD functions that don’t change
>>>> settings on the USRP are generally thread safe and can be called
>from
>>>> another thread even while a capture is ongoing. Is this an accurate
>>>> assumption? The functions I’m calling are get_mboard_sensor() (for
>GPS
>>>> information and ref_locked) and get_time_now(). Thanks.
>>>>
>>>> -Nathan Perelman
>>>>
>>>> _______________________________________________
>>>> USRP-users mailing list
>>>> USRP-users at lists.ettus.com
>>>> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>>>>
>>>>
>>>
>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>USRP-users mailing list
>USRP-users at lists.ettus.com
>http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20141211/7294b317/attachment-0002.html>


More information about the USRP-users mailing list