Open poetaman opened 2 years ago
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.
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.
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...