Skip to content

Native worker "preemption" via monitor thread #86

Description

@KCreate
  • 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

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions