Question

Co-routines and threads

27 Apr 2023
Answer :
Word Count : 312

Co-routines and threads are two different concurrency models used in programming to achieve multitasking or concurrent execution. While they share some similarities, they have distinct characteristics that set them apart. Here is a comparison of co-routines and threads:

Co-routines Threads
Co-routines are a type of sequential execution. Threads are a type of parallel execution.
They allow the program to have multiple entry points. They allow multiple parts of a program to run concurrently.
Co-routines are cooperatively scheduled. Threads are preemptively scheduled by the operating system.
They are lightweight and have low memory overhead. Threads have higher memory overhead due to the stack and other associated resources.
Co-routines _________ ________ ____ _______ _______ ________ ____ ____ _______.
_________ _____ _____ ____ ____ _______ ________ _____ _____ ____ _____.
__________ _______ ____ ______ _____ _____ ___ ____ _________ _____ _________.
__________ ________ ______ ________ _________.
_____ __________ ___ _______ _______ ____ __________ __________ _____.
____ ____ ________ _____ ______ ___.
______ ____ _______ ______ ________.
______ _________ __________ __________ _____ __________ _____.
______ _________ ___ _______ ______.
_________ _____ ____ ______ ____ ______ ____ ___ ______ ______ ________ _________.
____ __________ ______ _____ __________ _______ _____ ______ ______ ____ _________ ________.
_____ _____ ____ _________ _________.
_______ ________ _____ ____ _______ ________ ____ __________ ___ ______ __________ ______.
_____ ________ _____ _________ ______ ____ ___ __________ _______ ____ _____.
_____ _______ ________ ___ ______ ___ ___ ______ ____.
____ _____ _____ ______ ______ ________ ____ ______ ________.
______ __________ ______ ________ _____ _______ _________ _______ _______.
_________ _____ ___ ______ _____ _____ _____ __________ _________ ___.
_____ _______ ______ ___ _______ ____ _______ __________ __________ _____ _______ _________.
____ _______ ____ _______ _________ _______ _______ __________ __________ __________ _______ __________.
__________ ______ _____ ________ ________.
____ _____ ____ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top