Preface

I will write a series of posts about the context switch. Aiming to answer these questions:

  • What is a context switch?
  • When we need to switch context?
  • What’s a process / thread / coroutine(user-space thread)?
  • Applicable scenarios for each option.
  • Digging into some coroutine libraries, the pros and cons of each.
    • boost coroutine
    • marl
    • co
    • libtask
    • bthread
    • goroutine
    • libuv
    • libco
    • libaco
    • boos::fiber
  • Why X uses coroutine? (e.g: gateway, crawler)
  • Why X not use coroutine? (e.g: mysql)
  • Why linux (and other os) doesn’t have coroutine built-in?
  • why system call is slow/expensive?

Outline

There are 3 articles published currently: