[Top][All Lists]

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

[Discuss-gnuradio] Shared resource for source and sink blocks

From: N. Benes
Subject: [Discuss-gnuradio] Shared resource for source and sink blocks
Date: Thu, 25 Apr 2019 13:14:00 +0000

Hi GNU hackers,

what is the accepted best practice to have a source and a sink block
share a common resource?
In my case, the shared resource is a thread that does I/O and both
source/sink use it to interface to GNU Radio.

First I thought about adding the I/O thread to the source block and use
the name of the source as parameter for the sink. However, as I have
seen from the GRC Python code generator implementation this may not
always work because instantiation/initialisation of blocks does not
happen in a particular order (e.g. sources before sinks).

Variables and parameters, on the other hand, are initialised first.
Therefore another approach could be to have the I/O thread in a separate
class, exported from my gr-module and accessible through Python, and
separately instantiated as and assigned to a variable that is passed to
parameters of my source/sink blocks.

Is there a commonly accepted pattern to apply in this situation?

-- nicolas

reply via email to

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