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

System: Impl spinlock and usleep methods for sys targets #1781

Open
wants to merge 29 commits into
base: 8.2.0-Dev
Choose a base branch
from

Conversation

Dimensionscape
Copy link
Member

@Dimensionscape Dimensionscape commented May 1, 2024

Feature Proposal

This feature change adds a native cross platform sleep and spinlock method with microsecond accuracy.

This helps pave the way for a modular main loop in lime.

This feature change adds a cross platform sleep and spinlock method with microsecond accuracy.
Change conditionals to require only sys
@skial skial mentioned this pull request May 1, 2024
1 task
Dimensionscape and others added 27 commits May 1, 2024 13:31
Reworked the spinlock and usleep implementations and added a timestamp method since we override haxe.Timer and lose access to the high definition stamp for native targets it originally provided.
We need to pass the native time_stamp from cffi for neko and hl.
The main thread can easily look these up by ID, and in HTML5, sending the full `JobData` can cause errors.
`__activeThreads` and `__idleThreads` only need to be allocated for multi-threaded pools. Plus, there's no benefit to using a `List` here; we only add to and remove from the end.

And finally, checking `event.job == null` instead of `isOfType()` is faster and avoids an issue in HTML5. Sadly it is less safe, so we might need to revisit it eventually.
It looks like we'll want to take `BackgroundWorker` in a different direction, so for the moment it's safest not to change anything about it. That way, there's only one historical version to maintain backwards compatibility with.
As with `BackgroundWorker`, we're postponing major changes to give us more time to consider.
While I put a lot of effort into that guide, we're changing several things suddenly, and I don't have time to make sure it's up to date.
Restore old `Future` and `BackgroundWorker` behavior.
These were added for drop-in compatibility with `BackgroundWorker`, but we might not need that level of compatibility. We can discuss adding these back later if there's demand.
Hopefully my last before 8.2.0.
Originally had docs for this but we nixed it for a while so they never got added.
Forgot the properties.
We need more docs!
Missing docs.
Offering four options makes the underlying code more complicated for minimal benefit.
merge develop into feature branch
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.

4 participants