discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Threaded model for USRP2 source


From: Johnathan Corgan
Subject: Re: [Discuss-gnuradio] Threaded model for USRP2 source
Date: Thu, 23 Jul 2009 10:00:25 -0700

On Thu, Jul 23, 2009 at 08:13, Douglas
Geiger<address@hidden> wrote:

> It seems to me that the
> obvious thing to do is have separate threads doing the work of the
> rx_handler code - which just constantly check if samples are available, and
> put them in a queue/vector/something (perhaps a deque would be best - since
> I can add to the end, and pop off the front...), and the main thread of the
> block then just polls the queue/etc. for incoming samples, rather than
> calling rx_handler only when the scheduler calls the work() function.

In your situation, you are using two USRP2s on two different GbE
ports, and trying to time align samples for your output, correct?

You could create two (more won't help) separate service threads, each
calling into libusrp2 to receive frames and metadata, and have
rx_samples copy them into whatever synchronized data structure you
need.  Your block main thread that calls work() can read from your
data structure (again, using synchronization primitives), and copy the
time aligned output samples to the block output buffers.  (You'll need
to decide how to deal with missing frames from either USRP2, but
that's another conversation.)

libusrp2 will have a user space thread per USRP2, and your block will
have three threads, so this is five in total.  You may need to
experiment with thread placement so the right threads share a
processor/cache to avoid trips to main memory.

Remember, you are trying to move 200 Mbytes/sec around multiple times,
and eventually do math on them--it's not a trivial task.

Johnathan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]