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

Factored event queue into its own class and fixed race condition between multiple starting enclaves #45

Merged
merged 5 commits into from
May 16, 2023

Conversation

cmnrd
Copy link
Contributor

@cmnrd cmnrd commented May 15, 2023

This PR does two things:

  1. Code that is related to managing the event queue is factored out from the Scheduler class and moved to a new EventQueue class. This makes the event queue fully encapsulated and simplifies the scheduler.
  2. This fixes a race condition that could occur during startup in enclave programs with cycles. All enclaves initialize their logical time to zero. Only at startup they advance their logical time to the start tag. In conjunction with the tag acquiring mechanism implemented in Enclave connections and enclave coordination #44 this creates a race. Another enclave that started up already could send acquire requests, which leads to empty events being inserted in the event queue. These acquire request, however, might be issued for tags that are earlier than the start tag. In consequence, we might end up with a situation where we advance time to the start tag, but we have (empty) events in the queue that lay in the past. This is fixed by protecting the start method with a mutex and by discarding any empty events that are scheduled before the start tag.

@cmnrd cmnrd requested a review from tanneberger May 15, 2023 15:42
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Well documented also... 👍

@cmnrd cmnrd merged commit 10a8055 into master May 16, 2023
8 checks passed
@cmnrd cmnrd deleted the enclave-connections branch May 16, 2023 07:19
@cmnrd cmnrd added the enhancement Enhancement of existing feature label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants