pothosware / SoapySpyServer

SoapySDR plugin for remotely accessing SpyServer devices
GNU General Public License v3.0
22 stars 1 forks source link

For async reads, replace current thread-safe queue with fixed-size container #4

Closed ncorgan closed 2 years ago

ncorgan commented 2 years ago

The thread-safe buffer currently being used has a std::queue under the hood, which will allocate memory to allow more elements to be added. Potentially, if the caller activates a stream but doesn't read, this queue could continue to allocate memory until it runs out. This is unlikely to happen, but it's a simple failure mode to address.

It should be replaced with a container that has a fixed-size container that tracks an overflow. See: https://github.com/pothosware/SoapyHackRF/blob/master/HackRF_Streaming.cpp#L44