Index: doc/papers/concurrency/examples/Fib.py
===================================================================
--- doc/papers/concurrency/examples/Fib.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Fib.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -4,6 +4,4 @@
 	while True:
 		fn = fn1 + fn2; fn2 = fn1; fn1 = fn; yield fn
-
-
 
 f1 = Fib()
@@ -14,4 +12,4 @@
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 Fib.py" #
+# compile-command: "python3.7 Fib.py" #
 # End: #
Index: doc/papers/concurrency/examples/Fib2.c
===================================================================
--- doc/papers/concurrency/examples/Fib2.c	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Fib2.c	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -1,26 +1,19 @@
 #include <stdio.h>
 
-void mary() {
-	printf( "MARY\n" );
-}
-
 #define FIB_INIT { 0 }
-typedef struct { int next; int fn1, fn2; } Fib;
+typedef struct { int restart; int fn1, fn2; } Fib;
 int fib( Fib * f ) {
-	static void * states[] = { &&s1, &&s2, &&s3 };
-	goto *states[f->next];
+	static void * states[] = { &&s0, &&s1, &&s2 };
+	goto *states[f->restart];
+  s0:
+	f->fn1 = 0;
+	f->restart = 1;
+	return f->fn1;
   s1:
-	mary();
-	f->fn1 = 0;
-	f->next = 1;
-	return f->fn1;
-  s2:
-	mary();
 	f->fn2 = f->fn1;
 	f->fn1 = 1;
-	f->next = 2;
+	f->restart = 2;
 	return f->fn1;
-  s3:;
-	mary();
+  s2:;
 	int fn = f->fn1 + f->fn2;
 	f->fn2 = f->fn1;
Index: doc/papers/concurrency/examples/Fib2.py
===================================================================
--- doc/papers/concurrency/examples/Fib2.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Fib2.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -1,6 +1,6 @@
 def Fib():
-    fn1, fn = 0, 1
+    fn1, fn = 1, 0
     while True:
-        yield fn1
+        yield fn
         fn1, fn = fn, fn1 + fn
 
@@ -12,4 +12,4 @@
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 Fib2.py" #
+# compile-command: "python3.7 Fib2.py" #
 # End: #
Index: doc/papers/concurrency/examples/Fib3.c
===================================================================
--- doc/papers/concurrency/examples/Fib3.c	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Fib3.c	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -2,12 +2,12 @@
 
 typedef struct {
-	int fn1, fn;
-	void * next;
+	int restart, fn1, fn;
 } Fib;
-#define FibCtor { 1, 0, NULL }
+#define FibCtor { 0, 1, 0 }
 
 Fib * comain( Fib * f ) {
-	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
-	f->next = &&s1;
+	static void * states[] = {&&s0, &&s1};
+	goto *states[f->restart];
+  s0: f->restart = 1;
 	for ( ;; ) {
 		return f;
Index: doc/papers/concurrency/examples/FibRefactor.py
===================================================================
--- doc/papers/concurrency/examples/FibRefactor.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/FibRefactor.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -22,4 +22,4 @@
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 FibRefactor.py" #
+# compile-command: "python3.7 FibRefactor.py" #
 # End: #
Index: doc/papers/concurrency/examples/Format.c
===================================================================
--- doc/papers/concurrency/examples/Format.c	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Format.c	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -2,17 +2,18 @@
 
 typedef struct {
-	void * next;
+	int restart, g, b;
 	char ch;
-	int g, b;
 } Fmt;
 
 void comain( Fmt * f ) {
-	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
-	f->next = &&s1;
+	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:;  while ( f->ch == '\n' ) return;		// ignore
+				do {
+					return;  s1: ;
+				} while ( f->ch == '\n' );				// ignore
 				printf( "%c", f->ch );					// print character
 			}
@@ -24,5 +25,5 @@
 
 int main() {
-	Fmt fmt = { NULL };
+	Fmt fmt = { 0 };
 	comain( &fmt );										// prime
 	for ( ;; ) {
Index: doc/papers/concurrency/examples/Format.cc
===================================================================
--- doc/papers/concurrency/examples/Format.cc	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Format.cc	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -6,8 +6,8 @@
 			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
+					for ( ;; ) { // for newline characters
 						suspend();
-//						if ( ch != '\n' ) break; // ignore newline
-//					}
+						if ( ch != '\n' ) break; // ignore newline
+					}
 //					cout << ch; // print character
 				}
@@ -31,4 +31,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "u++-work -O2 -nodebubg Format.cc" //
+// compile-command: "u++-work -O2 -nodebug Format.cc" //
 // End: //
Index: doc/papers/concurrency/examples/Format.cfa
===================================================================
--- doc/papers/concurrency/examples/Format.cfa	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Format.cfa	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -11,7 +11,7 @@
 		for ( g = 0; g < 5; g += 1 ) {		// groups of 5 blocks
 			for ( b = 0; b < 4; b += 1 ) {	// blocks of 4 characters
-//				do {
+				do {
 					suspend();
-//				} while ( ch == '\n' || ch == '\t' );
+				} while ( ch == '\n' || ch == '\t' );
 				sout | ch;					// print character
 			}
Index: doc/papers/concurrency/examples/Format.data
===================================================================
--- doc/papers/concurrency/examples/Format.data	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Format.data	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -1,1 +1,3 @@
-abcdefghijklmnopqrstuvwxyzxxxxxxxxxxxxxx
+abcdefghijklmnop
+qrstuvwxyzx
+xxxxxxxxxxxxx
Index: doc/papers/concurrency/examples/Format.py
===================================================================
--- doc/papers/concurrency/examples/Format.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Format.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -4,5 +4,9 @@
 			for g in range( 5 ): 	# groups of 5 blocks
 				for b in range( 4 ): # blocks of 4 characters
-					print( (yield), end='' ) # receive from send
+					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
@@ -11,11 +15,13 @@
 			print()
 
+input = "abcdefghijklmnop\nqrstuvwx\nyzxxxxxxxxxxxxxx\n"
+
 fmt = Format()
 next( fmt )							# prime generator
-for i in range( 41 ):
-	fmt.send( 'a' );				# send to yield
+for i in input:
+	fmt.send( i );				# send to yield
 
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 Format.py" #
+# compile-command: "python3.7 Format.py" #
 # End: #
Index: doc/papers/concurrency/examples/Format1.c
===================================================================
--- doc/papers/concurrency/examples/Format1.c	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Format1.c	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -2,38 +2,38 @@
 
 typedef struct {
-	void * next;
+	int restart, g, b;
 	char ch;
-	int g, b;
 } Fmt;
 
 void format( Fmt * f ) {
-	if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
-	f->next = &&s1;
+	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 ?
+			  s1: if ( f->ch == '\0' ) goto fini;		// EOF ?
 				while ( f->ch == '\n' ) return;			// ignore
-				printf( "%c", f->ch );					// print character
+//				printf( "%c", f->ch );					// print character
 			}
-			printf( " " );								// block separator
+//			printf( " " );								// block separator
 		}
-		printf( "\n" );									// group separator
+//		printf( "\n" );									// group separator
 	}
-  fini:
-	if ( f->g != 0 || f->b != 0 ) printf( "\n" );
+  fini:;
+//	if ( f->g != 0 || f->b != 0 ) printf( "\n" );
 }
 
 int main() {
-	Fmt fmt = { NULL };
+	Fmt fmt = { 0 };
 	format( &fmt );										// prime
-	for ( ;; ) {
-		scanf( "%c", &fmt.ch );							// direct read into communication variable
-	  if ( feof( stdin ) ) break;
+	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';
+	fmt.ch = '\0';										// sentential (EOF)
 	format( &fmt );
 }
Index: doc/papers/concurrency/examples/PingPong.c
===================================================================
--- doc/papers/concurrency/examples/PingPong.c	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/PingPong.c	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -2,33 +2,16 @@
 
 typedef struct PingPong {
+	int restart;										// style 1
+	int N, i;
 	const char * name;
-	int N, i;
 	struct PingPong * partner;
-	void * next;
+	void * next;										// style 2
 } PingPong;
-#define PPCtor( name, N ) { name, N, 0, NULL, NULL }
+#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;
-#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 ) {
@@ -53,4 +36,32 @@
 	  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
 }
 
@@ -70,4 +81,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "gcc-8 -g -DPRINT PingPong.c" //
+// compile-command: "gcc-9 -g -DPRINT PingPong.c" //
 // End: //
Index: doc/papers/concurrency/examples/Pingpong.py
===================================================================
--- doc/papers/concurrency/examples/Pingpong.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Pingpong.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -1,32 +1,35 @@
 def PingPong( name, N ):
-	partner = (yield)           # get partner
-	yield                       # resume scheduler
+	partner = yield				# get partner
+	yield						# resume scheduler
 	for i in range( N ):
 		print( name )
-		yield partner           # execute next
+		yield partner			# execute next
 	print( "end", name )
 
 def Scheduler():
-	n = (yield)                 # starting coroutine
-	while True:
-		n = next( n )           # schedule coroutine
+	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
+next( pi )						# prime
+pi.send( po )					# send partner
+next( po )						# prime
+po.send( pi )					# send partner
 
 s = Scheduler();
-next( s )                       # prime
+next( s )						# prime
 try:
 	s.send( pi )				# start cycle
-except StopIteration:
-	print( "scheduler stop" )
+except StopIteration:			# scheduler stopped
+	pass
 print( "stop" )
 
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 Pingpong.py" #
+# compile-command: "python3.7 Pingpong.py" #
 # End: #
Index: doc/papers/concurrency/examples/ProdCons.py
===================================================================
--- doc/papers/concurrency/examples/ProdCons.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/ProdCons.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -1,40 +1,43 @@
 def Prod( N ):
-	cons = (yield)              # get cons
-	yield                       # resume scheduler
+	cons = yield				# get cons
+	yield						# resume scheduler
 	for i in range( N ):
 		print( "prod" )
-		yield cons              # execute next
+		yield cons				# execute next
 	print( "end", "prod" )
 
 def Cons( N ):
-	prod = (yield)              # get prod
-	yield                       # resume scheduler
+	prod = yield				# get prod
+	yield						# resume scheduler
 	for i in range( N ):
 		print( "cons" )
-		yield prod              # execute next
+		yield prod				# execute next
 	print( "end", "cons" )
 
 def Scheduler():
-	n = (yield)                 # starting coroutine
-	while True:
-		n = next( n )           # schedule coroutine
+	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
+next( prod )					# prime
+prod.send( cons )				# send cons
+next( cons )					# prime
+cons.send( prod )				# send prod
 
 s = Scheduler();
-next( s )                       # prime
+next( s )						# prime
 try:
 	s.send( prod )				# start cycle
-except StopIteration:
-	print( "scheduler stop" )
+except StopIteration:			# scheduler stopped
+	pass
 print( "stop" )
 
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 ProdCons.py" #
+# compile-command: "python3.7 ProdCons.py" #
 # End: #
Index: doc/papers/concurrency/examples/RWMonitor.cfa
===================================================================
--- doc/papers/concurrency/examples/RWMonitor.cfa	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#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 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;
-}
-void ?{}( ReadersWriter & rw ) with(rw) { rcnt = wcnt = 0; }
-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 RWMonitor.cfa" //
-// End: //
Index: doc/papers/concurrency/examples/Refactor.py
===================================================================
--- doc/papers/concurrency/examples/Refactor.py	(revision 2aab69b4163da6efa5478541e04523cb42d1b11f)
+++ doc/papers/concurrency/examples/Refactor.py	(revision a037f85b49948fe9469b696edd2db5dd4ad8751d)
@@ -26,4 +26,4 @@
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 Refactor.py" #
+# compile-command: "python3.7 Refactor.py" #
 # End: #
