discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: A Question About Gnuradio OOT Block Startup, Sleeping the Block


From: Jeff Long
Subject: Re: A Question About Gnuradio OOT Block Startup, Sleeping the Block
Date: Thu, 15 Dec 2022 08:35:49 -0500

If your block is purely a message source, override start() and have it set an flag, e.g., a pthreads condition or Python threading.Event. The message generation portion (thread?) of your block should wait on the flag before sending anything.

Otherwise, you would be sending messages out in response to work() or handle_msg() calls, which won't happen until the runtime is up and working.

On Thu, Dec 15, 2022 at 7:41 AM Brian Brown <22brianbrown@gmail.com> wrote:
Hi!

I am designing a message in-out OOT block that has a similar structure to the Message Strobe. It is ought to send packets as soon as the Gnuradio runtime permits. I realized that it is necessary to sleep the block off of any work for a short period of time to surpass the "block::start();" initialization. Otherwise, I am assuming, the thread is rushing an output before the Gnuradio scheduler initialization is settled therefore is breaking the runtime and forcing an exit. For now I am sleeping the block to solve the issue for an arbitrary duration, say 1000 ms. I was wondering if there is a recommended sleep duration, block specific or in general that is fixed to all blocks or calculable. Or is there a solid work around to sleeping the thread at all. I have looked for an explanation online and searched through the archives but could not find an answer. Any help would be appreciated.

Thanks in advance!
Brian.

reply via email to

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