-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
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:
- To use a context, you must create a derived class that implement the
schedule()virtual API - 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. - Context operates as usual.
- 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