Jump to: navigation, search

TaskMachine

Concept

Allow for arbitrary tasks to run on a machine and give tasks the ability to push new tasks onto the machine for running as well as support tasks having the ability to perform if operations (by popping 2 items off the stack and pushing only one back on). This will allow for a very dynamic capability and simulates a virtual machine in concept. The additional part that taskflow will require is the ability to save/restore the machine (for resumption elsewhere) and the ability to revert (which will require a completion list and checkpoints in said list) to know exactly what tasks the machine has ran and the ability to walk backwards through said tasks to the last checkpoint (or through the whole list).

Similarities: yes the similarities to how a virtual machine runs is on purpose, a stack machine powering tasks inside a virtual machine provisioning cloud is pretty cool.

Key functionality

  • Allows for arbitrary complex tasks.
  • Easily supports sub-tasks.
  • Easily supports conditional 'tasks' or operators.

How it could run

  • Initial task gets pushed onto stack and processor pops task and executes it.
  • Task declares provided inputs it needs to run.
    • Possibly by asking for variables from the task memory, note it does not get full r/w access to task memory.
  • Task declares provided outputs it will write to.
    • These will be provided as read/write areas to task memory.
  • Task also can request that it receive other X items also on the stack (needed for conditional operators).
  • Task performs operation on variables and returns (new stack items, status) that will go on stack (or none).
  • Processor continues popping tasks and executes tasks until no more tasks on stack.
    • For each task completed, push said completed task onto completion list (for later reverting, if needed).

How it could save

Machine would save current task memory, current stack and current completion list.

How it could restore

Machine would restore memory, stack, completion list and continue running.

How it would resume

See restore :-)

Unknowns

  • What is task memory (is it the task details objects/logbook and its persistent storage?)
  • How should the completion list be stored (is that also the logbook?)?
  • Does reverting go back to last checkpoint, or all the way back (or both)

Diagram

Task machine.png