Index: doc/papers/concurrency/examples/Fib1.c
===================================================================
--- doc/papers/concurrency/examples/Fib1.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Fib1.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -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/concurrency/examples/Fib2.c
===================================================================
--- doc/papers/concurrency/examples/Fib2.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Fib2.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,40 @@
+#include <stdio.h>
+
+void mary() {
+	printf( "MARY\n" );
+}
+
+#define FIB_INIT { 0 }
+typedef struct { int next; int fn1, fn2; } Fib;
+int fib( Fib * f ) {
+	static void * states[] = { &&s1, &&s2, &&s3 };
+	goto *states[f->next];
+  s1:
+	mary();
+	f->fn1 = 0;
+	f->next = 1;
+	return f->fn1;
+  s2:
+	mary();
+	f->fn2 = f->fn1;
+	f->fn1 = 1;
+	f->next = 2;
+	return f->fn1;
+  s3:;
+	mary();
+	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/concurrency/examples/Fib3.c
===================================================================
--- doc/papers/concurrency/examples/Fib3.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Fib3.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+typedef struct {
+	int fn1, fn;
+	void * next;
+} Fib;
+#define FibCtor { 1, 0, NULL }
+
+Fib * comain( Fib * f ) {
+	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
+	f->next = &&s1;
+	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/concurrency/examples/Fib3.cc
===================================================================
--- doc/papers/concurrency/examples/Fib3.cc	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Fib3.cc	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -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/concurrency/examples/Format.c
===================================================================
--- doc/papers/concurrency/examples/Format.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Format.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,39 @@
+#include <stdio.h>
+
+typedef struct {
+	void * next;
+	char ch;
+	int g, b;
+} Fmt;
+
+void comain( Fmt * f ) {
+	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
+	f->next = &&s1;
+	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:;  while ( f->ch == '\n' ) return;		// ignore
+				printf( "%c", f->ch );					// print character
+			}
+			printf( " " );								// block separator
+		}
+		printf( "\n" );									// group separator
+	}
+}
+
+int main() {
+	Fmt fmt = { NULL };
+	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/concurrency/examples/Format.data
===================================================================
--- doc/papers/concurrency/examples/Format.data	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Format.data	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,1 @@
+abcdefghijklmnopqrstuvwxyzxxxxxxxxxxxxxx
Index: doc/papers/concurrency/examples/Format.sim
===================================================================
--- doc/papers/concurrency/examples/Format.sim	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Format.sim	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -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/concurrency/examples/Format1.c
===================================================================
--- doc/papers/concurrency/examples/Format1.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Format1.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,44 @@
+#include <stdio.h>
+
+typedef struct {
+	void * next;
+	char ch;
+	int g, b;
+} Fmt;
+
+void format( Fmt * f ) {
+	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
+	f->next = &&s1;
+	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 = { NULL };
+	format( &fmt );										// prime
+	for ( ;; ) {
+		scanf( "%c", &fmt.ch );							// direct read into communication variable
+	  if ( feof( stdin ) ) break;
+		format( &fmt );
+	}
+	fmt.ch = '\0';
+	format( &fmt );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc-8 Format1.c" //
+// End: //
Index: doc/papers/concurrency/examples/PingPong.c
===================================================================
--- doc/papers/concurrency/examples/PingPong.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/PingPong.c	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,73 @@
+#include <stdio.h>
+
+typedef struct PingPong {
+	const char * name;
+	struct PingPong * partner;
+	int N, i;
+	void * next;
+} PingPong;
+#define PPCtor( name, N ) { name, NULL, N, 0, NULL }
+void comain( PingPong * pp ) __attribute__(( noinline ));
+void comain( PingPong * pp ) {
+	if ( __builtin_expect(pp->next != 0, 1) ) goto *pp->next;
+#if 0
+	pp->next = &&here;
+		asm( "mov  %0,%%rdi" : "=m" (pp) );
+		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" );
+  here: ;
+#endif // 0
+
+	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
+}
+
+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-8 -g -DPRINT PingPong.c" //
+// End: //
Index: doc/papers/concurrency/examples/PingPong.cc
===================================================================
--- doc/papers/concurrency/examples/PingPong.cc	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/PingPong.cc	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -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/concurrency/examples/Pingpong2.cfa
===================================================================
--- doc/papers/concurrency/examples/Pingpong2.cfa	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/examples/Pingpong2.cfa	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -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: //
