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

GThreads: Rewrite __gthread_once() #115

Open
sba1 opened this issue Jan 17, 2022 · 0 comments
Open

GThreads: Rewrite __gthread_once() #115

sba1 opened this issue Jan 17, 2022 · 0 comments

Comments

@sba1
Copy link
Owner

sba1 commented Jan 17, 2022

Since Reschedule() in OS4 does exactly nothing (and was deprecated in the lastest SDK, which may change in the future again), the intended behavour of the current __gthread_once implementation to quickly give up cpu is not met. Also, it is dangerous to poll in case the firstly entred thread A has a lower pri than a one B that enters later because the A preempted over B giving A no chance to continue. Thread A's priority may be risen to the one of B (in general, to the highest one), but this is rather difficult to achieve because we don't know what func does (it could mess around with task pri's as well).

The current way was always be meant as a temporay solution. It is now time to provide a correct solution possibly involving semphores.

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

No branches or pull requests

1 participant