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: Marcus Müller
Subject: Re: Passing real data from a thread to the next block
Date: Sun, 15 Nov 2020 19:50:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

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]