std::this_thread::yield()
Posted: Sun Aug 05, 2018 1:26 pm
Hi,
I just got back into development for the ESP32 after a few months of absence. First thing I wanted to do was to bring my Smooth framework up to par with the current IDF master-branch (and later the CMake-branch). To that end I've deployed the tool chain on a fresh Ubuntu 18.04.
I've got a task that either handles socket communication or calls std::this_thread::yield(). In my test applications that don't use any sockets, this task literally only calls std::this_thread::yield() over and over. This has been working fine since October last year (based on the git history for the code line in question). The last app I wrote was in April and this still functioned at that time.
With the current version of IDF/toolchain the yield call seems to have no effect as the watchdog for idle-tasks gets triggered and the task seemingly just spins:
So, my question is: Are there any recent (April and later) changes to the scheduler that would affect(break?) std::this_thread::yield()
I just got back into development for the ESP32 after a few months of absence. First thing I wanted to do was to bring my Smooth framework up to par with the current IDF master-branch (and later the CMake-branch). To that end I've deployed the tool chain on a fresh Ubuntu 18.04.
I've got a task that either handles socket communication or calls std::this_thread::yield(). In my test applications that don't use any sockets, this task literally only calls std::this_thread::yield() over and over. This has been working fine since October last year (based on the git history for the code line in question). The last app I wrote was in April and this still functioned at that time.
With the current version of IDF/toolchain the yield call seems to have no effect as the watchdog for idle-tasks gets triggered and the task seemingly just spins:
Exchanging the yield() call to a less desirable std::this_thread::sleep_for(std::chrono::milliseconds(1)); remedies the situation.Task watchdog got triggered. The following tasks did not reset the watchdog in time:
- IDLE (CPU 0)
Tasks currently running:
CPU 0: pthread
CPU 1: IDLE
So, my question is: Are there any recent (April and later) changes to the scheduler that would affect(break?) std::this_thread::yield()