CoRoutines

TwitterFacebook
Get flash to fully experience Pearltrees

martinheidegger/ThreadStepProcessor/en

( Japanese page ) ActionScript Thread StepProcessor is a extension to the Thread Library for multi threading based on pseudo threads. Downloads ¶ Documentation ¶ http://www.libspark.org/wiki/martinheidegger/ThreadStepProcessor/en
http://www.libspark.org/wiki/Threader ( Japanese | English ) ThreaderはActionScript3.0で擬似的なマルチスレッド処理を実現するためのライブラリです。 Workerを用いてないのでFlash Player11.3以前で利用可能です。 ダウンロード ¶ サンプルコード ¶ ドキュメント ¶

Threader

ActionScript Thread Library 1.0 (そうめん) は、タスクシステムと Java のスレッドモデルをベースとした疑似スレッドライブラリです。 複雑で冗長になりがちな、イベント処理や非同期処理、リアルタイム処理を、分かりやすくスマートに記述することを可能にします。 もちろん、割り込みやキャンセル、例外処理もバッチリです。スレッドを使って、イベントリスナー地獄から抜け出しましょう。 ※ActionScript Thread Library は、名前こそスレッドですが、実体はタスクシステムにスレッドモデルを搭載したものなので、 「スレッド」と考えるよりは、「タスクシステム」だと考えた方が理解が早いでしょう。このドキュメントもその前提でお読みください。 http://www.libspark.org/htdocs/as3/thread-files/document/#execution-order-of-thread-hierarchy

ActionScript Thread Library 1.0 (そうめん) ドキュメント

http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/

AIR Link Report visualizer | kahunaburger

The Flex compiler has a rarely used feature called “link-report”. Using this option instructs the compiler to create a report of all symbols that went into the compiled application as well as a list of all external references. The Reducing SWF file sizes livedocs-page has more information about link reports.
PEP Index > PEP 342 -- Coroutines via Enhanced Generators Introduction This PEP proposes some enhancements to the API and syntax of generators, to make them usable as simple coroutines. It is basically a combination of ideas from these two PEPs, which may be considered redundant if this PEP is accepted: - PEP 288 , Generators Attributes and Exceptions. The current PEP covers its second half, generator exceptions (in fact the throw() method name was taken from PEP 288 ). PEP 342 replaces generator attributes, however, with a concept from an earlier revision of PEP 288 , the "yield expression". - PEP 325 , Resource-Release Support for Generators.

PEP 342 -- Coroutines via Enhanced Generators

http://www.python.org/dev/peps/pep-0342/

Caliburn: A Client Framework for WPF and Silverlight

http://caliburn.codeplex.com/wikipage?title=IResult&ProjectName=caliburn IResult is one of the most powerful features of Actions. Any action can return an instance of IResult or IEnumerable IResult enables handling many difficult programming scenarios with ease, mainly asynchronous programming. Here's an example of what you can do: public IEnumerable<IResult> Login( string username, string password) { var authenticator = new AuthenticateResult(username, password); yield return authenticator; if (!
cogen is a crossplatform library for network oriented, coroutine based programming using the enhanced generators from python 2.5. The project aims to provide a simple straightforward programming model similar to threads but without all the problems and costs. Features wsgi server with coroutine extensions - enabling asynchronous wsgi apps in a regular wsgi stack fast network multiplexing with epoll, kqueue, select, poll or io completion ports (on windows) epoll/kqueue support via the wrappers in the python 2.6's stdlib or separate modules py-kqueue , py-epoll iocp support via ctypes wrappers or pywin32 sendfile/TransmitFile support (the wsgi server also uses this for wsgi.file_wrapper ) timeouts for socket calls, signal waits etc various mechanisms to work with (signals, joins, a Queue with the same features as the stdlib one) and some other stuff you can find in the docs :) http://code.google.com/p/cogen/

cogen - Crossplatform asynchronous network oriented python framework based on python 2.5 enhanced generators.

https://pypi.python.org/pypi/multitask

Package Index : multitask 0.2.0

Package Index > multitask > 0.2.0

API docs for “kiwi.tasklet”

http://www.async.com.br/projects/kiwi/api/kiwi.tasklet.html Pseudo-thread (coroutines) framework This module adds infrastructure for managing tasklets. In this context, a tasklet is defined as a routine that explicitly gives back control to the main program a certain points in the code, while waiting for certain events. Other terms that may be used to describe tasklets include coroutines , or cooperative threads . The main advantages of tasklets are:
http://www.gevent.org/gevent.event.html#gevent.event.AsyncResult

event – Notifications of multiple listeners — gevent v0.13.5 documentation

class gevent.event. Event A synchronization primitive that allows one greenlet to wake up one or more others. It has the same interface as threading.Event but works across greenlets. An event object manages an internal flag that can be set to true with the set() method and reset to false with the clear() method.
Mordor allows you to focus on performing a logical task, instead of deciding how to make that task conform to a specific threading/event model. Just because local disk I/O will block and should be performed in a thread pool while network I/O should be performed using an event based callback design, doesn't mean you can't do them both in the same function. Mordor allows you to do just that.

Code - Mordor

Coroutines are computer program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing more familiar program components such as cooperative tasks , iterators , infinite lists and pipes . The term coroutine was originated by Melvin Conway in a 1963 paper. [ 1 ] [ edit ] Comparison with subroutines "Subroutines are special cases of ... coroutines." – Donald Knuth . [ 2 ] When subroutines are invoked, execution begins at the start and once a subroutine exits, it is finished; an instance of a subroutine only returns once.

Coroutine

Iterators and generators - MDC Doc Center

Processing each of the items in a collection is a very common operation.

Caliburn.Micro Soup to Nuts Pt. 5 – IResult and Coroutines

Before our WP7 detour , we were deep in the thick of Actions . I mentioned that there was one more compelling feature of the Actions concept called Coroutines. If you haven’t heard that term before, here’s what wikipedia * has to say: In computer science , coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing more familiar program components such as cooperative tasks , iterators , infinite lists and pipes .
Introduction This article is an exploratory look into the Microsoft DevLabs project called Reactive Framework (Rx for short). I feel kind of weird saying this, but the demo solution that comes with this article will provide you nothing re-usable at all, but what it should hopefully do is give you an understanding of how Rx works. Prerequisites

Fun with Rx