discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Multithreading in GR blocks


From: Moses Browne Mwakyanjala
Subject: Re: Multithreading in GR blocks
Date: Mon, 13 Apr 2020 19:21:24 +0200

Hi Marcus,
I was trying to emulate how the ZMQ block handles multithreading. Basically, the ZMQ block overrides the stop() function and joins the threads. This is the same thing I tried to do to stop the receive and listen threads. Is there any other way of doing this?
bool
TCPServer::stop()
{
    m_bFinished = true;
    m_ReceiveThread->join();
    m_ListenThread->join();
    return true;
}
Regards,
Moses. 

On Mon, Apr 13, 2020 at 7:11 PM Marcus Müller <address@hidden> wrote:
Hi Moses,

your code doesn't show how your GNU Radio block's stop() function would
tell your TCP Server thread that it's time to shut down, so I presume
that doesn't happen – that would explain why the flow graph can't ever
shut down!

Best regards,
Marcus

On 13.04.20 18:54, Moses Browne Mwakyanjala wrote:
> Hello everyone,
> I have created a TCP/IP block by adapting the ZMQ message pub block.
> Both blocks make use of boost multithreading. The TCP/IP block is used
> by a standalone C++ program. To run the gnuradio topblock, the C++
> program calls tb->start() function. To stop the topblock, the
> functions tb->stop() and tb->wait() are called.However, the program
> "hangs" when tb->stop() is called. This suggests there is something
> wrong with the way I use boost multithreading. 
> All help is appreciated.
>
> Regards,
> Moses. 


reply via email to

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