Skip to content

Thread-safe design #108

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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