Skip to content

Interaction with worlds from multiple threads #1

@popcron

Description

@popcron

all allocations are created on the thread that the World instance is created from. if there is system A and B, and both are on their own threads, the easiest way to have them update is inside a while(true) statement. but then any modifications to the world needs to be submitted as an event, that then gets processed on the causal thread. or both systems exist on the main thread, but within their update callback they will use a thread from ThreadPool (so its reused 1 thread per update, or 1 thread in total, per system).

the while(true) approach will probably require some kind of sync mechanism, so that it only performs its code when there are no outstanding commands to handle.

benchmarks for how systems can scale would be good for this, to compare reusing threads to a single thread per system.

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