Skip to content

Avoid thread creation when chaining continuations #2

@jnicholls

Description

@jnicholls

It makes sense to have the promise chain begin in a new thread from Promise::new(), however beyond that the continuations themselves shouldn't be in separate threads of their own. They should all run on the originating thread where the Promise was created.

Apart from the thread locality of the continuations, the idea of creating a separate thread for each continuation is expensive. These aren't green threads, and so I'm afraid this Promise implementation will not scale well when put to the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions