What are the differences between a “coroutine” and a “thread”?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Coroutines are a form of sequential processing: only one is executing at any given time (just like subroutines AKA procedures AKA functions — they just pass the baton among each other more fluidly).
Threads are (at least conceptually) a form of concurrent processing: multiple threads may be executing at any given time. (Traditionally, on single-CPU, single-core machines, that concurrency was simulated with some help from the OS — nowadays, since so many machines are multi-CPU and/or multi-core, threads will de facto be executing simultaneously, not just “conceptually”).