Advanced
C++
Q68 / 100
What are C++20 coroutines and how do they differ from C++ threads?
Correct! Well done.
Incorrect.
The correct answer is B) Coroutines are suspendable functions managed by user code, with zero overhead compared to OS threads which have scheduling costs
B
Correct Answer
Coroutines are suspendable functions managed by user code, with zero overhead compared to OS threads which have scheduling costs
Explanation
C++20 coroutines (co_await, co_yield, co_return) are stackless, suspending at specific points. They have minimal overhead vs OS threads and enable async I/O patterns.
Progress
68/100