LimeSDR C API continious read and write stream

Hello everyone. I’m new to SDR developement on “non pure realtime systems”. I’ve been working with a Lms6002d in combination with an MCU, receiving samples with the parallel port of my MCU.

I’ve moved to a LimeSDR Board (USB 3.0 one 2Tx-2Rx) and i’m trying to develop a simple read-write stream loop with the LimeSDR C API as well as the SoapySDR. In my real time MCU i read blocks of samples using a DMA with interrupts with a ping pong buffer for real time signal processing. I would like to emulate this behaviour in a linux desktop PC.

As far as i’ve seen in examples the whole main thread is blocked by a while loop transmitting and receiving a certain amount of samples. When i try to add some signal processing through other threads, the RX buffer becomes full rather quickly and there’s no recover from this situation. Why is this happening?

How can i implement a ping pong buffer in TX and RX emulating an event driven system (DMA interrupt like)?
Is this the correct approach to create an application using an SDR ?
Where can i find some reference code or literature on what i’m trying to do?

Here’s what im trying to do so far with 2 LimeSDR in parallel. I’ve tryed with only one as well but with no success at all.