Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Coroutine


Related Topics

  
  Coroutine - Wikipedia, the free encyclopedia
Coroutines originated as an assembly-language technique, but are supported in some high-level languages, Simula and Modula-2 being two early examples.
Coroutines are well-suited for implementing more familiar program components such as cooperative tasks, iterators, infinite lists, and pipes.
Coroutines in which subsequent calls yield additional results are often known as generators.
en.wikipedia.org /wiki/Coroutine   (1175 words)

  
 Squawks of the Parrot: What the heck is: a coroutine   (Site not responding. Last check: 2007-10-07)
Coroutines are almost always closures, though strictly speaking they don't have to be--if you had a language that didn't have closures, or lexical variables, you could still have coroutines.
The problem with returning coroutine objects is that it forces the calling code to know that it is calling a coroutine, which limits the utility of coroutines in some cases.
It "returns" from "the current coroutine" to "the invoking (co)routine)" while retaining the ability for "the current coroutine" to continue from where it is by being "reinvoked".
www.sidhe.org /~dan/blog/archives/000178.html   (1848 words)

  
 Coroutines   (Site not responding. Last check: 2007-10-07)
Coroutines are used in discrete simulation languages and, for some problems, provide a control structure that is more natural than the usual hierarchy of subprogram calls.
Coroutines may be thought of as subprograms which are not required to terminate before returning to the calling routine.
The address of the CI for the resumed coroutine is obtained from the activation record of the resumed coroutine.
cs.wwc.edu /~aabyan/PLBook/book/node213.html   (201 words)

  
 Xalan-Java 2.7.0: Class CoroutineManager
Most coroutine systems also provide a way to pass data between the source and target of a resume operation; this is sometimes referred to as "yielding" a value.
The fact that only one of a group of coroutines is running at a time, and the control transfer between them is explicit, simplifies their possible interactions, and in some implementations permits them to be implemented more efficiently than general multitasking.
In the standard coroutine architecture, coroutines are identified by their method names and are launched and run up to their first yield by simply resuming them; its's presumed that this recognizes the not-already-running case and does the right thing.
xml.apache.org /xalan-j/apidocs/org/apache/xml/dtm/ref/CoroutineManager.html   (1105 words)

  
 [No title]   (Site not responding. Last check: 2007-10-07)
Second, it may be viewed as a partition of a set of coroutines (objects) that exist at any moment of a computation into subsets and as the indication which transitions are possible and what are the conditions necessary to move a coroutine from one set (read: state) into another.
Second, it is the instruction attach(c) which suspends the currently executed coroutine, and moves the processor to the object c where the execution is resumed at the last point of suspension.
The means of the activation-passivation are: attach to an explicitly named coroutine, or detach return the processing ability to the coroutine-object to the coroutine-object that activated the currently active coroutine.
aragorn.pb.bialystok.pl /~salwicki/progobi/coroutin.doc   (1834 words)

  
 Man page of PCL
Coroutines are a very simple cooperative multitasking environment where the switch from one task to another is done explicitly by a function call.
Coroutines are a lot faster than processes or threads switch, since there is no OS kernel involvement for the operation.
The first time the coroutine is executed, its entry point func is called, and the data parameter used during the call to co_create is passed to func.
www.xmailserver.org /pcl.html   (780 words)

  
 Coroutine for Java
Coroutine also enables you to dynamically build callable wrappers around Java methods so external functions can call Java methods as if they are native functions.
Strings and byte arrays are passed indirectly by copying them to the external heap, that is, Coroutine allocates a buffer big enough to accommodate all data, copies data to the buffer, and passes the address of the buffer to the function.
Coroutine allocates the buffer on external heap, copies String’s/array’s bytes, and passes the address of the buffer to the function.
www.nevaobject.com /_docs/_coroutine/coroutine.htm   (5150 words)

  
 PEP 342 -- Coroutines via Enhanced Generators
Coroutines are a natural way of expressing many algorithms, such as simulations, games, asynchronous I/O, and other forms of event- driven programming or co-operative multitasking.
Python's generator functions are almost coroutines -- but not quite -- in that they allow pausing execution to produce a value, but do not provide for values or exceptions to be passed in when execution resumes.
Any non-generator value yielded by a coroutine is returned to the coroutine that "called" the one yielding the value.
www.python.org /dev/peps/pep-0342   (2727 words)

  
 11 The Coroutines Module (coroutines.hhf)   (Site not responding. Last check: 2007-10-07)
In addition to these class procedures and methods, the coroutine package provides a coret procedure that is useful for returning from a coroutine to whomever "cocalled" the coroutine.
Coroutines execute using their own stack (independent of other coroutine stacks and independent of the stack the main program uses).
This is the mechanism you use to invoke a coroutine.
webster.cs.ucr.edu /AsmTools/HLA/HLADoc/HLAstdlib/hlastdliba12.html   (940 words)

  
 [No title]   (Site not responding. Last check: 2007-10-07)
Exactly one coroutine is always executing while the others are in a suspended (interrupted) state.
Before calling any of the other coroutine primitives this routine must be called with the state record of the main coroutine as a parameter.
It is an error to terminate the main coroutine or to pass control to a terminated coroutine.
www.cs.utu.fi /staff/rlahdelma/Simul/COROUTIN.H   (259 words)

  
 [No title]
Coroutines can save processor overhead and reduce redundancy because they allow you to stop execution of a procedure midstream, return a value, and resume exactly where the procedure left off.
Coroutines can be thought of as methods which, instead of returning to the caller, stop dead in the middle of processing and yield a value to the caller.
The presence of coroutines in a language is a convenient alternative to both of these options because they let you yield the nodes as they are encountered.
msdn.microsoft.com /msdnmag/issues/03/09/coroutinesinnet   (3930 words)

  
 [No title]   (Site not responding. Last check: 2007-10-07)
To the coroutine A that does # the.tran,.tran acts like an ordinary function call: another # coroutine B can.tran back to it later, and if it does A's.tran # returns the 'data' argument passed to B's tran.
E.g., # # in coroutine coA in coroutine coC in coroutine coB # x = co.tran(coC) co.tran(coB) co.tran(coA,12) # print x # 12 # # The data-passing feature is taken from Icon, and greatly cuts # the need to use global variables for inter-coroutine communication.
It's # a good idea to.kill() coroutines you're done with, since the # current implementation consumes a thread for each coroutine that # may be resumed.
www.cs.tu-berlin.de /usr/python/src/Python-2.1/Demo/threads/Coroutine.py   (354 words)

  
 ASPN : Python Cookbook : Coroutines in Python   (Site not responding. Last check: 2007-10-07)
With coroutine I mean a construct as available, for example, in Simula 67 or Modula2.
As an illustration, the __main__ part of the module starts 2000 coroutines which compute the values of a highly recursive function in a quasi-parallel fashion(1 GB windows machine).
Coroutines, in my understanding, are just explainable like "functions that save control state between calls and can be called many times".
aspn.activestate.com /ASPN/Cookbook/Python/Recipe/300019   (688 words)

  
 Coroutines in Lua | Lambda the Ultimate
Asymmetric coroutine facilities are so called because they involve two types of control transfer operations: one for (re)invoking a coroutine and one for suspending it, the latter returning control to the coroutine invoker.
An asymmetric coroutine can be regarded as subordinate to its caller, the relationship between them being similar to that between a called and a calling routine.
A coroutine suspends by calling function coroutine.yield in this case, the coroutine’s execution state is saved and the corresponding call to coroutine.resume returns immediately.
lambda-the-ultimate.org /node/view/438   (476 words)

  
 Bees v0.5.0 API Documentation: Uses of Class bees.core.Coroutine
A ResponderCoroutine is a Coroutine that automatically repeats state transitions to a StateResponder specified in the Constructor.
Coroutine used to transform a domain identifier into a usable port for sending events.
Coroutine used to pass a JSI message to a domain.
www.cs.utah.edu /flux/janos/bees-0.5.0-doc/reference/bees/core/class-use/Coroutine.html   (202 words)

  
 Coroutine at opensource encyclopedia   (Site not responding. Last check: 2007-10-07)
Likewise, the first time a coroutine is invoked, execution starts at the beginning of the coroutine; however, each and every subsequent time a coroutine is invoked, execution resumes following the place where the coroutine last returned (yielded).
Unfortunately, the languages most popular as of 2003, C and its derivatives, do not have any direct support for coroutines within the language or their standard libraries.
Various attempts have been made, with varying degrees of success, to implement coroutines in C with combinations of subroutines and macros.
www.wiki.tatet.com /Coroutines.html   (807 words)

  
 [No title]
These counts are held in a structure accessible to all the other work coroutines of the same server in a form that allows smallest (countmin) and largest (countmax) counts to be determined easily.
When a work coroutine finds that it is increasing the value of countmin it release any coroutine waiting to increment its count.
When a work coroutine completes the processing of a request it has a conversation with the logger, but this is only allowed when it has acquired the logger lock.
www.cl.cam.ac.uk /users/mr/Tcobench/README   (1417 words)

  
 [No title]
It then causes the source coroutine to transmit 10,000 numbers through all the copy coroutines to be thrown away by the sink coroutine.
If the writing coroutine arrives at the communication point second, it picks the identity of the reading coroutine out of the channel word, clears the channel word, and then transmits the value to the waiting read coroutine using a simple call of callco.
If the reading coroutine arrives at the communication point second, it gives its own identity to the waiting write coroutine then waits for the value to be sent.
www.cl.cam.ac.uk /users/mr/Cobench/README   (679 words)

  
 jcalderone: Daddy, What Is A Coroutine?   (Site not responding. Last check: 2007-10-07)
Coroutines can be switched between regardless of their position in the call stack.
The PEP suggests that it will allow coroutines to be implemented using a trampoline (with which, by the way, Guido doesn't even think anyone important will bother).
Well, this may be true in the strictest sense - PEP 342 won't prevent you from implementing such a trampoline, but it is already possible to do so.
jcalderone.livejournal.com /17608.html   (232 words)

  
 Coroutine.pm   (Site not responding. Last check: 2007-10-07)
Simply, a ``semi-coroutine'' is a subroutine that suspends itself in the middle of execution, returns a value, can be resumed at the same point of execution at a later time.
Coroutines can be simulated with some success in languages without native support by using goto and label tricks.
Constructs a new coroutine, passing in a coderef.
www.math2.org /eulermb/pod/EulerMB/Coroutine.html   (672 words)

  
 Ice 9 - Coroutines Using Runqs
Returning a strip from a strip signals that a coroutine is being suspended and that calling the returned strip resumes the coroutine.
There are two ways to suspend a coroutine -- one is to return a single thunk, which is the serial continuation of the coroutine; the other is to return a list of thunks, in which case the coroutine forks into multiple continuations.
This convention is important: it means that a runq procedure is itself a coroutine (consisting of strip that sometimes iterates).
theoryx5.uwinnipeg.ca /gnu/guile/in_9.html   (874 words)

  
 Module Documentation - Coro 0.53   (Site not responding. Last check: 2007-10-07)
Coroutines are similar to threads but don't run in parallel.
In this module, coroutines are defined as "callchain + lexical variables + @_ + $_ + $@ + $^W + C stack), that is, a coroutine has it's own callchain, it's own set of lexicals and it's own set of perl's most important global variables.
The coroutine to switch to when no other coroutine is running.
aspn.activestate.com /ASPN/CodeDoc/Coro/Coro.html   (551 words)

  
 [No title]   (Site not responding. Last check: 2007-10-07)
A significant advantage of coroutine packages is that they can significantly reduce the costs of multi-thread management or at least isolate them within a user process.
The coroutine version is generally easier to use for debugging since the order of context switching is repeatable and the user need not worry about concurrent calls to C library routines.
That is, a huge number of coroutines would map to a much smaller number of threads executing in a single process.
www.cs.cmu.edu /afs/cs.cmu.edu/project/mach/public/doc/published/threads87.doc   (3896 words)

  
 C Coroutines   (Site not responding. Last check: 2007-10-07)
In short, you may think of coroutines as a very simple cooperative multitasking environment where the switch from one task to another is done explicitly by a function call.
Public struct coroutine fields The following elements of the struct coroutine may be used by applications: struct coroutine *caller; This is the handle of the previously active corou­ tine.
If one coroutine passes a pointer to local data (storage class auto) to another coroutine this pointer may become invalid at the moment that coroutine is restarted or deleted.
www.goron.de /~froese/coro/coro.html   (1117 words)

  
 CoRoutine Class   (Site not responding. Last check: 2007-10-07)
To use the CoRoutine, descend a new class from it implementing the Run method.
Note that since a real CoRoutine should execute in the same thread as the code that uses it, this implementation is not actually a real CoRoutine.
However, since the code is used like a CoRoutine, and does not outwardly have many signs that it is using a thread, I decided to keep the CoRoutine name for now.
www.vkarlsen.no /lvk.net/doc/LVK.CoRoutines.CoRoutine.html   (219 words)

  
 [No title]
Each pair of parentheses corresponds to a bit that must not exceed the bit of its enclosing pair, if any, and the pairs are ordered by the appearances of their right parentheses.
Each cnode corresponds to a coroutine whose job is to generate all the ideals of the subforest it represents.
Whenever the coroutine is invoked, it either changes one of the bits in its scope and returns true, or it changes nothing and returns false.
www-cs-faculty.stanford.edu /~knuth/programs/koda-ruskey.w   (1411 words)

  
 Intro to System Software, Chapter 15
Instead, the user must explicitly allocate coroutine activation records prior to a transfer of control, and the user may transfer control to a given coroutine, running in a given activation record, a number of times before that coroutine terminates.
A coroutine is a block of code which may be activated, producing an activation to which control may be transferred.
As with coroutines, the allocation of an activation record for a generator must be done explicitly prior to any transfer of control to that generator, but unlike coroutines, the transfer of control to a generator activation resembles a procedure call.
www.cs.uiowa.edu /~jones/syssoft/notes/15call.html   (5974 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.