Coroutine 协程
https://en.wikipedia.org/wiki/Coroutine
Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
According to Donald Knuth, Melvin Conway coined the term coroutine in 1958 when he applied it to construction of an assembly program.[1] The first published explanation of the coroutine appeared later, in 1963.[2]
协程是计算机程序的一类组件,推广了协作式多任务的子程序,允许执行被挂起与被恢复。相对子例程而言,协程更为一般和灵活,但在实践中使用没有子例程那样广泛。协程源自Simula和Modula-2语言,但也有其他语言支持。协程更适合于用来实现彼此熟悉的程序组件,如协作式多任务、异常处理、事件循环、迭代器、无限列表和管道。
根据高德纳的说法, 马尔文·康威于1958年发明了术语coroutine并用于构建汇编程序。[1] [2] 协程最初在1963年被提出。[2]
Implementations for C#
- MindTouch Dream - The MindTouch Dream REST framework provides an implementation of coroutines based on the C# 2.0 iterator pattern
- Caliburn - The Caliburn screen patterns framework for WPF uses C# 2.0 iterators to ease UI programming, particularly in asynchronous scenarios.
- Power Threading Library - The Power Threading Library by Jeffrey Richter implements an AsyncEnumerator that provides simplified Asynchronous Programming Model using iterator-based coroutines.
- The Unity game engine implements coroutines.
- Servelat Pieces - The Servelat Pieces project by Yevhen Bobrov provides transparent asynchrony for Silverlight WCF services and ability to asynchronously call any synchronous method. The implementation is based on Caliburn's Coroutines iterator and C# iterator blocks.
- [9] - The .NET 2.0+ Framework now provides semi-coroutine (generator) functionality through the iterator pattern and yield keyword.
C# 5.0 includes await syntax support.
Implementing Unity's Coroutines on Winforms and WPF Applications
Coroutine 协程的更多相关文章
- Coroutine(协程)模式与线程
概念 协程(Coroutine)这个概念最早是Melvin Conway在1963年提出的,是并发运算中的概念,指两个子过程通过相互协作完成某个任务,用它可以实现协作式多任务,协程(coroutine ...
- Kotlin Coroutine(协程): 二、初识协程
@ 目录 前言 一.初识协程 1.runBlocking: 阻塞协程 2.launch: 创建协程 3.Job 4.coroutineScope 5.协程取消 6.协程超时 7.async 并行任务 ...
- Kotlin Coroutine(协程): 一、样例
@ 目录 前言 一.直接上例子 1.延时任务. 2.异步任务 3.并行任务: 4.定时任务: 总结 前言 你还在用 Hanlder + Message? 或者 AsyncTask? 你还在用 Rxja ...
- coroutine协程
如果你接触过lua这种小巧的脚本语言,你就会经常接触到一个叫做协程的神奇概念.大多数脚本语言都有对协程不同程度的支持.但是大多编译语言,如C/C++,根本就不知道这样的东西存在.当然也很多人研究如何在 ...
- [Unity-22] Coroutine协程浅析
1.概念解释 协程并非一个独立的线程.在Unity中.全部的语句都是在一个线程中运行的,也就是说.Unity是单线程的(详细的能够參见http://blog.csdn.net/alexander_xf ...
- 利用swoole coroutine协程实现redis异步操作
<?php #注意:如果不开启兼容模式,会遇到这样的现象,用swoole协程的方法访问常规方法添加到redis中的数据,可能访问不到(直接返回NULL)!这可能是两者采用了不同的技术标准所致! ...
- Kotlin Coroutine(协程): 三、了解协程
@ 目录 前言 一.协程上下文 1.调度器 2.给协程起名 3.局部变量 二.启动模式 CoroutineStart 三.异常处理 1.异常测试 2.CoroutineExceptionHandler ...
- Android中的Coroutine协程原理详解
前言 协程是一个并发方案.也是一种思想. 传统意义上的协程是单线程的,面对io密集型任务他的内存消耗更少,进而效率高.但是面对计算密集型的任务不如多线程并行运算效率高. 不同的语言对于协程都有不同的实 ...
- Kotlin Coroutine(协程): 四、+ Retrofit
@ 目录 前言 一.准备工作 二.开始使用 1.简单使用 2.DSL 3.扩展函数 4.请求发起 总结 前言 Retrofit 从 2.6.0 版本开始, 内置了对 Kotlin Coroutines ...
随机推荐
- Vue列表动画----自己做的
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- SQLSEVER刚建表时主键自增
alter table 表名 drop column ID alter table 表名 add ID int identity(1,1)
- 【DRF框架】路由组件
视图组件涉及的路由补充: from rest_framework.viewsets import ViewSetMixin 对路由进行了重新的分发,重写了as_view() 方法,重新封装了请求方法 ...
- 【问题】man命令打开的手册上链接怎么展开?
参考:How to follow links in linux man pages? 前言 在使用man查看命令帮助的时候,有些文字下面会有下划线.给人的感觉是一个链接,但是又打不开.那么到底是不是链 ...
- Win8.1 Anaconda下安装第三方库,以jieba wordcloud为例
最近在看情感分析的东西,于是在spyder里import jieba,and then就报错了. 百度之后,发现jieba是一个第三方库,它并不存在于anaconda内置的packages中.所以在用 ...
- evpp return index.html
https://github.com/yuqingtong1990/ggtalk_server/blob/99f0f85c683dc0a0c3e76dcae611f60f6456eed6/server ...
- python学习之flask接口开发,环境变量扩展,网络编程requests
python基础 flask之mock接口 所谓mock接口,其实就是我们在正式接口还没联调或者是测试接口没有正式使用时,自己创建一个模拟接口,来供项目暂时打通功能或者测试流程梳理的桥梁,而我们这儿使 ...
- 优雅的处理vue注册全局组件
使用情景: 有频繁使用的组件 需要进行全局注册 可以将这些组件都放在components下同一个文件夹下,在此文件夹中建立 一个js文件 代码如下: import Vue from 'vue'; // ...
- Robot Framework--用例、数据、流程分离例子
如果想改变输入框的输入词,则需要不停的复制case,为了减少冗余,可以做一个简单的分层,把搜索流程剥离成一个关键字,然后再不同的case中调用这个关键字,然后传递不同的参数,以进行不同数据在同一流程下 ...
- 网站入侵工具 SQL注入神器
0x 00 前言 SQLMAP 0x 01 注入原理 不说了 *****************************************结束分割线********** ...