`

Continuation

阅读更多

Continuation

From Wikipedia, the free encyclopedia

Jump to: navigation , search

 

In computing and programming , a continuation is an abstract representation of the control state , or the "rest of computation" or "rest of code to be executed". This is closely linked with what part of the program you are in: which function and which line is being executed. The "current continuation " or "continuation of the computation step" are the instructions that will be executed after the current line of code is executed.


The term continuations can also be used to refer to first-class continuations , which are constructs that give a programming language the ability to save the execution state at any point and return to that point at a later point in the program.


Programs must allocate space in memory for the variables its functions use. Most programming languages use a call stack for storing the variables needed because it allows for fast and simple allocating and automatic deallocation of memory. There are also programming languages that use a heap for this, which allows for flexibility but with a higher cost for allocating and deallocating memory. These two different implementations both have benefits and drawbacks in the context of continuations.[ 1]


Almost all languages have a means for manipulating the order of execution steps (i.e. manipulating the continuation of a computation step). The goto is the most basic form of this. Control structures like if statements , loops , return statements , break statements , and exit are more structured (and limited) ways to manipulate the order of executing instructions and are essentially limited goto statements.


More complex constructs exist as well. For example in C , setjmp can be used to jump from the middle of one function to another function, provided the second function is lower on the stack (if it is waiting for the first function to return, possibly among others). Other more complex examples include coroutines in Simula 67 , tasklets in Stackless Python , generators Icon and Python , continuations in Scala (starting in 2.8), fibers in Ruby (starting in 1.9.1), the backtracking mechanism in Prolog , and threads .  

 

Read More...

分享到:
评论

相关推荐

    Java网络程序员看Continuation

    【标题】"Java网络程序员看Continuation"指出的是Java网络编程中的一种高级概念——Continuation。在Java领域,Continuation通常关联于异步处理和非阻塞I/O,这对于构建高性能、高并发的网络应用至关重要。 【描述...

    jetty-continuation-8.1.8.v20121106-API文档-中文版.zip

    赠送jar包:jetty-continuation-8.1.8.v20121106.jar; 赠送原API文档:jetty-continuation-8.1.8.v20121106-javadoc.jar; 赠送源代码:jetty-continuation-8.1.8.v20121106-sources.jar; 赠送Maven依赖信息文件:...

    WEBIM之Continuation方式实现

    【标题】"WEBIM之Continuation方式实现"主要探讨的是在网络通信中,特别是Web即时通讯(WebIM)场景下,如何利用Continuation技术优化数据传输和处理的方式。Continuation是一种编程模式,它允许将一个操作分阶段...

    Java网络程序员看Continuation .zip

    在Java网络编程中,"Continuation"是一个相对高级的概念,主要与异步处理和非阻塞I/O有关。本文将深入探讨这个主题,为Java网络程序员提供宝贵的见解。 首先,理解"Continuation"的含义至关重要。在编程领域,...

    jetty-continuation-7.4.2.v20110526.jar

    jetty-continuation-7.4.2.v20110526.jar jetty 服务jar包

    Jetty cometd(Continuation)学习笔记

    Jetty cometd(Continuation)学习笔记,自己用的,别人那down的网页

    C#中的尾递归与Continuation详解

    在计算机科学中,Continuation是一种高级控制结构,它允许我们将当前程序的执行状态打包成一个对象,这个对象可以被保存并在稍后恢复执行。在C#中,Continuation通常通过委托(Delegate)或者匿名方法(Lambda表达式...

    jetty-continuation-8.1.8.v20121106-API文档-中英对照版.zip

    赠送jar包:jetty-continuation-8.1.8.v20121106.jar; 赠送原API文档:jetty-continuation-8.1.8.v20121106-javadoc.jar; 赠送源代码:jetty-continuation-8.1.8.v20121106-sources.jar; 赠送Maven依赖信息文件:...

    MATCONT and CL MATCONT-- Continuation toolboxes in matlab

    ### MATCONT 和 CL_MATCONT —— MATLAB 中的连续性工具箱 #### 1. 引言 MATCONT 和 CL_MATCONT 是两个强大的 MATLAB 工具箱,专门用于动力系统(特别是非线性微分方程)的研究。这些工具箱允许用户进行数值分析,...

    CPF.rar_9bus_continuation_dynamic stability_power system_wscc 9

    标题中的"CPF.rar_9bus_continuation_dynamic_stability_power_system_wscc_9"指的是一个关于WSCC(Western Systems Coordinating Council,西部系统协调委员会)9节点电力系统的动态稳定分析项目,其中CPF...

    matcont and cl_matcont continuation toolboxes in matlab

    ### MATCONT 和 CL_MATCONT:MATLAB 中的连续性工具箱 #### 1. 引言 MATCONT 和 CL_MATCONT 是两个强大的 MATLAB 工具箱,专门用于非线性动力系统的研究,尤其是针对微分方程组的数值分析与可视化。...

    jetty-continuation-9.2.9.v20150224.jar

    java运行依赖jar包

    qt-continuation-monad:C++ 中 continuation monad 的基本但有效的实现。 Qt 可以使用它来缓解回调地狱

    C++ 中 continuation monad 的基本但有效的实现。 Qt 可以使用它来缓解回调地狱 特色: boost::optional 、 Continuation和一些 Qt 数据类型的 Monad 实现。 一些基本的一元函数,例如sequence 、 mapM和liftM 。...

    jetty相关的全部jar包

    jetty-security-9.4.8.v20171121.jar,jetty-io-9.4.8.v20171121.jar,jetty-continuation-9.4.8.v20171121.jar,jetty-client-9.4.8.v20171121.jar,jetty-jmx-9.4.8.v20171121.jar,jetty-plus-9.4.8.v20171121....

    continuation-local-storage-presentation

    【标题】"continuation-local-storage-presentation"是一个与JavaScript相关的技术主题,主要聚焦于`continuation-local-storage`(CLS)库的讨论。这个库在JavaScript的异步编程中扮演着重要角色,它提供了一种机制...

    【CVPR2019】C-MIL: Continuation Multiple Instance Learning for Weakly Supervised Object Detection

    【CVPR2019】C-MIL: Continuation Multiple Instance Learning for Weakly Supervised Object DetectionMIL回顾介绍凸性分析Continuation MIL MIL回顾 介绍 MIL将图片视为“包”,Bi∈BB_i\in BBi​∈B为第iii个包...

    jmeter测试相关jar包

    org.eclipse.jetty.continuation_9.1.1.v20140108.jar org.eclipse.jetty.continuation.source_9.1.1.v20140108.jar org.eclipse.jetty.deploy_9.1.1.v20140108.jar org.eclipse.jetty.deploy.source_9.1.1.v...

    Continuation Power Flow (CPF) program

    电力系统联系潮流的matlab计算程序,可以直接运行。-Contact the trend of power system matlab calculation program can be run directly.

Global site tag (gtag.js) - Google Analytics