-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix missing scheduler on Linux and Windows (JVM) #1503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want to block the release, but it seems to me that the scheduler C-API should be reworked to enable us to generate the generic scheduler and not the default that could fail. Maybe file an issue for that.
Assuming that you actually verified this on the GHA branch?
|
||
realm_scheduler_t* | ||
realm_create_generic_scheduler() { | ||
return new realm_scheduler_t{realm::util::Scheduler::make_generic()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Seems weird that the C-API offers an API around default schedulers that aren't necessarily supported and does not have a API for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, it feels weird. I'll file an issue in Core for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using DummyScheduler
(via Scheduler::make_dummy()
) its implementation is simpler & platform agnostic (is_on_thread
doesn't invoke std::this_thread::get_id
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that one doesn't do anything, correct? Which seems to make it dangerous to use unless specifically requested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the goal, the generic one also don't do anything. They are mainly used for use case where we want to open a Realm without notifications (like the Frozen Realms or when doing a compact). The dummy scheduler's implementation is slightly simpler that's all (both don't deliver anything)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy once CI is happy.
|
||
realm_scheduler_t* | ||
realm_create_generic_scheduler() { | ||
return new realm_scheduler_t{realm::util::Scheduler::make_generic()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
|
||
realm_scheduler_t* | ||
realm_create_generic_scheduler() { | ||
return new realm_scheduler_t{realm::util::Scheduler::make_generic()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using DummyScheduler
(via Scheduler::make_dummy()
) its implementation is simpler & platform agnostic (is_on_thread
doesn't invoke std::this_thread::get_id
)
Closes #1502
This PR aligns the behavior of schedulers across all platforms. Previously Darwin was using their custom run-loop, which was why it worked there while Linux and Windows failed.
The fix has been verified on Github Actions: https://github.com/realm/realm-kotlin/actions/runs/6098168339