Skip to content

Describe CoreLib robot threading model #8

Description

@MB3hel

Describe the threading model in developer docs. Important to know what should be thread safe based on when it will be called.

Brief description:

  • Main thread: runs watchdog (may disable robot and devices)
  • Scheduler thread pool (many threads)
    • Robot child class periodic functions
    • Action child class periodic & shouldContinue functions (probably finish function too?)
    • Action child class begin function (since actions can be started from robot periodic functions)
  • Network thread
    • Robot child class enabled / disabled functions
    • Other things?
  • TODO: Camera stream threading (especially how it relates to frame callback)
  • TODO: Details on arduino thread
  • Other threads? I think some devices still use dedicated threads instead of the scheduler. Should just be internal use though.

Some rework of threading may also be warranted. Minimally moving all dedicated threads (eg Arduino threads, network thread, device-specific threads) to scheduler organizationally so it is clear what is going on looking at the code. Also ideally would minimize number of dedicated threads. But that is not directly in scope for docs (though after writing up current state may be a good time to break down cleanup for CoreLib issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions