Skip to content

Do libaco coroutines run on different CPUs at the same time. i.e. does the program performance benefit from having multiple CPUs #52

Description

@poetaman

Do libaco coroutines run on different CPUs at the same time. i.e. does the program performance benefit from having multiple CPUs? Or do coroutines run on only one CPU at any given point of time. In that case, libaco could used in conjunction to a standard threading library I guess...

Activity

  1. hnes commented on Jan 5, 2022

    @hnes
    Owner

    Do libaco coroutines run on different CPUs at the same time. i.e. does the program performance benefit from having multiple CPUs?

    Nope. At least not yet.

    Or do coroutines run on only one CPU at any given point of time. In that case, libaco could used in conjunction to a standard threading library I guess...

    Yes.

    libaco currently is only a C coroutine library and has no feature-rich scheduler yet.

  2. praisethemoon commented on Jan 22, 2022

    @praisethemoon

    Hi there! I just wish to extend on @hnes answer and elaborate a bit, coroutines are not thread or parallel processes. They allow "routines" to be executed concurrently for example, say you have two coroutines, the programmer can have the freedom to run some parts of the first one followed by some parts of the second one then finish the first one later etc. I recommand the following readings for more information: https://stackoverflow.com/questions/1934715/difference-between-a-coroutine-and-a-thread and https://stackoverflow.com/questions/7224625/what-are-the-benefits-of-coroutines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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