Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

How to store state? #4

@vwkd

Description

@vwkd

Currently we use global variables to store state in a library crate. Is there a better way?

The Golem Cloud apparently uses a single thread1 but if we use tests we have to worry about multiple threads.

We currently use an immutable global variable with a Mutex while the Golem Cloud documentation uses a mutable global variable with unsafe.

Footnotes

  1. "When running a Golem component you don’t have to care about concurrent access of global state - each worker based on the template runs completely separated." golem.cloud

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions