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

Native worker "preemption" via monitor thread #86

Open
KCreate opened this issue Mar 31, 2022 · 0 comments
Open

Native worker "preemption" via monitor thread #86

KCreate opened this issue Mar 31, 2022 · 0 comments
Labels

Comments

@KCreate
Copy link
Owner

KCreate commented Mar 31, 2022

  • System monitor thread
    • Checks if worker threads exceed their alloted timeslice
    • Detects idle processors and assigns new worker threads
  • Worker threads inside native mode that exceed their alloted timeslice will be marked as preempted by the system monitor thread.
    • The runtime will release the processor from the worker thread and will return it to the idle list of processors
    • The system monitor now detects that there are idle processors, but no idle worker threads, so the runtime will start a new worker thread that acquires the processor
    • Once the prempted worker thread returns from the native section it will check if it was preempted
    • If the worker was pre-empted, we try to reacquire the old processor
    • If reacquiring the old processor fails, try to acquire another idle processor
    • If there are no idle processors, idle the current worker thread and reschedule the running fiber into the global runqueue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant