Skip to content

Thread-safe design #108

@sosthene-nitrokey

Description

@sosthene-nitrokey

The current bindings are not thread (or embedded tasks) safe. Everything is !Send & !Sync.

Here's how we could have an implementation that could be thread safe:

Create a trait that abstracts over Mutex and Refcell. Implement this trait for Refcell, std::sync::Mutex, critical-section based implementation and the rtic mutex (with the relevant feature flags).
Allow downstreams to implement and provide their own mutexes.

Switch all Refcell usage to this Mutex, this should make everything thread-safe I think.

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