discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Passing real data from a thread to the next block


From: isaac mario tupac davila
Subject: Re: Passing real data from a thread to the next block
Date: Tue, 17 Nov 2020 20:35:14 -0500

Hi Marcus

Thanks for your answer. I am restructuring the design of my OOT block.

I'd like to ask a last question about it...I am trying to send some commands (array of bytes) to an external hardware only ONCE before starting with my real time data acquisition . The problem is that if I implement the sending of the commands in the general work of my block, the commands will be sent each time the general work finishes and starts again. My solution proposed is to begin the execution of my flowgraph and send an external signal (specifically kill -SIGIO PID) from terminal to call the implemented method which sends the commands, so that my general work will only focus on the data acquisition and I will send the commands only once.

My question is: Is there a facility or tool that GNU Radio gives me to solve this situation? There should be a more suitable solution.

Any help or recommendation would be appreciated.
Thanks

Regards
Isaac.



El dom., 15 nov. 2020 a las 13:50, Marcus Müller (<mmueller@gnuradio.org>) escribió:
Hello,

On 15.11.20 06:26, isaac mario tupac davila wrote:
> Hello
>
> I'm Isaac.

Hi Isaac, nice having you.

> I have a question about threads..... I've created three
> threads and I want to pass real data from one thread to the next block
> directly without returning to the general work method.

That sounds like a misguided design approach. Please don't do that.

The work function is meant to be seen as atomically processing a bit of
data from its input to its output.

If you need asynchronous messaging, then use the msg_passing facilities.
These make sure you don't change the state of the block while its
general_work is executing.

> I could give
> value to the out array in the thread but for some reason the data
> doesn't pass to the next block. I am not sure if it's because I didn't
> put: return noutput_items in the thread,

What you describe as thread makes no sense – the way GNU Radio is,
there's exactly one thread executing a block's general_work at a time,
and that's the thread of the block_executor. And `return` ends that
execution; that's how C++ works.

> as normally this is in the
> general work method... I also add that the function is defined in the
> thread as void*function and I defined the out array as a complex<short>*.
>
> Any help would be appreciated.

I'm afraid there's something not GNU Radio-compatible in the way you've
architected your system, but we sadly don't know your system well enough
to comment on what to change.

Best regards,
Marcus


reply via email to

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