Skip to content

Concurrent I/O on a single thread #3300

@gaborcsardi

Description

@gaborcsardi

I wonder if anyone has advice on implementing tracing for an application that is single threaded and uses I/O driven concurrency to serve multiple requests. It seems to make sense to have a separate span for each concurrent request.

I understand that the current context storage implementation with thread-local storage works just fine when people use threads to implement concurrency. But I am not sure what would be the best way to handle multiple context stacks within the same thread.

Maybe I could implement a different context storage (i.e. RuntimeContextStorage) that has methods to duplicate the current context stack, switch to another context stack, etc.? Then I would manage these context stacks manually. Do you think that this is possible? Or is there a better way to go about this?

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