Move scheduler threads to a linked list implementation.

Removes the internal next ptr from the Thread class.

We avoid doing a memory operation when scheduling on yield because we
simply cycle the item to the back of the list.
This commit is contained in:
Drew Galbraith 2023-05-29 14:32:49 -07:00
parent a06c9dced4
commit 71196dc90f
3 changed files with 109 additions and 31 deletions

View file

@ -35,9 +35,6 @@ class Thread {
void SetState(State state) { state_ = state; }
void Exit();
// FIXME: Probably make this private.
Thread* next_thread_;
private:
// Special constructor for the root thread only.
Thread(Process* proc) : process_(proc), id_(0) {}