Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
poetaman opened this issue Jan 5, 2022 · 2 comments

Comments

@poetaman
Copy link

poetaman commented Jan 5, 2022

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...

@hnes
Copy link
Owner

hnes commented Jan 5, 2022

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.

@praisethemoon
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants