coroutine资源索引
coroutine (通常被譯為“協(xié)作程序”或"共行程序“)是程序設(shè)計(jì)中一個(gè)非常重要的概念,通常可用于多任務(wù)協(xié)作處理、迭代器和管道中。它最早出現(xiàn)于”Design of a Separable . Transition -Diagram Compiler “這篇論文中,taocp (the art of computer programming)第一卷1.4.2節(jié)也對(duì)這個(gè)概念進(jìn)行簡單的講解。Building Coroutines 用圖示來說明coroutine的概念。c語言中實(shí)現(xiàn)coroutine有以下幾種方法:
(1)Coroutines in C
(2)使用c標(biāo)準(zhǔn)庫的setjmp和longjmp函數(shù),例如:
Coroutines in less than 20 lines of standard C
(3)unix/linux等遵守posix規(guī)范的系統(tǒng)提供了getcontext, setcontext, makecontext and swapcontext ,可以用來實(shí)現(xiàn)coroutine
(4)其他一些coroutine庫,例如:libtask ,libpcl ,libCoroutine ,coro ,libconcurrency ,libcoro
總結(jié)
以上是生活随笔為你收集整理的coroutine资源索引的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: QT5 QSqlQuery的SELECT
- 下一篇: pyinstaller 打包python