Skip to content

Merge scheduler with context #39

@kammce

Description

@kammce

Rather than make a scheduler as a separate type that has its separate lifetime, we should couple the concepts and even eliminate the allocation APIs all together.

The work flow is like this:

  1. To use a context, you must create a derived class that implement the schedule() virtual API
  2. That derived context must call a function called context::initialize(span). This provides the memory to the context to be used as its stack. This memory can be dynamically allocated, can be apart of the object's memory (would require the object to be immovable), or be a statically allocated buffer.
  3. Context operates as usual.
  4. Context on destruction no longer deallocates memory, that is the responsibility of the derived class.

Note: It would be wise, to allow the context object to be trivially relocatable, that the stack pointer be allocated on the stack as the first word, vs keeping it within the context object.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions