Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umd: sync taskQueue operations in Emulator using condition variables #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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