Skip to content

lazy-coders/lzc-coro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b1b8052 · Jan 25, 2024

History

24 Commits
Jan 23, 2024
Jan 23, 2024
Jan 23, 2024
Jan 25, 2024
Jan 24, 2024
Jan 22, 2024
Jan 23, 2024
Jan 24, 2024
Jan 24, 2024
Jan 20, 2024
Jan 25, 2024
Jan 23, 2024

Repository files navigation

codecov CMake on Ubuntu with G++-13

lzc-coro - LaZyCoders COROutine library

This small library have the objective of understand coroutine facility. It is too a playground to test some ideas about how coroutines could work.

The basics

This library only implements the task: a coroutine that can do co_await.

All tasks can be awaitable and are created stopped. That means a coroutine do not start executing code until the call to operator() of the task is called.

Loading
sequenceDiagram
    box Grey Main Thread
        participant main
        participant some_task
        participant other_task
    end
    box Grey  Other Thread
        participant async_function
    end
    main->>some_task: operator()
    some_task->>other_task: co_await
    other_task->>async_function: co_await
    Note over other_task,async_function: The coroutine wait until completion<br/>and continues in the original thread
    async_function-->>other_task:resume()
    other_task-->>some_task:resume()
    some_task-->>main:future.get()

About

C++ coroutines implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published