Processes, threads, green threads, protothreads, fibers, coroutines: what's the difference?

前端 未结 4 1469
孤城傲影
孤城傲影 2021-01-29 18:27

I\'m reading up on concurrency. I\'ve got a bit over my head with terms that have confusingly similar definitions. Namely:

  • Processes
  • Threads
  • \"
4条回答
  •  长情又很酷
    2021-01-29 18:48

    Protothreads are great when implementing sequential state machines. Protothreads are not really threads at all, but rather a syntax abstraction that makes it much easier to write a switch/case state machine that has to switch states sequentially (from one to the next etc..).

    I have used protothreads to implement asynchronous io: http://martinschroder.se/asynchronous-io-using-protothreads/

提交回复
热议问题