Index: doc/papers/llheap/examples/C++Cor-ts.cpp
===================================================================
--- doc/papers/llheap/examples/C++Cor-ts.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/C++Cor-ts.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,42 @@
+
+
+auto result = co_await expression;
+
+//   |  |
+//   |  |
+//  \    /
+//   \  /
+//    \/
+
+auto&& __a = expression;
+if (!__a.await_ready()) {
+	__a.await_suspend(coroutine-handle)
+	// ...suspend/resume point...
+}
+auto result = __a.await_resume();
+
+//==================================================
+
+co_yield i;
+
+//   |  |
+//   |  |
+//  \    /
+//   \  /
+//    \/
+
+co_await __promise.yield_value(i);
+
+//==================================================
+
+... coroutine() {
+	__coroutine_context* __context = new __coroutine_context{};
+	__return = __context->_promise.get_return_object();
+	co_await   __context->_promise.initial_suspend();
+
+	...
+
+__final_suspend_label:
+	co_await __context->promise.final_suspend();
+	delete __context;
+}
Index: doc/papers/llheap/examples/DatingServiceThread.cfa
===================================================================
--- doc/papers/llheap/examples/DatingServiceThread.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/DatingServiceThread.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,110 @@
+#include <stdlib.hfa>									// random
+#include <fstream.hfa>
+#include <kernel.hfa>
+#include <thread.hfa>
+#include <unistd.h>										// getpid
+
+enum { CompCodes = 20 };								// number of compatibility codes
+
+thread DatingService {
+	condition Girls[CompCodes], Boys[CompCodes];
+	unsigned int girlPhoneNo, boyPhoneNo, ccode;
+}; // DatingService
+
+unsigned int girl( DatingService & mutex ds, unsigned int phoneno, unsigned int code ) with( ds ) {
+	girlPhoneNo = phoneno;  ccode = code;
+	wait( Girls[ccode] );								// wait for boy
+	girlPhoneNo = phoneno;
+	sout | "Girl:" | girlPhoneNo | "is dating Boy at" | boyPhoneNo | "with ccode" | ccode;
+	return boyPhoneNo;
+} // DatingService girl
+
+unsigned int boy( DatingService & mutex ds, unsigned int phoneno, unsigned int code ) with( ds ) {
+	boyPhoneNo = phoneno;  ccode = code;
+	wait( Boys[ccode] );								// wait for girl
+	boyPhoneNo = phoneno;
+	sout | " Boy:" | boyPhoneNo | "is dating Girl" | girlPhoneNo | "with ccode" | ccode;
+	return girlPhoneNo;
+} // DatingService boy
+
+void main( DatingService & ds ) with( ds ) {			// thread starts
+	for () {
+		waitfor( ^?{} : ds ) {
+			break;
+		} or waitfor( girl : ds ) {
+			if ( ! is_empty( Boys[ccode] ) ) {			// no compatible boy ?
+				signal_block( Boys[ccode] );			// restart boy to set phone number
+				signal_block( Girls[ccode] );			// restart girl to set phone number
+			} // if
+		} or waitfor( boy : ds ) {
+			if ( ! is_empty( Girls[ccode] ) ) {			// no compatible girl ?
+				signal_block( Girls[ccode] );			// restart girl to set phone number
+				signal_block( Boys[ccode] );			// restart boy to set phone number
+			} // if
+		}
+	}
+} // DatingService main
+
+unsigned int girlck[CompCodes];
+unsigned int boyck[CompCodes];
+
+thread Girl {
+	DatingService & TheExchange;
+	unsigned int id, ccode;
+}; // Girl
+
+void main( Girl & g ) with( g ) {
+	yield( random( 100 ) );								// do not start at the same time
+	unsigned int partner = girl( TheExchange, id, ccode );
+	girlck[id] = partner;
+} // Girl main
+
+void ?{}( Girl & g, DatingService * TheExchange, unsigned int id, unsigned int ccode ) {
+	&g.TheExchange = TheExchange;
+	g.id = id;
+	g.ccode = ccode;
+} // Girl ?{}
+
+thread Boy {
+	DatingService & TheExchange;
+	unsigned int id, ccode;
+}; // Boy
+
+void main( Boy & b ) with( b ) {
+	yield( random( 100 ) );								// don't all start at the same time
+	unsigned int partner = boy( TheExchange, id, ccode );
+	boyck[id] = partner;
+} // Boy main
+
+void ?{}( Boy & b, DatingService * TheExchange, unsigned int id, unsigned int ccode ) {
+	&b.TheExchange = TheExchange;
+	b.id = id;
+	b.ccode = ccode;
+} // Boy ?{}
+
+int main() {
+	DatingService TheExchange;
+	Girl * girls[CompCodes];
+	Boy  * boys[CompCodes];
+
+	srandom( /*getpid()*/ 103 );
+
+	for ( i; (unsigned int)CompCodes ) {
+		girls[i] = new( &TheExchange, i, i );			// TheExchange constructor needs unsigned int
+		boys[i]  = new( &TheExchange, i, CompCodes - ( i + 1 ) );
+	} // for
+
+	for ( i; CompCodes ) {
+		delete( boys[i] );
+		delete( girls[i] );
+	} // for
+
+	for ( i; CompCodes ) {
+		if ( girlck[ boyck[i] ] != boyck[ girlck[i] ] ) abort();
+	} // for
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa DatingServiceThread.cfa" //
+// End: //
Index: doc/papers/llheap/examples/Fib.c
===================================================================
--- doc/papers/llheap/examples/Fib.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+typedef struct {
+	int fn1, fn;
+} Fib;
+
+#define FibCtor { 1, 0 }
+
+int fib( Fib * f ) {
+	int fn = f->fn; f->fn = f->fn1;
+		f->fn1 = f->fn + fn;
+	return fn;
+}
+int main() {
+	Fib f1 = FibCtor, f2 = FibCtor;
+	for ( int i = 0; i < 10; i += 1 ) {
+		printf( "%d %d\n", fib( &f1 ), fib( &f2 ) );
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc Fib.c" //
+// End: //
Index: doc/papers/llheap/examples/Fib.cfa
===================================================================
--- doc/papers/llheap/examples/Fib.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,76 @@
+#include <thread.hfa>
+#include <fstream.hfa>
+
+int fn1, fn2, state = 1;
+int fib_gvar() {
+	int fn;
+	choose ( state ) {
+	  case 1: fn = 0;  fn1 = fn;  state = 2;
+	  case 2: fn = 1;  fn2 = fn1;  fn1 = fn;  state = 3;
+	  case 3: fn = fn1 + fn2;  fn2 = fn1;  fn1 = fn;
+	}
+	return fn;
+}
+
+#define FibCtor { 1, 0 }
+typedef struct { int fn1, fn; } Fib;
+int fib_state( Fib & f ) with(f) {
+	int ret = fn; fn = fn1; fn1 = fn + ret;
+	return ret;
+}
+
+coroutine Fib1 { int fn; };						// used for communication
+void main( Fib1 & fib ) with( fib ) {			// called on first resume
+	fn = 0;  int fn1 = fn; suspend();
+	fn = 1;  int fn2 = fn1;  fn1 = fn; suspend();
+	for () {
+		fn = fn1 + fn2;  fn2 = fn1;  fn1 = fn; suspend();
+	}
+}
+int ?()( Fib1 & fib ) with( fib ) { return resume( fib ).fn; }
+
+coroutine Fib2 { int fn; };						// used for communication
+void main( Fib2 & fib ) with( fib ) {			// called on first resume
+	int fn1;									// precompute first two states
+	[fn1, fn] = [1, 0];
+	for () {
+		suspend();								// restart last resume
+		[fn1, fn] = [fn, fn + fn1];
+	}
+}
+int ?()( Fib2 & fib ) {							// function-call interface
+	return resume( fib ).fn;					// restart last suspend
+}
+int ?()( Fib2 & fib, int N ) {					// skip N values
+	for ( N - 1 ) fib();						// use function-call interface
+	return fib();
+}
+double ?()( Fib2 & fib ) {						// different return type
+	return (int)(fib()) / 3.14159;				// cast prevents recursive call
+}
+
+int main() {
+	for ( 10 )
+		sout | fib_gvar();
+	sout | nl;
+
+	Fib f1 = FibCtor, f2 = FibCtor;
+	for ( 10 )
+		sout | fib_state( f1 ) | fib_state( f2 );
+	sout | nl;
+
+	Fib1 f1, f2;
+	for ( 10 )
+		sout | f1() | f2();
+	sout | nl;
+
+	Fib2 f12, f22;
+	for ( 10 )
+		sout | (int)f12() | (double)f12() | f22( 2 );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// fill-column: 120 //
+// compile-command: "cfa Fib.cfa" //
+// End: //
Index: doc/papers/llheap/examples/Fib.cpp
===================================================================
--- doc/papers/llheap/examples/Fib.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,120 @@
+#include <algorithm>
+#include <iostream>
+#include <iterator>
+#include <vector>
+
+#include <experimental/coroutine>
+
+template<typename T>
+struct cor_range {
+	struct promise_type {
+		T _value;
+
+		cor_range get_return_object() {
+			return cor_range(std::experimental::coroutine_handle<promise_type>::from_promise(*this));
+		}
+
+		auto initial_suspend() { return std::experimental::suspend_always(); }
+		auto final_suspend()   { return std::experimental::suspend_always(); }
+
+		void return_value(T value) {
+			_value = value;
+		}
+
+		auto yield_value(T value) {
+			_value = value;
+			return std::experimental::suspend_always();
+		}
+
+		void unhandled_exception() {}
+	};
+
+	std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+	explicit cor_range(std::experimental::coroutine_handle<promise_type> coroutine)
+		: _coroutine(coroutine)
+	{}
+
+	~cor_range() {
+		if(_coroutine) { _coroutine.destroy(); }
+	}
+
+	cor_range() = default;
+	cor_range(cor_range const &) = delete;
+	cor_range& operator=(cor_range const &) = delete;
+
+	cor_range(cor_range&& other) {
+		std::swap(_coroutine, other._coroutine);
+	}
+
+	cor_range& operator=(cor_range&& other) {
+		if(&other != this) {
+			_coroutine = other._coroutine;
+			other._coroutine = nullptr;
+		}
+		return *this;
+	}
+
+	T next() {
+		_coroutine.resume();
+		return _coroutine.promise()._value;
+	}
+
+	struct iterator : std::iterator<std::input_iterator_tag, T> {
+		std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+		iterator() = default;
+		explicit iterator(std::experimental::coroutine_handle<promise_type> coroutine)
+			: _coroutine(coroutine)
+		{}
+
+		iterator& operator++() {
+			_coroutine.resume();
+			return *this;
+		}
+
+		T const & operator*() const {
+			return _coroutine.promise()._value;
+		}
+	};
+
+	iterator begin() {
+		if(_coroutine) {
+			_coroutine.resume();
+			if(_coroutine.done()) { return end(); }
+		}
+
+		return iterator{ _coroutine };
+	}
+
+	iterator end() { return iterator{}; }
+};
+
+cor_range<int> fib() {
+	int fn;
+	fn = 0; int fn1 = fn; co_yield fn;
+	fn = 1; int fn2 = fn1; fn1 = fn; co_yield fn;
+	for(;;) {
+		fn = fn1 + fn2; fn2 = fn1; fn1 = fn; co_yield fn;
+	}
+}
+
+int main() {
+	{
+		auto f1 = fib();
+		auto f2 = fib();
+		for(int i = 0; i < 10; i++) {
+			std::cout << f1.next() << " " << f2.next() << std::endl;
+		}
+	}
+
+	{
+		auto f1 = fib();
+		std::vector<int> fibs;
+		std::copy_n(f1.begin(), 10, std::back_inserter(fibs));
+
+		for(auto i : fibs) {
+			std::cout << i << std::endl;
+		}
+	}
+}
Index: doc/papers/llheap/examples/Fib.js
===================================================================
--- doc/papers/llheap/examples/Fib.js	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib.js	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,18 @@
+function * fib() {
+	var fn1 = 1, fn = 0;
+	while ( true ) {
+		var ret = fn; fn = fn1; fn1 = fn + ret;
+		yield ret;
+	} // while
+}
+
+f1 = fib();
+f2 = fib();
+for ( var i = fib.length; i < 10; i += 1 ) {
+	console.log( f1.next().value, f2.next().value );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "node Fib.js" //
+// End: //
Index: doc/papers/llheap/examples/Fib.py
===================================================================
--- doc/papers/llheap/examples/Fib.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,15 @@
+def Fib():
+	fn = 0;	fn1 = fn; yield fn  # suspend
+	fn = 1; fn2 = fn1; fn1 = fn; yield fn
+	while True:
+		fn = fn1 + fn2; fn2 = fn1; fn1 = fn; yield fn
+
+f1 = Fib()
+f2 = Fib()
+for i in range( 10 ):
+	print( next( f1 ), next( f2 ) )  # resume
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 Fib.py" #
+# End: #
Index: doc/papers/llheap/examples/Fib.sim
===================================================================
--- doc/papers/llheap/examples/Fib.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,47 @@
+BEGIN
+	CLASS Fibonacci;
+		HIDDEN fn, main;					! private members;
+	BEGIN
+		INTEGER fn;							! communication;
+
+		PROCEDURE main;						! mimic uC++ coroutine main;
+		BEGIN
+			INTEGER fn1, fn2;
+
+			fn := 0; fn1 := fn;
+			Detach;							! suspend();
+			fn := 1; fn2 := fn1; fn1 := fn;
+			Detach;							! suspend();
+			WHILE TRUE DO BEGIN
+				fn := fn1 + fn2; fn2 := fn1; fn1 := fn;
+				Detach;						! suspend();
+			END;
+		END;
+
+		INTEGER PROCEDURE next;
+		BEGIN
+			Call( THIS Fibonacci );			! resume();
+			next := fn;
+		END;
+		! Fibonacci constructor code;
+		Detach;								! return to declaration;
+		main;								! call main as last line of constructor;
+	END Fibonacci;
+	! program main equivalent;
+	REF(Fibonacci) f1, f2;					! objects are references;
+	INTEGER i;
+
+	f1 :- NEW Fibonacci;
+	f2 :- NEW Fibonacci;
+	FOR i := 1 STEP 1 UNTIL 10 DO BEGIN
+		OutInt( f1.next, 3 );
+		OutText( " " );
+		OutInt( f2.next, 3 );
+		OutImage;
+	END
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim Fib.sim" ;
+! End: ;
Index: doc/papers/llheap/examples/Fib1.c
===================================================================
--- doc/papers/llheap/examples/Fib1.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib1.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,36 @@
+#include <stdio.h>
+
+#define FibCtor { 0, 0, NULL }
+typedef struct {
+	int fn1, fn2;
+	void * next;
+} Fib;
+
+int fib( Fib * f ) {
+	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
+  s1:
+	f->fn1 = 0;
+	f->next = &&s2;
+	return f->fn1;
+  s2:
+	f->fn2 = f->fn1;
+	f->fn1 = 1;
+	f->next = &&s3;
+	return f->fn1;
+  s3:;
+	int fn = f->fn1 + f->fn2;
+	f->fn2 = f->fn1;
+	f->fn1 = fn;
+	return fn;
+}
+int main() {
+	Fib f1 = FibCtor, f2 = FibCtor;
+	for ( int i = 0; i < 10; i += 1 ) {
+		printf( "%d %d\n", fib( &f1 ), fib( &f2 ) );
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-8 Fib1.c" //
+// End: //
Index: doc/papers/llheap/examples/Fib2.c
===================================================================
--- doc/papers/llheap/examples/Fib2.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib2.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,33 @@
+#include <stdio.h>
+
+#define FIB_INIT { 0 }
+typedef struct { int restart; int fn1, fn2; } Fib;
+int fib( Fib * f ) {
+	static void * states[] = { &&s0, &&s1, &&s2 };
+	goto *states[f->restart];
+  s0:
+	f->fn1 = 0;
+	f->restart = 1;
+	return f->fn1;
+  s1:
+	f->fn2 = f->fn1;
+	f->fn1 = 1;
+	f->restart = 2;
+	return f->fn1;
+  s2:;
+	int fn = f->fn1 + f->fn2;
+	f->fn2 = f->fn1;
+	f->fn1 = fn;
+	return fn;
+}
+int main() {
+	Fib f1 = FIB_INIT, f2 = FIB_INIT;
+	for ( int i = 0; i < 10; i += 1 ) {
+		printf( "%d %d\n", fib( &f1 ), fib( &f2 ) );
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc Fib2.c" //
+// End: //
Index: doc/papers/llheap/examples/Fib2.cfa
===================================================================
--- doc/papers/llheap/examples/Fib2.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib2.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,43 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// fibonacci_1.cfa -- 1-state finite-state machine: precomputed first two states returning f(n - 1)
+//
+// Author           : Peter A. Buhr
+// Created On       : Thu Apr 26 23:20:08 2018
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 18 08:55:59 2019
+// Update Count     : 36
+// 
+
+#include <fstream.hfa>
+#include <coroutine.hfa>
+
+coroutine Fibonacci { int fn1, fn; };					// used for communication
+
+void main( Fibonacci & fib ) with( fib ) {				// called on first resume
+	[fn1, fn] = [1, 0];									// precompute first two states
+	for () {
+		suspend();										// restart last resume
+		[fn1, fn] = [fn, fn1 + fn];						// general case
+	} // for
+}
+
+int ?()( Fibonacci & fib ) with( fib ) {				// function call operator
+	return resume( fib ).fn1;							// restart last suspend
+}
+
+int main() {
+	Fibonacci f1, f2;
+	for ( 10 ) {										// print N Fibonacci values
+		sout | resume( f1 ).fn | resume( f2 ).fn;
+	} // for
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa Fib2.cfa" //
+// End: //
Index: doc/papers/llheap/examples/Fib2.cpp
===================================================================
--- doc/papers/llheap/examples/Fib2.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib2.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,121 @@
+#include <algorithm>
+#include <iostream>
+#include <iterator>
+#include <vector>
+
+#include <experimental/coroutine>
+
+template<typename T>
+struct cor_range {
+	struct promise_type {
+		T _value;
+
+		cor_range get_return_object() {
+			return cor_range(std::experimental::coroutine_handle<promise_type>::from_promise(*this));
+		}
+
+		auto initial_suspend() { return std::experimental::suspend_always(); }
+		auto final_suspend()   { return std::experimental::suspend_always(); }
+
+		void return_value(T value) {
+			_value = value;
+		}
+
+		auto yield_value(T value) {
+			_value = value;
+			return std::experimental::suspend_always();
+		}
+
+		void unhandled_exception() {}
+	};
+
+	std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+	explicit cor_range(std::experimental::coroutine_handle<promise_type> coroutine)
+		: _coroutine(coroutine)
+	{}
+
+	~cor_range() {
+		if(_coroutine) { _coroutine.destroy(); }
+	}
+
+	cor_range() = default;
+	cor_range(cor_range const &) = delete;
+	cor_range& operator=(cor_range const &) = delete;
+
+	cor_range(cor_range&& other) {
+		std::swap(_coroutine, other._coroutine);
+	}
+
+	cor_range& operator=(cor_range&& other) {
+		if(&other != this) {
+			_coroutine = other._coroutine;
+			other._coroutine = nullptr;
+		}
+		return *this;
+	}
+
+	T next() {
+		_coroutine.resume();
+		return _coroutine.promise()._value;
+	}
+
+	struct iterator : std::iterator<std::input_iterator_tag, T> {
+		std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+		iterator() = default;
+		explicit iterator(std::experimental::coroutine_handle<promise_type> coroutine)
+			: _coroutine(coroutine)
+		{}
+
+		iterator& operator++() {
+			_coroutine.resume();
+			return *this;
+		}
+
+		T const & operator*() const {
+			return _coroutine.promise()._value;
+		}
+	};
+
+	iterator begin() {
+		if(_coroutine) {
+			_coroutine.resume();
+			if(_coroutine.done()) { return end(); }
+		}
+
+		return iterator{ _coroutine };
+	}
+
+	iterator end() { return iterator{}; }
+};
+
+cor_range<int> fib() {
+	int fn1 = 0, fn = 1;
+	for(;;) {
+		co_yield fn1;
+		int temp = fn1;
+		fn1 = fn;
+		fn = temp + fn;
+	}
+}
+
+int main() {
+	{
+		auto f1 = fib();
+		auto f2 = fib();
+		for(int i = 0; i < 10; i++) {
+			std::cout << f1.next() << " " << f2.next() << std::endl;
+		}
+	}
+
+	{
+		auto f1 = fib();
+		std::vector<int> fibs;
+		std::copy_n(f1.begin(), 10, std::back_inserter(fibs));
+
+		for(auto i : fibs) {
+			std::cout << i << std::endl;
+		}
+	}
+}
Index: doc/papers/llheap/examples/Fib2.py
===================================================================
--- doc/papers/llheap/examples/Fib2.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib2.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,15 @@
+def Fib():
+    fn1, fn = 1, 0
+    while True:
+        yield fn
+        fn1, fn = fn, fn1 + fn
+
+f1 = Fib()
+f2 = Fib()
+for i in range( 10 ):
+	print( next( f1 ), next( f2 ) )  # resume
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 Fib2.py" #
+# End: #
Index: doc/papers/llheap/examples/Fib3.c
===================================================================
--- doc/papers/llheap/examples/Fib3.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib3.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+typedef struct {
+	int restart, fn1, fn;
+} Fib;
+#define FibCtor { 0, 1, 0 }
+
+Fib * comain( Fib * f ) {
+	static void * states[] = {&&s0, &&s1};
+	goto *states[f->restart];
+  s0: f->restart = 1;
+	for ( ;; ) {
+		return f;
+	  s1:; int fn = f->fn + f->fn1;
+		f->fn1 = f->fn; f->fn = fn;
+	}
+}
+int main() {
+	Fib f1 = FibCtor, f2 = FibCtor;
+	for ( int i = 0; i < 10; i += 1 )
+		printf( "%d %d\n", comain( &f1 )->fn, comain( &f2 )->fn );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-8 Fib3.c" //
+// End: //
Index: doc/papers/llheap/examples/Fib3.cc
===================================================================
--- doc/papers/llheap/examples/Fib3.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fib3.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,30 @@
+#include <cstdio>
+
+struct Fib {
+	int fn = 1, fn1 = 0;
+	void * next = nullptr;
+
+	int operator()() {
+		if ( __builtin_expect(next != 0, 1) ) goto *next;
+		next = &&s1;
+		for ( ;; ) {
+			return fn1;
+		  s1: ;
+			int fn0 = fn + fn1;
+			fn1 = fn;
+			fn = fn0;
+			return fn1;
+		}
+	}
+};
+int main() {
+	Fib f1, f2;
+	for ( int i = 0; i < 10; i += 1 ) {
+		printf( "%d %d\n", f1(), f2() );
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-8 Fib3.cc" //
+// End: //
Index: doc/papers/llheap/examples/FibRefactor.py
===================================================================
--- doc/papers/llheap/examples/FibRefactor.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/FibRefactor.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,25 @@
+def Fib():
+	def Refactor():
+		nonlocal fn, fn1
+		fn = 0;	fn1 = fn
+		yield fn						# suspend
+
+	def Refactor2():
+		nonlocal fn, fn1, fn2
+		fn = 1; fn2 = fn1; fn1 = fn
+		yield fn						# suspend
+
+	yield from Refactor()
+	yield from Refactor2()
+	while True:
+		fn = fn1 + fn2; fn2 = fn1; fn1 = fn; yield fn
+
+f1 = Fib()
+f2 = Fib()
+for i in range( 10 ):
+	print( next( f1 ), next( f2 ) )		# resume
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 FibRefactor.py" #
+# End: #
Index: doc/papers/llheap/examples/Fmt.sim
===================================================================
--- doc/papers/llheap/examples/Fmt.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Fmt.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,46 @@
+BEGIN
+	CLASS FmtLines;
+		HIDDEN ch, main;					! private members;
+	BEGIN
+		CHARACTER ch;						! communication;
+
+		PROCEDURE main;						! mimic uC++ coroutine main;
+		BEGIN
+			INTEGER g, b;
+
+			WHILE TRUE DO BEGIN				! for as many characters;
+				FOR g := 1 STEP 1 UNTIL 5 DO BEGIN		! groups of 5;
+					FOR b := 1 STEP 1 UNTIL 4 DO BEGIN	! blocks of 4;
+						OutChar( ch );
+						Detach;				! suspend();
+					END;
+					OutText( "  " );
+				END;
+				OutImage;					! start newline;
+			END;
+		END;
+
+		PROCEDURE prt( chp );
+			CHARACTER chp;
+		BEGIN
+			ch := chp;						! communication;
+			Call( THIS FmtLines );			! resume();
+		END;
+		! FmtLines constructor code;
+		Detach;								! return to declaration;
+		main;								! call main as last line of constructor;
+	END FmtLines;
+	! program main equivalent;
+	REF(FmtLines) fmt;						! objects are references;
+	INTEGER i;
+
+	fmt :- NEW FmtLines;
+	FOR i := Rank( ' ' ) STEP 1 UNTIL Rank( 'z' ) DO BEGIN
+		fmt.prt( Char( i ) );
+	END
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim Fmt.sim" ;
+! End: ;
Index: doc/papers/llheap/examples/Format.c
===================================================================
--- doc/papers/llheap/examples/Format.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,40 @@
+#include <stdio.h>
+
+typedef struct {
+	int restart, g, b;
+	char ch;
+} Fmt;
+
+void comain( Fmt * f ) {
+	static void * states[] = {&&s0, &&s1};
+	goto *states[f->restart];
+  s0: f->restart = 1;
+	for ( ;; ) {
+		for ( f->g = 0; f->g < 5; f->g += 1 ) {			// groups
+			for ( f->b = 0; f->b < 4; f->b += 1 ) {		// blocks
+				do {
+					return;  s1: ;
+				} while ( f->ch == '\n' );				// ignore
+				printf( "%c", f->ch );					// print character
+			}
+			printf( " " );								// block separator
+		}
+		printf( "\n" );									// group separator
+	}
+}
+
+int main() {
+	Fmt fmt = { 0 };
+	comain( &fmt );										// prime
+	for ( ;; ) {
+		scanf( "%c", &fmt.ch );							// direct read into communication variable
+	  if ( feof( stdin ) ) break;
+		comain( &fmt );
+	}
+	if ( fmt.g != 0 || fmt.b != 0 ) printf( "\n" );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-8 Format.c" //
+// End: //
Index: doc/papers/llheap/examples/Format.cc
===================================================================
--- doc/papers/llheap/examples/Format.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,34 @@
+_Coroutine Format {
+	char ch; // used for communication
+	int g, b; // global because used in destructor
+	void main() {
+		for ( ;; ) { // for as many characters
+			for ( g = 0; g < 5; g += 1 ) { // groups of 5 blocks
+				for ( b = 0; b < 4; b += 1 ) { // blocks of 4 characters
+					for ( ;; ) { // for newline characters
+						suspend();
+						if ( ch != '\n' ) break; // ignore newline
+					}
+//					cout << ch; // print character
+				}
+//				cout << " "; // print block separator
+			}
+//			cout << endl; // print group separator
+		}
+	}
+  public:
+	Format() { resume(); } // start coroutine
+//	~Format() { if ( g != 0 | | b != 0 ) cout << endl; }
+	void prt( char ch ) { Format::ch = ch; resume(); }
+};
+
+int main() {
+	Format fmt;
+	for ( long int i = 0; i < 1000000000; i += 1 )
+		fmt.prt( 'a' );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "u++-work -O2 -nodebug Format.cc" //
+// End: //
Index: doc/papers/llheap/examples/Format.cfa
===================================================================
--- doc/papers/llheap/examples/Format.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,84 @@
+#if 1
+#include <fstream.hfa>
+#include <coroutine.hfa>
+
+coroutine Fmt {
+	char ch;								// communication variables
+	int g, b;								// needed in destructor
+};
+void main( Fmt & fmt ) with( fmt ) {
+	for () {								// for as many characters
+		for ( g = 0; g < 5; g += 1 ) {		// groups of 5 blocks
+			for ( b = 0; b < 4; b += 1 ) {	// blocks of 4 characters
+				do {
+					suspend();
+				} while ( ch == '\n' || ch == '\t' );
+				sout | ch;					// print character
+			}
+			sout | "  ";					// block separator
+		}
+		sout | nl;							// group separator
+	}
+}
+void ?{}( Fmt & fmt ) { resume( fmt ); } // prime (start) coroutine
+void ^?{}( Fmt & fmt ) with( fmt ) { // destructor
+	if ( g != 0 || b != 0 )	// special case
+		sout | nl; }
+void send( Fmt & fmt, char c ) { fmt.ch = c; resume( fmt ); }
+int main() {
+	Fmt fmt;
+ 	sout | nlOff;							// turn off auto newline
+	for ( 41 )
+		send( fmt, 'a' );
+  // 	sout | nlOff;							// turn off auto newline
+  // eof: for () {								// read until end of file
+  // 		sin | fmt.ch;						// read one character
+  // 	  if ( eof( sin ) ) break eof;			// eof ?
+  // 		format( fmt );						// push character for formatting
+  // 	}
+}
+#else
+
+#include <stdio.h>
+
+struct Format {
+	char ch;								// used for communication
+	int g, b;								// global because used in destructor
+};
+
+void format( struct Format * fmt ) {
+	if ( fmt->ch != -1 ) { // not EOF ?
+//		if ( fmt->ch == '\n' || fmt->ch == '\t' ) return;
+//		printf( "%c %d %d", fmt->ch, fmt->g, fmt->b );		// character
+		printf( "%c", fmt->ch );		// character
+		fmt->b += 1;
+		if ( fmt->b == 4 ) {	// block ?
+			printf( "  " ); // separator
+			fmt->b = 0;
+			fmt->g += 1;
+		}
+		if ( fmt->g == 5 ) {	// group ?
+			printf( "\n" ); // separator
+			fmt->g = 0;
+		}
+	} else {
+		if ( fmt->g != 0 || fmt->b != 0 ) printf( "\n" );
+	}
+}
+int main() {
+	struct Format fmt = { 0, 0, 0 };
+	for ( ;; ) {
+		scanf( "%c", &fmt.ch );
+	  if ( feof( stdin ) ) break;
+		format( &fmt );
+	}
+	fmt.ch = -1;
+	format( &fmt );
+}
+#endif
+
+// Local Variables: //
+// tab-width: 4 //
+// fill-column: 120 //
+// compile-command: "cfa Format.cfa" //
+// End: //
Index: doc/papers/llheap/examples/Format.cpp
===================================================================
--- doc/papers/llheap/examples/Format.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,96 @@
+#include <iostream>
+#include <experimental/coroutine>
+
+struct fmt_cor {
+	struct promise_type {
+		char _value;
+
+		fmt_cor get_return_object() {
+			return fmt_cor(std::experimental::coroutine_handle<promise_type>::from_promise(*this));
+		}
+
+		auto initial_suspend() { return std::experimental::suspend_never(); }
+		auto final_suspend()   { return std::experimental::suspend_always(); }
+
+		void return_void() {}
+		void unhandled_exception() {}
+	};
+
+	struct get {
+		promise_type * _promise = nullptr;
+
+		bool await_ready() noexcept {
+			return false;
+		}
+
+		void await_suspend(std::experimental::coroutine_handle<promise_type> _coroutine) noexcept {
+			_promise = &_coroutine.promise();
+		}
+		char await_resume() noexcept {
+			assert(_promise);
+			return _promise->_value;
+		}
+	};
+
+	std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+	explicit fmt_cor(std::experimental::coroutine_handle<promise_type> coroutine)
+		: _coroutine(coroutine)
+	{}
+
+	~fmt_cor() {
+		if(_coroutine) {
+			_coroutine.destroy();
+
+		}
+	}
+
+	fmt_cor() = default;
+	fmt_cor(fmt_cor const &) = delete;
+	fmt_cor& operator=(fmt_cor const &) = delete;
+
+	fmt_cor(fmt_cor&& other) {
+		std::swap(_coroutine, other._coroutine);
+	}
+
+	fmt_cor& operator=(fmt_cor&& other) {
+		if(&other != this) {
+			_coroutine = other._coroutine;
+			other._coroutine = nullptr;
+		}
+		return *this;
+	}
+
+	void send(char a) {
+		_coroutine.promise()._value = a;
+		_coroutine.resume();
+	}
+};
+
+fmt_cor Fmt() {
+	struct locals {
+		int g, b;
+
+		~locals() {
+			if (g != 0 | b != 0) {
+				std::cout << "\n";
+			}
+		}
+	} l;
+	for(;;) {
+		for(l.g = 0; l.g < 5; l.g++) {
+			for(l.b = 0; l.b < 4; l.b++) {
+				std::cout << co_await fmt_cor::get();
+			}
+			std::cout << "  ";
+		}
+		std::cout << std::endl;
+	}
+}
+
+int main() {
+	auto fmt = Fmt();
+	for(int i = 0; i < 41; i++) {
+		fmt.send('a');
+	}
+}
Index: doc/papers/llheap/examples/Format.data
===================================================================
--- doc/papers/llheap/examples/Format.data	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.data	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,3 @@
+abcdefghijklmnop
+qrstuvwxyzx
+xxxxxxxxxxxxx
Index: doc/papers/llheap/examples/Format.js
===================================================================
--- doc/papers/llheap/examples/Format.js	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.js	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,33 @@
+function * Format() {
+	var g, b;
+	fini: while ( true ) {
+		for ( g = 0; g < 5; g += 1 ) {					// groups of 5 blocks
+			for ( b = 0; b < 4; b += 1 ) {				// blocks of 4 characters
+				while ( true ) {
+					ch = (yield)						// receive from send
+					if ( ch == '\0' ) break fini;
+					if ( '\n' != ch ) break
+				}
+				process.stdout.write( ch )				// receive from send
+			}
+			process.stdout.write( '  ' )				// block separator
+		}
+		process.stdout.write( '\n' )					// group separator
+	}
+	if ( g != 0 || b != 0 ) process.stdout.write( '\n' )
+}
+
+var input = "abcdefghijklmnop\nqrstuvwx\nyzxxxxxxxxxxxxx"
+
+fmt = Format()
+fmt.next()												// prime generator
+for ( var i = 0; i < input.length; i += 1 ) {
+	fmt.next( input[i] );								// send to yield
+}
+fmt.next( '\0' );										// EOF
+
+// Local Variables: //
+// comment-column: 56 //
+// tab-width: 4 //
+// compile-command: "node Format.js" //
+// End: //
Index: doc/papers/llheap/examples/Format.py
===================================================================
--- doc/papers/llheap/examples/Format.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,27 @@
+def Format():
+	try:
+		while True:
+			for g in range( 5 ): 	# groups of 5 blocks
+				for b in range( 4 ): # blocks of 4 characters
+					while True:
+						ch = (yield) # receive from send
+						if '\n' not in ch:
+							break
+					print( ch, end='' ) # receive from send
+				print( '  ', end='' ) # block separator
+			print()					# group separator
+	except GeneratorExit:			# destructor
+		if g != 0 | b != 0:			# special case
+			print()
+
+input = "abcdefghijklmnop\nqrstuvwx\nyzxxxxxxxxxxxxxx\n"
+
+fmt = Format()
+next( fmt )							# prime generator
+for i in input:
+	fmt.send( i );				# send to yield
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 Format.py" #
+# End: #
Index: doc/papers/llheap/examples/Format.sim
===================================================================
--- doc/papers/llheap/examples/Format.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,46 @@
+BEGIN
+	CLASS FmtLines;
+		HIDDEN ch, main;					! private members;
+	BEGIN
+		CHARACTER ch;						! communication;
+
+		PROCEDURE main;						! mimic uC++ coroutine main;
+		BEGIN
+			INTEGER g, b;
+
+			WHILE TRUE DO BEGIN				! for as many characters;
+				FOR g := 1 STEP 1 UNTIL 5 DO BEGIN		! groups of 5;
+					FOR b := 1 STEP 1 UNTIL 4 DO BEGIN	! blocks of 4;
+						OutChar( ch );
+						Detach;				! suspend();
+					END;
+					OutText( "  " );
+				END;
+				OutImage;					! start newline;
+			END;
+		END;
+
+		PROCEDURE prt( chp );
+			CHARACTER chp;
+		BEGIN
+			ch := chp;						! communication;
+			Call( THIS FmtLines );			! resume();
+		END;
+		! FmtLines constructor code;
+		Detach;								! return to declaration;
+		main;								! call main as last line of constructor;
+	END FmtLines;
+	! program main equivalent;
+	REF(FmtLines) fmt;						! objects are references;
+	INTEGER i;
+
+	fmt :- NEW FmtLines;
+	FOR i := Rank( ' ' ) STEP 1 UNTIL Rank( 'z' ) DO BEGIN
+		fmt.prt( Char( i ) );
+	END
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim Format.sim" ;
+! End: ;
Index: doc/papers/llheap/examples/Format1.c
===================================================================
--- doc/papers/llheap/examples/Format1.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Format1.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,44 @@
+#include <stdio.h>
+
+typedef struct {
+	int restart, g, b;
+	char ch;
+} Fmt;
+
+void format( Fmt * f ) {
+	static void * states[] = {&&s0, &&s1};
+	goto *states[f->restart];
+  s0: f->restart = 1;
+	for ( ;; ) {
+		for ( f->g = 0; f->g < 5; f->g += 1 ) {			// groups
+			for ( f->b = 0; f->b < 4; f->b += 1 ) {		// blocks
+				return;
+			  s1: if ( f->ch == '\0' ) goto fini;		// EOF ?
+				while ( f->ch == '\n' ) return;			// ignore
+//				printf( "%c", f->ch );					// print character
+			}
+//			printf( " " );								// block separator
+		}
+//		printf( "\n" );									// group separator
+	}
+  fini:;
+//	if ( f->g != 0 || f->b != 0 ) printf( "\n" );
+}
+
+int main() {
+	Fmt fmt = { 0 };
+	format( &fmt );										// prime
+	fmt.ch = 'a';
+	for ( long int i = 0; i < 1000000000; i += 1 ) {
+//		scanf( "%c", &fmt.ch );							// direct read into communication variable
+//	  if ( feof( stdin ) ) break;
+		format( &fmt );
+	}
+	fmt.ch = '\0';										// sentential (EOF)
+	format( &fmt );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-8 Format1.c" //
+// End: //
Index: doc/papers/llheap/examples/PingPong.c
===================================================================
--- doc/papers/llheap/examples/PingPong.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/PingPong.c	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,84 @@
+#include <stdio.h>
+
+typedef struct PingPong {
+	int restart;										// style 1
+	int N, i;
+	const char * name;
+	struct PingPong * partner;
+	void * next;										// style 2
+} PingPong;
+#define PPCtor( name, N ) { 0, N, 0, name, NULL, NULL }
+
+void comain( PingPong * pp ) __attribute__(( noinline ));
+void comain( PingPong * pp ) {
+#if 0
+	if ( __builtin_expect(pp->next != 0, 1) ) goto *pp->next;
+	pp->next = &&cycle;
+	for ( ; pp->i < pp->N; pp->i += 1 ) {
+#ifdef PRINT
+		printf( "%s %d\n", pp->name, pp->i );
+#endif // PRINT
+		asm( "mov  %0,%%rdi" : "=m" (pp->partner) );
+		asm( "mov  %rdi,%rax" );
+#ifndef OPT
+#ifdef PRINT
+		asm( "add  $16, %rsp" );
+#endif // PRINT
+		asm( "popq %rbp" );
+#endif // ! OPT
+
+#ifdef OPT
+#ifdef PRINT
+		asm( "popq %rbx" );
+#endif // PRINT
+#endif // OPT
+		asm( "jmp  comain" );
+	  cycle: ;
+	} // for
+#endif // 0
+
+#if 1
+	static void * states[] = {&&s0, &&s1};
+	goto *states[pp->restart];
+  s0: pp->restart = 1;
+	for ( ; pp->i < pp->N; pp->i += 1 ) {
+#ifdef PRINT
+		printf( "%s %d\n", pp->name, pp->i );
+#endif // PRINT
+		asm( "mov  %0,%%rdi" : "=m" (pp->partner) );
+		asm( "mov  %rdi,%rax" );
+#ifndef OPT
+#ifdef PRINT
+		asm( "add  $16, %rsp" );
+#endif // PRINT
+		asm( "popq %rbp" );
+#endif // ! OPT
+
+#ifdef OPT
+#ifdef PRINT
+		asm( "popq %rbx" );
+#endif // PRINT
+#endif // OPT
+		asm( "jmp  comain" );
+	  s1: ;
+	} // for
+#endif // 0
+}
+
+int main() {
+	enum { N =
+#ifdef PRINT
+		   5
+#else
+		   1000000000
+#endif // PRINT
+	};
+	PingPong ping = PPCtor( "ping", N ), pong = PPCtor( "pong", N );
+	ping.partner = &pong;  pong.partner = &ping;
+	comain( &ping );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-9 -g -DPRINT PingPong.c" //
+// End: //
Index: doc/papers/llheap/examples/PingPong.cc
===================================================================
--- doc/papers/llheap/examples/PingPong.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/PingPong.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,64 @@
+#include <cstdio>
+
+struct Obj {
+	Obj() { printf( "Obj constructor\n" ); }
+	~Obj() { printf( "Obj destructor\n" ); }
+	int i = 4;
+};
+
+struct PingPong {
+	const char * name;
+	const int N;
+	PingPong * partner = nullptr;
+	int i = 0;
+	void * next = nullptr;
+
+	PingPong( const char * name, int N ) : name(name), N(N) {}
+
+	void operator()() {
+		if ( __builtin_expect(next != 0, 1) ) goto *next;
+		next = &&cycle;
+		for ( ; i < N; i += 1 ) {
+			Obj obj;
+			printf( "X %s %d\n", name, obj.i );
+			obj.i = 7;
+#ifdef PRINT
+			printf( "%s %d\n", name, i );
+#endif // PRINT
+			asm( "mov  %0,%%rdi" : "=m" (partner) );
+			asm( "mov  %rdi,%rax" );
+#ifndef OPT
+#ifdef PRINT
+			asm( "add  $40, %rsp" );
+#endif // PRINT
+			asm( "popq %rbp" );
+#endif // ! OPT
+
+#ifdef OPT
+#ifdef PRINT
+			asm( "popq %rbx" );
+#endif // PRINT
+#endif // OPT
+			asm( "jmp  _ZN8PingPongclEv" );
+		  cycle: ;
+			printf( "Y %s %d\n", name, obj.i );
+		} // for
+	}
+};
+int main() {
+	enum { N =
+#ifdef PRINT
+		   5
+#else
+		   1000000000
+#endif // PRINT
+	};
+	PingPong ping = { "ping", N }, pong = { "pong", N };
+	ping.partner = &pong; pong.partner = &ping;
+	ping();
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "g++-8 -g -DPRINT PingPong.cc" //
+// End: //
Index: doc/papers/llheap/examples/Pingpong.cc
===================================================================
--- doc/papers/llheap/examples/Pingpong.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Pingpong.cc	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,31 @@
+#include <iostream>
+using namespace std;
+
+_Coroutine PingPong {
+	const char * name;
+	const unsigned int N;
+	PingPong * part;
+	void main() { // ping’s starter ::main, pong’s starter ping
+		for ( unsigned int i = 0; i < N; i += 1 ) {
+			cout << name << endl;
+			part->cycle();
+		}
+	}
+  public:
+	PingPong( const char * name, unsigned int N, PingPong & part )
+		: name( name ), N( N ), part( & part ) {}
+	PingPong( const char * name, unsigned int N ) : name( name ), N( N ) {}
+	void partner( PingPong & part ) { PingPong::part = &part; }
+	void cycle() { resume(); }
+};
+int main() {
+	enum { N = 10 };
+	PingPong ping( "ping", N ), pong( "pong", N, ping );
+	ping.partner( pong );
+	ping.cycle();
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "u++-work -O2 -nodebug Pingpong.cc" //
+// End: //
Index: doc/papers/llheap/examples/Pingpong.cfa
===================================================================
--- doc/papers/llheap/examples/Pingpong.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Pingpong.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,38 @@
+#include <coroutine.hfa>
+#include <fstream.hfa>
+
+coroutine PingPong {
+	const char * name;
+	unsigned int N;
+	PingPong & part;
+};
+
+// void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) {
+// 	this.[name, N] = [name, N];  &this.part = &part;
+// }
+// void ?{}( PingPong & this, const char * name, unsigned int N ) {
+// 	this{ name, N, *0p };								// call first constructor
+// }
+void cycle( PingPong & pingpong ) {
+	resume( pingpong );
+}
+void partner( PingPong & this, PingPong & part ) {
+	&this.part = &part;
+	resume( this );
+}
+void main( PingPong & pingpong ) with(pingpong) {		// ping's starter ::main, pong's starter ping
+	for ( N ) {											// N ping-pongs
+		sout | name;
+		cycle( part );
+	} // for
+}
+int main() {
+	enum { N = 5 };
+	PingPong ping = { "ping", N }, pong = { "pong", N, ping };
+	partner( ping, pong );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa Pingpong.cfa" //
+// End: //
Index: doc/papers/llheap/examples/Pingpong.py
===================================================================
--- doc/papers/llheap/examples/Pingpong.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Pingpong.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,35 @@
+def PingPong( name, N ):
+	partner = yield				# get partner
+	yield						# resume scheduler
+	for i in range( N ):
+		print( name )
+		yield partner			# execute next
+	print( "end", name )
+
+def Scheduler():
+	n = yield					# starting coroutine
+	try:
+		while True:
+			n = next( n )		# schedule coroutine
+	except StopIteration:
+		pass
+
+pi = PingPong( "ping", 5 )
+po = PingPong( "pong", 5 )
+next( pi )						# prime
+pi.send( po )					# send partner
+next( po )						# prime
+po.send( pi )					# send partner
+
+s = Scheduler();
+next( s )						# prime
+try:
+	s.send( pi )				# start cycle
+except StopIteration:			# scheduler stopped
+	pass
+print( "stop" )
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 Pingpong.py" #
+# End: #
Index: doc/papers/llheap/examples/Pingpong2.cfa
===================================================================
--- doc/papers/llheap/examples/Pingpong2.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Pingpong2.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,39 @@
+#include <coroutine.hfa>
+#include <fstream.hfa>
+
+coroutine PingPong {
+	const char * name;
+	unsigned int N;
+	PingPong & partner;
+};
+
+void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & partner ) {
+	this.[name, N] = [name, N];  &this.partner = &partner;
+}
+void ?{}( PingPong & this, const char * name, unsigned int N ) {
+	this{ name, N, *0p };								// call first constructor
+}
+// void cycle( PingPong & pingpong ) {
+// 	resume( pingpong );
+// }
+void partner( PingPong & this, PingPong & partner ) {
+	&this.partner = &partner;
+	resume( this );
+}
+void main( PingPong & pingpong ) with(pingpong) {		// ping's starter ::main, pong's starter ping
+	for ( i; N ) {										// N ping-pongs
+		sout | name | i;
+//		cycle( partner );
+		resume( partner );
+	} // for
+}
+int main() {
+	enum { N = 5 };
+	PingPong ping = { "ping", N }, pong = { "pong", N, ping };
+	partner( ping, pong );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa Pingpong2.cfa" //
+// End: //
Index: doc/papers/llheap/examples/ProdCons.cfa
===================================================================
--- doc/papers/llheap/examples/ProdCons.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/ProdCons.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,76 @@
+#include <fstream.hfa>
+#include <coroutine.hfa>
+#include <stdlib.hfa>									// random
+#include <unistd.h>										// getpid
+coroutine Cons;											// forward
+int delivery( Cons & cons, int p1, int p2 );
+void stop( Cons & cons );
+
+coroutine Prod {
+	Cons & c;
+	int N, money, receipt;
+};
+void main( Prod & prod ) with( prod ) {					// starter ::main
+	// 1st resume starts here
+	for ( i; N ) {										// N pairs of values
+		int p1 = random( 100 ), p2 = random( 100 );
+		sout | p1 | " " | p2;
+		int status = delivery( c, p1, p2 );
+		sout | " $" | money | nl | status;
+		receipt += 1;
+	}
+	stop( c );
+	sout | "prod stops";
+}
+int payment( Prod & prod, int m ) with(prod) {
+	money = m;
+	resume( prod );										// main 1st time, then
+	return receipt;										// prod in delivery
+}
+void start( Prod & prod, int N, Cons &c ) {
+	&prod.c = &c;
+	prod.[N, receipt] = [N, 0];
+	resume( prod );										// activate main
+}
+coroutine Cons {
+	Prod & p;
+	int p1, p2, status;
+	bool done;
+};
+void ?{}( Cons & cons, Prod & p ) {
+	&cons.p = &p;
+	cons.[status, done ] = [0, false];
+}
+void ^?{}( Cons & cons ) {}
+void main( Cons & cons ) with( cons ) {					// starter prod
+	// 1st resume starts here
+	int money = 1, receipt;
+	for ( ; ! done; ) {
+		sout | p1 | " " | p2 | nl | " $" | money;
+		status += 1;
+		receipt = payment( p, money );
+		sout | " #" | receipt;
+		money += 1;
+	}
+	sout | "cons stops";
+}
+int delivery( Cons & cons, int p1, int p2 ) {
+	cons.[p1, p2] = [p1, p2];
+	resume( cons );										// main 1st time, then
+	return cons.status;									// cons in payment
+}
+void stop( Cons & cons ) {
+	cons.done = true;
+	resume( cons );										// activate payment
+}
+int main() {
+	Prod prod;
+	Cons cons = { prod };
+	srandom( getpid() );
+	start( prod, 5, cons );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa ProdCons.cfa" //
+// End: //
Index: doc/papers/llheap/examples/ProdCons.cpp
===================================================================
--- doc/papers/llheap/examples/ProdCons.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/ProdCons.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,244 @@
+#include <cassert>
+#include <cstdlib>
+#include <iostream>
+#include <experimental/coroutine>
+#include <unistd.h>
+
+int random(int max) {
+	return std::rand() % max;
+}
+
+struct Prod;
+struct Cons;
+
+struct resumable {
+	virtual resumable * resume() = 0;
+};
+
+struct Prod : public resumable {
+	struct local {
+		Cons * c;
+		int N, money, receipt;
+	};
+
+	struct promise_type {
+		local _l;
+		resumable * next;
+
+		Prod get_return_object() {
+			return Prod(std::experimental::coroutine_handle<promise_type>::from_promise(*this));
+		}
+
+		auto initial_suspend() { return std::experimental::suspend_never(); }
+		auto final_suspend()   { return std::experimental::suspend_always(); }
+
+		void return_void() {}
+		void unhandled_exception() {}
+	};
+
+	struct data {
+		promise_type * _promise = nullptr;
+		bool await_ready() noexcept { return false; }
+		void await_suspend(std::experimental::coroutine_handle<promise_type> _coroutine) noexcept {
+			_promise = &_coroutine.promise();
+		}
+		local & await_resume() noexcept { assert(_promise); return _promise->_l; }
+	};
+
+	std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+	explicit Prod(std::experimental::coroutine_handle<promise_type> coroutine)
+		: _coroutine(coroutine)
+	{}
+
+	~Prod() {
+		if(_coroutine) { _coroutine.destroy(); }
+	}
+
+	Prod() = default;
+	Prod(Prod const &) = delete;
+	Prod& operator=(Prod const &) = delete;
+
+	Prod(Prod&& other) {
+		std::swap(_coroutine, other._coroutine);
+	}
+
+	Prod& operator=(Prod&& other) {
+		if(&other != this) {
+			_coroutine = other._coroutine;
+			other._coroutine = nullptr;
+		}
+		return *this;
+	}
+
+	static Prod main();
+
+	struct payment_return;
+
+	payment_return payment(int money);
+
+	auto start(int N, Cons & c) {
+		_coroutine.promise()._l.c = &c;
+		_coroutine.promise()._l.N = N;
+		_coroutine.promise()._l.receipt = 0;
+	}
+
+	virtual resumable * resume() override final {
+		_coroutine.resume();
+		return _coroutine.promise().next;
+	}
+};
+
+struct Cons : public resumable {
+	struct local {
+		Prod * p;
+		int p1, p2, status;
+		bool done;
+	};
+
+	struct promise_type {
+		local _l;
+		resumable * next;
+
+		Cons get_return_object() {
+			return Cons(std::experimental::coroutine_handle<promise_type>::from_promise(*this));
+		}
+
+		auto initial_suspend() { return std::experimental::suspend_never(); }
+		auto final_suspend()   { return std::experimental::suspend_always(); }
+
+		void return_void() {}
+		void unhandled_exception() {}
+	};
+
+	struct data {
+		Prod * _p;
+		data(Prod & prod) : _p(&prod) {}
+		promise_type * _promise = nullptr;
+		bool await_ready() noexcept { return false; }
+		void await_suspend(std::experimental::coroutine_handle<promise_type> _coroutine) noexcept {
+			_promise = &_coroutine.promise();
+		}
+		local & await_resume() noexcept { assert(_promise); _promise->_l.p = _p; return _promise->_l; }
+	};
+
+	std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+	explicit Cons(std::experimental::coroutine_handle<promise_type> coroutine)
+		: _coroutine(coroutine)
+	{}
+
+	~Cons() {
+		if(_coroutine) { _coroutine.destroy(); }
+	}
+
+	Cons() = default;
+	Cons(Cons const &) = delete;
+	Cons& operator=(Cons const &) = delete;
+
+	Cons(Cons&& other) {
+		std::swap(_coroutine, other._coroutine);
+	}
+
+	Cons& operator=(Cons&& other) {
+		if(&other != this) {
+			_coroutine = other._coroutine;
+			other._coroutine = nullptr;
+		}
+		return *this;
+	}
+
+	static Cons main( Prod & prod );
+
+	auto deliver(int p1, int p2) {
+		_coroutine.promise()._l.p1 = p1;
+		_coroutine.promise()._l.p2 = p2;
+
+		struct ret {
+			int _status;
+			Cons * c;
+			bool await_ready() { return false; }
+			void await_suspend(std::experimental::coroutine_handle<Prod::promise_type> _coroutine) {
+				_coroutine.promise().next = c;
+			}
+			int await_resume() { return _status; }
+		};
+		return ret{ _coroutine.promise()._l.status, this };
+	}
+
+	auto stop() {
+		_coroutine.promise()._l.done = true;
+		struct ret {
+			Cons * c;
+			Prod::promise_type * _promise;
+			bool await_ready() { return false; }
+			void await_suspend(std::experimental::coroutine_handle<Prod::promise_type> _coroutine) {
+				_promise = &_coroutine.promise();
+				_promise->next = c;
+			}
+			void await_resume() {
+				_promise->next = nullptr;
+			}
+		};
+		return ret{this, nullptr};
+	}
+
+	virtual resumable * resume() override final {
+		_coroutine.resume();
+		return _coroutine.promise().next;
+	}
+};
+
+struct Prod::payment_return {
+	int _receipt;
+	Prod * p;
+	bool await_ready() { return false; }
+	void await_suspend(std::experimental::coroutine_handle<Cons::promise_type> _coroutine) {
+		_coroutine.promise().next = p;
+	}
+	int await_resume() { return _receipt; }
+};
+
+Prod::payment_return Prod::payment(int money)  {
+	_coroutine.promise()._l.money = money;
+	return payment_return{ _coroutine.promise()._l.receipt, this };
+}
+
+Prod Prod::main() {
+	auto & p = co_await Prod::data();
+	for(int i = 0; i < p.N; i++) {
+		int p1 = random(100), p2 = random(100);
+		std::cout << p1 << " " << p2 << std::endl;
+		int status = co_await p.c->deliver(p1, p2);
+		std::cout << " $" << p.money << std::endl << status << std::endl;
+		p.receipt += 1;
+	}
+	co_await p.c->stop();
+	std::cout << "prod stops" << std::endl;
+}
+
+Cons Cons::main( Prod & prod ) {
+	auto & c = co_await Cons::data( prod );
+	int money = 1, receipt;
+	for(;!c.done ;) {
+		std::cout << c.p1 << " " << c.p2 << std::endl;
+		std::cout << " $ " << money << std::endl;
+		c.status += 1;
+		receipt = co_await c.p->payment( money );
+		std::cout << " # " << receipt << std::endl;
+		money += 1;
+	}
+	std::cout << "cons stops" << std::endl;
+}
+
+void dispatch(resumable * r) {
+	while((r = r->resume()));
+}
+
+int main() {
+	auto prod = Prod::main();
+	auto cons = Cons::main( prod );
+	srandom( getpid() );
+	prod.start(5, cons);
+	dispatch(&prod);
+}
Index: doc/papers/llheap/examples/ProdCons.py
===================================================================
--- doc/papers/llheap/examples/ProdCons.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/ProdCons.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,43 @@
+def Prod( N ):
+	cons = yield				# get cons
+	yield						# resume scheduler
+	for i in range( N ):
+		print( "prod" )
+		yield cons				# execute next
+	print( "end", "prod" )
+
+def Cons( N ):
+	prod = yield				# get prod
+	yield						# resume scheduler
+	for i in range( N ):
+		print( "cons" )
+		yield prod				# execute next
+	print( "end", "cons" )
+
+def Scheduler():
+	n = yield					# starting coroutine
+	try:
+		while True:
+			n = next( n )		# schedule coroutine
+	except StopIteration:
+		pass
+
+prod = Prod( 5 )
+cons = Cons( 5 )
+next( prod )					# prime
+prod.send( cons )				# send cons
+next( cons )					# prime
+cons.send( prod )				# send prod
+
+s = Scheduler();
+next( s )						# prime
+try:
+	s.send( prod )				# start cycle
+except StopIteration:			# scheduler stopped
+	pass
+print( "stop" )
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 ProdCons.py" #
+# End: #
Index: doc/papers/llheap/examples/ProdCons.sim
===================================================================
--- doc/papers/llheap/examples/ProdCons.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/ProdCons.sim	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,104 @@
+BEGIN
+	CLASS Consumer( prod );
+   		REF(Producer) prod; ! constructor parameter;
+		HIDDEN p1, p2, status, done, Main;
+	BEGIN
+		INTEGER p1, p2, status;
+		BOOLEAN done;
+		PROCEDURE main;
+		BEGIN
+			INTEGER money, receipt;
+
+			money := 1;
+			WHILE NOT done DO BEGIN
+				OutText( "cons receives: " );
+				OutInt( p1, 3 );
+				OutText( ", " );
+				OutInt( p2, 3 );
+				status := status + 1;
+				OutText( " and pays $" );
+				OutInt( money, 3 ); OutImage;
+				receipt := prod.payment( money );
+				OutText( "cons receipt #" );
+				OutInt( receipt, 3 ); OutImage;
+				money := money + 1;
+			END;
+			OutText( "cons stops" ); OutImage;
+		END;
+		INTEGER PROCEDURE delivery( p1p, p2p );
+			INTEGER p1p, p2p;
+		BEGIN
+			p1 := p1p;
+			p2 := p2p;
+			Resume( THIS Consumer );
+			delivery := status;
+		END;
+		PROCEDURE stop;
+		BEGIN
+			done := TRUE;
+			Call( THIS Consumer );
+		END;
+		! Consumer constructor code;
+		status := 0;
+		done := FALSE;
+		Detach;
+		main;
+	END Consumer;
+
+	CLASS Producer;
+		HIDDEN cons, N, money, receipt, Main;
+	BEGIN
+		REF(Consumer) cons;
+		INTEGER N, money, receipt;
+		PROCEDURE main;
+		BEGIN
+			INTEGER i, p1, p2, status;
+
+			FOR i := 1 STEP 1 UNTIL N DO BEGIN  
+				p1 := RandInt( 1, 100, p1 );
+				p2 := RandInt( 1, 100, p2 );
+				OutText( "prod delivers: " );
+				OutInt( p1, 3 ); OutText( ", " );
+				OutInt( p2, 3 ); OutImage;
+				status := cons.delivery( p1, p2 );
+				OutText( "prod status: " );
+				OutInt( status, 3 ); OutImage;
+			END;
+			cons.stop;
+			OutText( "prod stops" ); OutImage;
+		END;
+		INTEGER PROCEDURE payment( moneyp );
+			INTEGER moneyp;
+		BEGIN
+			money := moneyp;
+			OutText( "prod payment of $" );
+			OutInt( money, 3 ); OutImage;
+			Resume( THIS Producer );
+			receipt := receipt + 1;
+			payment := receipt;
+		END;
+		PROCEDURE start( Np, consp );
+			INTEGER Np;
+			REF(Consumer) consp;
+		BEGIN
+			N := Np;
+			cons :- consp;
+			Resume( THIS Producer );
+		END;
+		! Producer constructor code;
+		receipt := 0;
+		Detach;
+		main;
+	END Producer;
+	! program main equivalent;
+	REF(Producer) prod;
+	REF(Consumer) cons;
+	prod :- NEW Producer;
+	cons :- NEW Consumer( prod );
+	prod.start( 5, cons );
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim ProdCons.sim" ;
+! End: ;
Index: doc/papers/llheap/examples/RWMonitorEXT.cfa
===================================================================
--- doc/papers/llheap/examples/RWMonitorEXT.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/RWMonitorEXT.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,66 @@
+#include <fstream.hfa>
+#include <thread.hfa>
+
+volatile int SharedRW = 0;								// shared variable to test readers and writers
+
+monitor ReadersWriter {
+	int rcnt, wcnt;										// number of readers/writer using resource
+};
+
+void ?{}( ReadersWriter & rw ) with(rw) { rcnt = wcnt = 0; }
+void EndRead( ReadersWriter & mutex rw ) with(rw) { rcnt -= 1; }
+void EndWrite( ReadersWriter & mutex rw ) with(rw) { wcnt = 0; }
+void StartRead( ReadersWriter & mutex rw ) with(rw) {
+	if ( wcnt > 0 ) waitfor( EndWrite : rw );
+	rcnt += 1;
+}
+void StartWrite( ReadersWriter & mutex rw ) with(rw) {
+	if ( wcnt > 0 ) waitfor( EndWrite : rw );
+	else while ( rcnt > 0 ) waitfor( EndRead : rw );
+	wcnt = 1;
+}
+int readers( ReadersWriter & rw ) { return rw.rcnt; }
+
+void Read( ReadersWriter & rw ) {
+	StartRead( rw );
+	sout | "Reader:" | active_thread() | ", shared:" | SharedRW | " with:" | readers( rw ) | " readers";
+	yield( 3 );
+	EndRead( rw );
+}
+void Write( ReadersWriter & rw ) {
+	StartWrite( rw );
+
+	SharedRW += 1;
+	sout | "Writer:" | active_thread() | ",  wrote:" | SharedRW;
+	yield( 1 );
+	EndWrite( rw );
+}
+
+thread Worker {
+	ReadersWriter &rw;
+};
+void ?{}( Worker & w, ReadersWriter * rw ) { &w.rw = rw; }
+void main( Worker & w ) with(w) {
+	for ( 10 ) {
+		if ( rand() % 100 < 70 ) {					// decide to be a reader or writer
+			Read( rw );
+		} else {
+			Write( rw );
+		} // if
+	} // for
+}
+
+int main() {
+	enum { MaxTask = 5 };
+	ReadersWriter rw;
+	Worker *workers[MaxTask];
+
+	for ( i; MaxTask ) workers[i] = new( &rw );
+	for ( i; MaxTask ) delete( workers[i] );
+	sout | "successful completion";
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa -O2 RWMonitorEXT.cfa" //
+// End: //
Index: doc/papers/llheap/examples/RWMonitorINT.cfa
===================================================================
--- doc/papers/llheap/examples/RWMonitorINT.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/RWMonitorINT.cfa	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,74 @@
+#include <fstream.hfa>
+#include <thread.hfa>
+
+volatile int SharedRW = 0;								// shared variable to test readers and writers
+
+enum RW { READER, WRITER };
+monitor ReadersWriter {
+	int rcnt, wcnt;										// number of readers/writer using resource
+	condition RWers;
+};
+
+void ?{}( ReadersWriter & rw ) with(rw) { rcnt = wcnt = 0; }
+void StartRead( ReadersWriter & mutex rw ) with(rw) {
+	if ( wcnt !=0 || ! is_empty( RWers ) ) wait( RWers, READER );
+	rcnt += 1;
+	if ( ! is_empty( RWers ) && front( RWers ) == READER ) signal( RWers );
+}
+void EndRead( ReadersWriter & mutex rw ) with(rw) {
+	rcnt -= 1;
+	if ( rcnt == 0 ) signal( RWers );
+}
+void StartWrite( ReadersWriter & mutex rw ) with(rw) {
+	if ( wcnt != 0 || rcnt != 0 ) wait( RWers, WRITER );
+	wcnt = 1;
+}
+void EndWrite( ReadersWriter & mutex rw ) with(rw) {
+	wcnt = 0;
+	signal( RWers );
+}
+int readers( ReadersWriter & rw ) { return rw.rcnt; }
+
+void Read( ReadersWriter & rw ) {
+	StartRead( rw );
+	sout | "Reader:" | active_thread() | ", shared:" | SharedRW | " with:" | readers( rw ) | " readers";
+	yield( 3 );
+	EndRead( rw );
+}
+void Write( ReadersWriter & rw ) {
+	StartWrite( rw );
+
+	SharedRW += 1;
+	sout | "Writer:" | active_thread() | ",  wrote:" | SharedRW;
+	yield( 1 );
+	EndWrite( rw );
+}
+
+thread Worker {
+	ReadersWriter &rw;
+};
+void ?{}( Worker & w, ReadersWriter * rw ) { &w.rw = rw; }
+void main( Worker & w ) with(w) {
+	for ( 10 ) {
+		if ( rand() % 100 < 70 ) {					// decide to be a reader or writer
+			Read( rw );
+		} else {
+			Write( rw );
+		} // if
+	} // for
+}
+
+int main() {
+	enum { MaxTask = 5 };
+	ReadersWriter rw;
+	Worker *workers[MaxTask];
+
+	for ( i; MaxTask ) workers[i] = new( &rw );
+	for ( i; MaxTask ) delete( workers[i] );
+	sout | "successful completion";
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa -O2 RWMonitorINT.cfa" //
+// End: //
Index: doc/papers/llheap/examples/Refactor.py
===================================================================
--- doc/papers/llheap/examples/Refactor.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/Refactor.py	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,29 @@
+def Recursion():
+	def Refactor():
+		N = (yield)
+		print( N );
+		if N == 0:
+			yield 0
+		r = Refactor()
+		next( r )
+		x = r.send( N - 1 )
+		print( x );
+		yield x
+
+	N = (yield)
+	print( N );
+	r = Refactor()
+	next( r )
+	print( r.send( N - 1 ) )
+
+c = Recursion()
+next( c )
+try:
+	c.send( 5 )
+except StopIteration:
+	print( "stop" )
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 Refactor.py" #
+# End: #
Index: doc/papers/llheap/examples/channels.go
===================================================================
--- doc/papers/llheap/examples/channels.go	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/channels.go	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,35 @@
+package main
+import "fmt"
+func main() {
+	type Msg struct{ i, j int }
+
+	ch1 := make( chan int )
+	ch2 := make( chan float32 )
+	ch3 := make( chan Msg )
+	hand := make( chan string )
+	shake := make( chan string )
+	gortn := func() { // thread starts
+		var i int;  var f float32;  var m Msg
+		L: for {
+			select { // wait for message
+			  case i = <- ch1: fmt.Println( i )
+			  case f = <- ch2: fmt.Println( f )
+			  case m = <- ch3: fmt.Println( m )
+			  case <- hand: break L // sentinel
+			}
+		}
+		shake <- "SHAKE" // completion
+	}
+
+	go gortn() // start thread
+	ch1 <- 0 // different messages
+	ch2 <- 2.5
+	ch3 <- Msg{1, 2}
+	hand <- "HAND" // sentinel value
+	<- shake // wait for completion
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "go run channels.go" //
+// End: //
Index: doc/papers/llheap/examples/channels.rs
===================================================================
--- doc/papers/llheap/examples/channels.rs	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/channels.rs	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,34 @@
+#![feature(async_await)]
+
+use std::thread;
+use std::sync::mpsc;
+
+fn main() {
+	let (tx1, rx1) = mpsc::channel();
+	let (tx2, rx2) = mpsc::channel();
+	let (tx3, rx3) = mpsc::channel();
+	let (tx4, rx4) = mpsc::channel();
+	struct Msg { i : i64,  j : i64 }
+	let th = thread::spawn( || {
+		let i : i64; let f : f64; let m : Msg;
+		loop {
+			select! {
+				i = rx1.recv() => println( i );
+				f = rx2.recv() => println( f );
+				m = rx3.recv() => println( m );
+				_ = rx4.recv() => break;
+			}
+		}
+	});
+
+	tx1.send( 0 ); // different messages
+	tx2.send( 2.5 );
+	tx3.send( Msg { i:1, j:2 } );
+	tx4.send( "done" );
+	th.join().unwrap();
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "rustc -C opt-level=3 channels.rs" //
+// End: //
Index: doc/papers/llheap/examples/counter.cpp
===================================================================
--- doc/papers/llheap/examples/counter.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/counter.cpp	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,62 @@
+#include <iostream>
+#include <experimental/coroutine>
+
+struct counter_cor {
+	struct promise_type {
+		counter_cor get_return_object() {
+			return counter_cor(std::experimental::coroutine_handle<promise_type>::from_promise(*this));
+		}
+
+		auto initial_suspend() { return std::experimental::suspend_never(); }
+		auto final_suspend()   { return std::experimental::suspend_never(); }
+
+		void return_void() {}
+
+		void unhandled_exception() {}
+	};
+
+	std::experimental::coroutine_handle<promise_type> _coroutine = nullptr;
+
+	explicit counter_cor(std::experimental::coroutine_handle<promise_type> coroutine)
+		: _coroutine(coroutine)
+	{}
+
+	~counter_cor() {
+		if(_coroutine) { _coroutine.destroy(); }
+	}
+
+	counter_cor() = default;
+	counter_cor(counter_cor const &) = delete;
+	counter_cor& operator=(counter_cor const &) = delete;
+
+	counter_cor(counter_cor&& other) {
+		std::swap(_coroutine, other._coroutine);
+	}
+
+	counter_cor& operator=(counter_cor&& other) {
+		if(&other != this) {
+			_coroutine = other._coroutine;
+			other._coroutine = nullptr;
+		}
+		return *this;
+	}
+
+	void resume() { _coroutine.resume(); }
+};
+
+counter_cor counter() {
+	std::cout << "Counter: called\n";
+	for(unsigned i = 1;; i++) {
+		co_await std::experimental::suspend_always{};
+		std::cout << "Counter: Resumed " << i << " time(s)\n";
+	}
+}
+
+int main() {
+	std::cout << "Main: calling counter\n";
+	auto c = counter();
+	std::cout << "Main: resumes\n";
+	c.resume();
+	c.resume();
+	std::cout << "Main: done\n";
+}
Index: doc/papers/llheap/examples/future.rs
===================================================================
--- doc/papers/llheap/examples/future.rs	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
+++ doc/papers/llheap/examples/future.rs	(revision 7bef8cf5c01bdb7a3ef2d5f4c309a1715e4ba4e9)
@@ -0,0 +1,10 @@
+use futures::executor::block_on;
+
+async fn hello_world() {
+    println!("hello, world!");
+}
+
+fn main() {
+    let future = hello_world(); // Nothing is printed
+    block_on(future); // `future` is run and "hello, world!" is printed
+}
