Skip to content

Conversation

rpelke
Copy link

@rpelke rpelke commented Aug 3, 2020

We had a synchronisation problem with the Emulator threads on our VP.
The first thread waits for 500ms until a task is pushed into the taskQueue. The second thread pushes a task in the taskQueue and waits until the first thread has processed the task using 'sched_yield'.
Because the first thread is still waiting (500ms), the scheduler repeatedly switches to the second thread, which yields its computation time.
Due to that the 500ms are simulated very slowly on our VP.

We synchronised the two threads using condition variables, such that the seconds thread notifies the first thread if he has pushed a task in the taskQueue and the first thread notifies the second one if he has processed the task. Both threads are also sensitive to the shutdown signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant