Index: doc/papers/concurrency/FullCoroutinePhases.fig
===================================================================
--- doc/papers/concurrency/FullCoroutinePhases.fig	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/FullCoroutinePhases.fig	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,39 @@
+#FIG 3.2  Produced by xfig version 3.2.5c
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+5 1 0 1 0 7 100 0 -1 0.000 0 0 1 0 4575.000 2437.500 4275 1875 4575 1800 4875 1875
+	1 1 1.00 45.00 90.00
+5 1 0 1 0 7 100 0 -1 0.000 0 0 1 0 4575.000 1537.500 4875 2100 4575 2175 4275 2100
+	1 1 1.00 45.00 90.00
+5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 4207.500 1642.500 4125 1425 3975 1650 4200 1875
+	1 1 1.00 45.00 90.00
+2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 2025 1575 1800 1800
+2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 2175 1575 2400 1800
+2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 3300 1575 3300 1800
+2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 3300 2025 3300 2250
+4 1 0 100 0 0 10 0.0000 2 105 555 2100 1200 creation\001
+4 1 0 100 0 4 10 0.0000 2 165 300 1725 1950 ping\001
+4 1 0 100 0 4 10 0.0000 2 135 360 2475 1950 pong\001
+4 1 0 100 0 4 10 0.0000 2 165 300 3300 1950 ping\001
+4 1 0 100 0 4 10 0.0000 2 135 360 3300 2400 pong\001
+4 1 0 100 0 0 10 0.0000 2 105 675 4575 1200 execution\001
+4 1 0 100 0 4 10 0.0000 2 165 300 4275 2025 ping\001
+4 1 0 100 0 4 10 0.0000 2 135 360 4875 2025 pong\001
+4 1 0 100 0 0 10 0.0000 2 90 420 3300 1200 starter\001
+4 1 0 100 0 4 10 0.0000 2 165 705 2100 1500 pgm main\001
+4 1 0 100 0 4 10 0.0000 2 165 705 3300 1500 pgm main\001
+4 1 0 100 0 4 10 0.0000 2 165 705 4500 1500 pgm main\001
Index: doc/papers/concurrency/FullProdConsStack.fig
===================================================================
--- doc/papers/concurrency/FullProdConsStack.fig	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/FullProdConsStack.fig	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,51 @@
+#FIG 3.2  Produced by xfig version 3.2.5c
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+5 1 0 1 4 7 100 0 -1 0.000 0 0 1 1 5700.000 2137.500 5250 1800 5700 1575 6150 1800
+	1 1 1.00 45.00 105.00
+	1 1 1.00 45.00 105.00
+5 1 0 1 4 7 50 -1 -1 0.000 0 0 1 0 3128.716 2184.122 3300 1275 3825 1575 4050 2100
+	1 1 1.00 45.00 90.00
+2 1 1 1 1 7 100 0 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 6150 2400 5250 1800
+2 1 1 1 1 7 100 0 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 4050 2400 3300 1275
+2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
+	 4050 2400 5250 2400 5250 2100 4050 2100 4050 2400
+2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
+	 6150 2400 7350 2400 7350 2100 6150 2100 6150 2400
+2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
+	 6150 2100 7350 2100 7350 1800 6150 1800 6150 2100
+2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
+	 4050 2100 5250 2100 5250 1800 4050 1800 4050 2100
+2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
+	 1800 2400 3300 2400 3300 1650 1800 1650 1800 2400
+2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
+	 1800 1650 3300 1650 3300 1275 1800 1275 1800 1650
+4 1 0 100 0 4 10 0.0000 0 150 780 2400 2175 prod{ c, N,\001
+4 1 0 100 0 4 10 0.0000 2 150 975 4650 2325 i,p1,p2,status\001
+4 1 0 100 0 4 10 0.0000 2 150 450 4650 2025 p1, p2\001
+4 2 0 100 0 4 10 0.0000 2 120 345 3975 2325 main\001
+4 2 0 100 0 4 10 0.0000 2 150 570 3975 2025 delivery\001
+4 1 0 100 0 4 10 0.0000 2 150 330 4650 2625 prod\001
+4 1 0 100 0 4 10 0.0000 2 90 360 6750 2625 cons\001
+4 1 0 100 0 4 10 0.0000 2 120 495 6750 2325 money\001
+4 2 0 100 0 4 10 0.0000 2 120 345 6075 2325 main\001
+4 2 0 100 0 4 10 0.0000 2 150 630 6075 2025 payment\001
+4 1 4 100 0 0 10 0.0000 2 75 495 5700 1500 resume\001
+4 0 4 100 0 0 10 0.0000 2 75 495 3900 1500 resume\001
+4 1 0 100 0 4 10 0.0000 2 135 615 2550 2625 program\001
+4 2 0 100 0 4 10 0.0000 2 120 345 1725 2025 main\001
+4 2 0 100 0 4 10 0.0000 2 120 330 1725 1500 start\001
+4 1 0 100 0 4 10 0.0000 2 135 300 2550 1500 N, c\001
+4 1 0 100 0 4 10 0.0000 0 150 1140 2550 1800 cons{ p, p1, p2,\001
+4 1 0 100 0 4 10 0.0000 0 150 1005 2550 1950 status, done }\001
+4 1 0 100 0 4 10 0.0000 0 150 1185 2550 2325 money, receipt }\001
Index: doc/papers/concurrency/corlayout.fig
===================================================================
--- doc/papers/concurrency/corlayout.fig	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
+++ doc/papers/concurrency/corlayout.fig	(revision 466fa013f2bfa1aed287add52d969087ca7f4721)
@@ -0,0 +1,76 @@
+#FIG 3.2  Produced by xfig version 3.2.5c
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+6 7950 1275 8250 1425
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 8025 1350 20 20 8025 1350 8045 1350
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 8100 1350 20 20 8100 1350 8120 1350
+1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 8175 1350 20 20 8175 1350 8195 1350
+-6
+2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5
+	 1950 1875 3150 1875 3150 2700 1950 2700 1950 1875
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+	 1950 2475 3150 2475
+2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5
+	 1950 600 3150 600 3150 1200 1950 1200 1950 600
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 3450 825 4650 825 4650 1500 3450 1500 3450 825
+2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5
+	 1950 1200 3150 1200 3150 1875 1950 1875 1950 1200
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 3075 1625 4950 1625
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 3150 1100 3450 1100
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 4575 1250 4950 1250
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 45.00 90.00
+	1 1 1.00 45.00 90.00
+	 6150 1350 6450 1350
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 4950 900 6150 900 6150 1725 4950 1725 4950 900
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 6450 900 7650 900 7650 1725 6450 1725 6450 900
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+	1 1 1.00 45.00 90.00
+	1 1 1.00 45.00 90.00
+	 7650 1350 7950 1350
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+	 4950 1500 6150 1500
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 4
+	1 1 1.00 45.00 90.00
+	 1950 1075 1725 1075 1725 1350 1950 1350
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 4
+	1 1 1.00 45.00 90.00
+	 2025 1600 1725 1600 1725 1950 1950 1950
+4 2 0 50 -1 0 10 0.0000 2 120 345 1875 2325 stack\001
+4 1 0 50 -1 0 10 0.0000 2 150 1020 2550 2625 optional guard\001
+4 1 0 50 -1 0 10 0.0000 2 105 360 2550 2250 fixed\001
+4 1 0 50 -1 0 10 0.0000 2 90 420 4050 975 starter\001
+4 1 0 50 -1 0 10 0.0000 2 105 825 4050 1125 last resumer\001
+4 1 0 50 -1 0 10 0.0000 2 150 885 4050 1275 stack pointer\001
+4 1 0 50 -1 0 10 0.0000 2 120 1080 4050 1425 other stack info\001
+4 1 0 50 -1 0 10 0.0000 2 135 690 4050 750 descriptor\001
+4 1 0 50 -1 0 10 0.0000 2 90 420 2550 1350 starter\001
+4 1 0 50 -1 0 10 0.0000 2 105 825 2550 1500 last resumer\001
+4 1 0 50 -1 0 10 0.0000 2 150 885 2550 1650 stack pointer\001
+4 1 0 50 -1 0 10 0.0000 2 120 1080 2550 1800 other stack info\001
+4 1 0 50 -1 0 10 0.0000 2 120 345 5550 825 stack\001
+4 1 0 50 -1 0 10 0.0000 2 135 1410 6300 1950 heap or preallocated\001
+4 1 0 50 -1 0 10 0.0000 2 150 1020 5550 1650 optional guard\001
+4 1 0 50 -1 0 10 0.0000 2 105 360 5550 1275 fixed\001
+4 1 0 50 -1 0 10 0.0000 2 105 555 7050 1275 variable\001
+4 1 0 50 -1 0 10 0.0000 2 135 405 7050 1425 (split)\001
+4 1 0 50 -1 0 10 0.0000 2 150 705 7050 825 stack$_2$\001
+4 1 0 50 -1 0 10 0.0000 2 135 1230 2550 1125 descriptor pointer\001
+4 2 0 50 -1 4 10 0.0000 2 120 675 1875 825 coroutine\001
+4 1 0 50 -1 0 10 0.0000 2 105 375 2550 900 fields\001
+4 2 0 50 -1 0 10 0.0000 2 105 465 1800 975 handle\001
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: //
