Tuesday, June 7, 2022

work function sleep

The blocks coding guide (https://wiki.gnuradio.org/index.php/BlocksCodingGuide) suggests that if a blocking function must be used in the work function, that a boost thread call such as sleep should be used.  In my case, I am reading IQ data from a socket using the recvfrom function that I can call as a non-blocking function in a loop containing a sleep function.  Is the following sleep function the right one?

 

boost::this_thread::sleep_for(boost::chrono::milliseconds(10))

 

When I attempt to use this, I get a run-time error message stating  that_ZN5boost6chrono12steady_clkck3nowEv is an undefined symbol.  I expect that this is a linker error.  I have included boost_system in my list of target_link_libraries.  I’m just not sure if this is even the recommended sleep function to call.  Is there another preferred method? 

 

No comments:

Post a Comment