Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/contend.cfa
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/contend.cfa	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/contend.cfa	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,99 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+#include <locks.hfa>
+#include <fstream.hfa>
+#include <stdio.h>
+#include <time.hfa>
+#include <string.h>
+
+// #define NUM_CHANS 1
+#define GLUE_HELPER(x, y) x##y
+#define FN_GLUE(x, y) GLUE_HELPER(x, y)
+
+size_t Processors = 2, Producers = 1, Consumers = 1, ChannelSize = 10;
+
+channel(size_t) * chans;
+
+static inline void cons_wait_1( size_t & val ) { waituntil( val << chans[0] ) {} }
+static inline void cons_wait_2( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} }
+static inline void cons_wait_3( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} }
+static inline void cons_wait_4( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} }
+static inline void cons_wait_5( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} }
+static inline void cons_wait_6( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or waituntil( val << chans[5] ) {} }
+static inline void cons_wait_7( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or waituntil( val << chans[5] ) {} or waituntil( val << chans[6] ) {} }
+static inline void cons_wait_8( size_t & val ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or waituntil( val << chans[5] ) {} or waituntil( val << chans[6] ) {} or waituntil( val << chans[7] ) {}}
+
+static inline void prods_wait_1( size_t val ) { waituntil( val >> chans[0] ) {} }
+static inline void prods_wait_2( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} }
+static inline void prods_wait_3( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} }
+static inline void prods_wait_4( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} }
+static inline void prods_wait_5( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} }
+static inline void prods_wait_6( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or waituntil( val >> chans[5] ) {} }
+static inline void prods_wait_7( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or waituntil( val >> chans[5] ) {} or waituntil( val >> chans[6] ) {} }
+static inline void prods_wait_8( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or waituntil( val >> chans[5] ) {} or waituntil( val >> chans[6] ) {} or waituntil( val >> chans[7] ) {}}
+
+size_t globalTotal = 0;
+
+thread Consumer {};
+void main( Consumer & this ) {
+    size_t val, i = 0;
+    try {
+        for(;; i++ ) {
+            FN_GLUE(cons_wait_, NUM_CHANS)(val);
+        }
+    } catch( channel_closed * e ) {}
+    __atomic_fetch_add( &globalTotal, i, __ATOMIC_SEQ_CST );
+}
+
+thread Producer {};
+void main( Producer & this ) {
+    try {
+        for( size_t i = 0;; i++ ) {
+            FN_GLUE(prods_wait_, NUM_CHANS)(i);
+        }
+    } catch( channel_closed * e ) {}
+}
+
+int main( int argc, char * argv[] ) {
+    switch ( argc ) {
+	  case 3:
+		if ( strcmp( argv[2], "d" ) != 0 ) {			// default ?
+			ChannelSize = atoi( argv[2] );
+		} // if
+	  case 2:
+		if ( strcmp( argv[1], "d" ) != 0 ) {			// default ?
+			Processors = atoi( argv[1] );
+			if ( Processors < 1 ) goto Usage;
+		} // if
+	  case 1:											// use defaults
+		break;
+	  default:
+	  Usage:
+		sout | "Usage: " | argv[0]
+             | " [ processors (> 0) | 'd' (default " | Processors
+			 | ") ] [ channel size (>= 0) | 'd' (default " | ChannelSize
+			 | ") ]" ;
+		exit( EXIT_FAILURE );
+	} // switch
+    Producers = Processors / 2;
+    Consumers = Processors / 2;
+
+    processor p[Processors - 1];
+
+    chans = aalloc( NUM_CHANS );
+    for ( i; NUM_CHANS )
+        chans[i]{ ChannelSize };
+
+    {
+        Producer p[Producers];
+        Consumer c[Consumers];
+
+        sleep(10`s);
+
+        for ( i; NUM_CHANS )
+            close( chans[i] );
+    }
+    adelete( chans );
+    printf("%zu\n", globalTotal);
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/sidechan.cfa
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/sidechan.cfa	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/sidechan.cfa	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,100 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+#include <locks.hfa>
+#include <fstream.hfa>
+#include <stdio.h>
+#include <time.hfa>
+#include <string.h>
+
+size_t Sets = 1, ChannelSize = 100, Channels = 2;
+
+channel(size_t) * chans;
+
+size_t globalTotal = 0;
+int cons_counter = 0, prod_counter = 0;
+
+thread SelectConsumer {};
+void main( SelectConsumer & this ) {
+    size_t val, i = 0;
+    try {
+        for(;; i++ ) {
+            waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {}
+        }
+    } catch( channel_closed * e ) {}
+    __atomic_fetch_add( &globalTotal, i, __ATOMIC_SEQ_CST );
+}
+
+thread SelectProducer {};
+void main( SelectProducer & this ) {
+    try {
+        for( size_t i = 0;; i++ ) {
+            waituntil( i >> chans[0] ) {} or waituntil( i >> chans[1] ) {}
+        }
+    } catch( channel_closed * e ) {}
+}
+
+thread Consumer {};
+void main( Consumer & this ) {
+    int idx = __atomic_fetch_add( &cons_counter, 1, __ATOMIC_SEQ_CST ) % Channels;
+    size_t val, i = 0;
+    try {
+        for(;; i++ ) {
+            remove( chans[idx] );
+        }
+    } catch( channel_closed * e ) {}
+    __atomic_fetch_add( &globalTotal, i, __ATOMIC_SEQ_CST );
+}
+
+thread Producer {};
+void main( Producer & this ) {
+    int idx = __atomic_fetch_add( &prod_counter, 1, __ATOMIC_SEQ_CST ) % Channels;
+    try {
+        for( size_t i = 0;; i++ ) {
+            insert( chans[idx], i );
+        }
+    } catch( channel_closed * e ) {}
+}
+
+int main( int argc, char * argv[] ) {
+    switch ( argc ) {
+	  case 3:
+		if ( strcmp( argv[2], "d" ) != 0 ) {			// default ?
+			ChannelSize = atoi( argv[2] );
+		} // if
+	  case 2:
+		if ( strcmp( argv[1], "d" ) != 0 ) {			// default ?
+			Sets = atoi( argv[1] );
+			if ( Sets < 1 ) goto Usage;
+		} // if
+	  case 1:											// use defaults
+		break;
+	  default:
+	  Usage:
+		sout | "Usage: " | argv[0]
+             | " [ sets (> 0) | 'd' (default " | Sets
+			 | ") ] [ channel size (>= 0) | 'd' (default " | ChannelSize
+			 | ") ]" ;
+		exit( EXIT_FAILURE );
+	} // switch
+
+    processor p[Sets * 2 + Sets * Channels * 2 - 1];
+
+    chans = aalloc( Channels );
+    for ( i; Channels )
+        chans[i]{ ChannelSize };
+
+    {
+        Producer p[Sets * Channels];
+        SelectProducer sp[Sets];
+        Consumer c[Sets * Channels];
+        SelectConsumer sc[Sets];
+
+        sleep(10`s);
+
+        for ( i; Channels )
+            close( chans[i] );
+    }
+    adelete( chans );
+    printf("%zu\n", globalTotal);
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/spin.cfa
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/spin.cfa	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/cfa/spin.cfa	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,99 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+#include <locks.hfa>
+#include <fstream.hfa>
+#include <stdio.h>
+#include <time.hfa>
+#include <string.h>
+
+// #define NUM_CHANS 1
+#define GLUE_HELPER(x, y) x##y
+#define FN_GLUE(x, y) GLUE_HELPER(x, y)
+
+size_t Processors = 2, Producers = 1, Consumers = 1, ChannelSize = 10;
+
+channel(size_t) * chans;
+
+static inline void cons_wait_1( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or else { i--; }  }
+static inline void cons_wait_2( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or else { i--; }  }
+static inline void cons_wait_3( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or else { i--; }  }
+static inline void cons_wait_4( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or else { i--; }  }
+static inline void cons_wait_5( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or else { i--; }  }
+static inline void cons_wait_6( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or waituntil( val << chans[5] ) {} or else { i--; }  }
+static inline void cons_wait_7( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or waituntil( val << chans[5] ) {} or waituntil( val << chans[6] ) {} or else { i--; }  }
+static inline void cons_wait_8( size_t & val, size_t & i ) { waituntil( val << chans[0] ) {} or waituntil( val << chans[1] ) {} or waituntil( val << chans[2] ) {} or waituntil( val << chans[3] ) {} or waituntil( val << chans[4] ) {} or waituntil( val << chans[5] ) {} or waituntil( val << chans[6] ) {} or waituntil( val << chans[7] ) {} or else { i--; } }
+
+static inline void prods_wait_1( size_t val ) { waituntil( val >> chans[0] ) {} or else {} }
+static inline void prods_wait_2( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or else {} }
+static inline void prods_wait_3( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or else {} }
+static inline void prods_wait_4( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or else {} }
+static inline void prods_wait_5( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or else {} }
+static inline void prods_wait_6( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or waituntil( val >> chans[5] ) {} or else {} }
+static inline void prods_wait_7( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or waituntil( val >> chans[5] ) {} or waituntil( val >> chans[6] ) {} or else {} }
+static inline void prods_wait_8( size_t val ) { waituntil( val >> chans[0] ) {} or waituntil( val >> chans[1] ) {} or waituntil( val >> chans[2] ) {} or waituntil( val >> chans[3] ) {} or waituntil( val >> chans[4] ) {} or waituntil( val >> chans[5] ) {} or waituntil( val >> chans[6] ) {} or waituntil( val >> chans[7] ) {} or else {} }
+
+size_t globalTotal = 0;
+
+thread Consumer {};
+void main( Consumer & this ) {
+    size_t val, i = 0;
+    try {
+        for(;; i++ ) {
+            FN_GLUE(cons_wait_, NUM_CHANS)(val, i);
+        }
+    } catch( channel_closed * e ) {}
+    __atomic_fetch_add( &globalTotal, i, __ATOMIC_SEQ_CST );
+}
+
+thread Producer {};
+void main( Producer & this ) {
+    try {
+        for( size_t i = 0;; i++ ) {
+            FN_GLUE(prods_wait_, NUM_CHANS)(i);
+        }
+    } catch( channel_closed * e ) {}
+}
+
+int main( int argc, char * argv[] ) {
+    switch ( argc ) {
+	  case 3:
+		if ( strcmp( argv[2], "d" ) != 0 ) {			// default ?
+			ChannelSize = atoi( argv[2] );
+		} // if
+	  case 2:
+		if ( strcmp( argv[1], "d" ) != 0 ) {			// default ?
+			Processors = atoi( argv[1] );
+			if ( Processors < 1 ) goto Usage;
+		} // if
+	  case 1:											// use defaults
+		break;
+	  default:
+	  Usage:
+		sout | "Usage: " | argv[0]
+             | " [ processors (> 0) | 'd' (default " | Processors
+			 | ") ] [ channel size (>= 0) | 'd' (default " | ChannelSize
+			 | ") ]" ;
+		exit( EXIT_FAILURE );
+	} // switch
+    Producers = Processors / 2;
+    Consumers = Processors / 2;
+
+    processor p[Processors - 1];
+
+    chans = aalloc( NUM_CHANS );
+    for ( i; NUM_CHANS )
+        chans[i]{ ChannelSize };
+
+    {
+        Producer p[Producers];
+        Consumer c[Consumers];
+
+        sleep(10`s);
+
+        for ( i; NUM_CHANS )
+            close( chans[i] );
+    }
+    adelete( chans );
+    printf("%zu\n", globalTotal);
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend/contend.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,123 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 8, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations, cons_check, prod_check uint64 = 0, 0, 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int, Prods)
+var consJoin chan int = make(chan int, Cons)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+			case <- chans[1]:
+			case <- chans[2]:
+			case <- chans[3]:
+			case <- chans[4]:
+			case <- chans[5]:
+			case <- chans[6]:
+			case <- chans[7]:
+		}
+		if ! prod_done { count++ }
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			case chans[2] <- count:
+			case chans[3] <- count:
+			case chans[4] <- count:
+			case chans[5] <- count:
+			case chans[6] <- count:
+			case chans[7] <- count:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module contend
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend2/contend.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend2/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend2/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,111 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 2, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations, cons_check, prod_check uint64 = 0, 0, 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int, Prods)
+var consJoin chan int = make(chan int, Cons)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+			case <- chans[1]:
+		}
+		if ! prod_done { count++ }
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend2/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend2/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend2/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module contend
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend4/contend.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend4/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend4/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,115 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 4, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations, cons_check, prod_check uint64 = 0, 0, 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int, Prods)
+var consJoin chan int = make(chan int, Cons)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+			case <- chans[1]:
+			case <- chans[2]:
+			case <- chans[3]:
+		}
+		if ! prod_done { count++ }
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			case chans[2] <- count:
+			case chans[3] <- count:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend4/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend4/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend4/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module contend
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend8/contend.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend8/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend8/contend.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,123 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 8, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations, cons_check, prod_check uint64 = 0, 0, 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int, Prods)
+var consJoin chan int = make(chan int, Cons)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+			case <- chans[1]:
+			case <- chans[2]:
+			case <- chans[3]:
+			case <- chans[4]:
+			case <- chans[5]:
+			case <- chans[6]:
+			case <- chans[7]:
+		}
+		if ! prod_done { count++ }
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			case chans[2] <- count:
+			case chans[3] <- count:
+			case chans[4] <- count:
+			case chans[5] <- count:
+			case chans[6] <- count:
+			case chans[7] <- count:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend8/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend8/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/contend8/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module contend
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/sidechan/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/sidechan/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/sidechan/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module sidechan
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/sidechan/sidechan.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/sidechan/sidechan.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/sidechan/sidechan.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,136 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Sets, Channels, ChannelSize int = 1, 2, 100
+var cons_done, prod_done bool = false, false;
+var total_operations uint64 = 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int)
+var consJoin chan int = make(chan int)
+
+func selectconsumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }		
+		select {
+			case <- chans[0]:
+			case <- chans[1]:
+		}
+		if ! prod_done { count++ }
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func consumer( channel chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		<-channel
+		if ! prod_done { count++ }
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func selectproducer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	var checksum uint64 = 0
+	for {
+		if prod_done { break }
+		checksum = checksum ^ count
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func producer( channel chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		channel <- count
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ sets (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Sets, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Sets, _ = strconv.Atoi( os.Args[1] )
+				if Sets < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Sets * 2 + Sets * Channels * 2 );
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+
+	
+	for j := 0; j < Sets; j++ {
+		go selectproducer( chans )
+		go selectconsumer( chans )
+		for i := 0; i < Channels; i++ {
+			go producer( chans[i] )
+			go consumer( chans[i] )
+		}
+	}
+		
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Sets + Sets * Channels; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Sets + Sets * Channels; j++{
+		<-consJoin
+	}
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module spin
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin/spin.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,133 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 8, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations uint64 = 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int)
+var consJoin chan int = make(chan int)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+				if ! prod_done { count++ }
+			case <- chans[1]:
+				if ! prod_done { count++ }
+			case <- chans[2]:
+				if ! prod_done { count++ }
+			case <- chans[3]:
+				if ! prod_done { count++ }
+			case <- chans[4]:
+				if ! prod_done { count++ }
+			case <- chans[5]:
+				if ! prod_done { count++ }
+			case <- chans[6]:
+				if ! prod_done { count++ }
+			case <- chans[7]:
+				if ! prod_done { count++ }
+			default:
+		}
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			case chans[2] <- count:
+			case chans[3] <- count:
+			case chans[4] <- count:
+			case chans[5] <- count:
+			case chans[6] <- count:
+			case chans[7] <- count:
+			default:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+		
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin2/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin2/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin2/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module spin
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin2/spin.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin2/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin2/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,115 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 2, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations uint64 = 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int)
+var consJoin chan int = make(chan int)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+				if ! prod_done { count++ }
+			case <- chans[1]:
+				if ! prod_done { count++ }
+			default:
+		}
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			default:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+		
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin4/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin4/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin4/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module spin
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin4/spin.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin4/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin4/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,120 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 4, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations uint64 = 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int)
+var consJoin chan int = make(chan int)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+				if ! prod_done { count++ }
+			case <- chans[1]:
+				if ! prod_done { count++ }
+			case <- chans[2]:
+				if ! prod_done { count++ }
+			case <- chans[3]:
+			default:
+		}
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			case chans[2] <- count:
+			case chans[3] <- count:
+			default:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+		
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin8/go.mod
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin8/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin8/go.mod	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,3 @@
+module spin
+
+go 1.18
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin8/spin.go
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin8/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/go/spin8/spin.go	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,133 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+	"runtime"
+	"os"
+	"strconv"
+)
+
+var Processors, Channels, Prods, Cons, ChannelSize int = 2, 8, 1, 1, 10
+var cons_done, prod_done bool = false, false;
+var total_operations uint64 = 0
+var m sync.Mutex
+
+var prodJoin chan int = make(chan int)
+var consJoin chan int = make(chan int)
+
+func consumer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if cons_done { break }
+		
+		select {
+			case <- chans[0]:
+				if ! prod_done { count++ }
+			case <- chans[1]:
+				if ! prod_done { count++ }
+			case <- chans[2]:
+				if ! prod_done { count++ }
+			case <- chans[3]:
+				if ! prod_done { count++ }
+			case <- chans[4]:
+				if ! prod_done { count++ }
+			case <- chans[5]:
+				if ! prod_done { count++ }
+			case <- chans[6]:
+				if ! prod_done { count++ }
+			case <- chans[7]:
+				if ! prod_done { count++ }
+			default:
+		}
+	}
+	m.Lock()
+	total_operations += count
+	m.Unlock()
+	consJoin <- 0
+}
+
+func producer( chans [] chan uint64 ) {
+	var count uint64 = 0
+	for {
+		if prod_done { break }
+		select {
+			case chans[0] <- count:
+			case chans[1] <- count:
+			case chans[2] <- count:
+			case chans[3] <- count:
+			case chans[4] <- count:
+			case chans[5] <- count:
+			case chans[6] <- count:
+			case chans[7] <- count:
+			default:
+		}
+		count++
+	}
+	prodJoin <- 0
+}
+
+func usage() {
+	fmt.Printf( "Usage: %v " +
+		"[ processors (> 0) | 'd' (default %v) ] " +
+		"[ ChannelSize (> 0) | 'd' (default %v) ]\n",
+		os.Args[0], Processors, ChannelSize );
+	os.Exit( 1 );
+}
+
+func main() {
+	switch len( os.Args ) {
+		case 3:
+			if os.Args[2] != "d" {							// default ?
+				ChannelSize, _ = strconv.Atoi( os.Args[2] )
+					if ChannelSize < 0 { usage(); }
+			} // if
+		fallthrough
+		case 2:
+			if os.Args[1] != "d" {							// default ?
+				Processors, _ = strconv.Atoi( os.Args[1] )
+				if Processors < 1 { usage(); }
+			} // if
+		case 1:											// use defaults
+		default:
+		usage();
+	} // switch
+	runtime.GOMAXPROCS( Processors );
+	Prods = Processors /2
+	Cons = Processors / 2
+
+	// fmt.Println("Processors: ",Processors," Channels: ",Channels," ProdsPerChan: ",ProdsPerChan," ConsPerChan: ",ConsPerChan," Channel Size: ",ChannelSize)
+	
+	chans := make( [] chan uint64, Channels )
+	for i := range chans {
+		chans[i] = make(chan uint64, ChannelSize)
+	}
+	for j := 0; j < Prods; j++ {
+		go producer( chans )
+	}
+
+	for j := 0; j < Cons; j++ {
+		go consumer( chans )
+	}
+		
+
+	// wait 10 seconds
+	time.Sleep(time.Second * 10)
+	// fmt.Println("prod done\n")
+	prod_done = true
+	for j := 0; j < Prods; j++ {
+		<-prodJoin
+	}
+	// fmt.Println("cons done\n")
+	cons_done = true
+	for i := range chans {
+		close(chans[i])
+	}
+	
+	for j := 0; j < Cons; j++{
+		<-consJoin
+	}
+
+    fmt.Println(total_operations)
+}
Index: doc/theses/colby_parsons_MMAth/benchmarks/waituntil/run
===================================================================
--- doc/theses/colby_parsons_MMAth/benchmarks/waituntil/run	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
+++ doc/theses/colby_parsons_MMAth/benchmarks/waituntil/run	(revision 382467f107c8ab83732aeb24661a7f05cc7990cb)
@@ -0,0 +1,244 @@
+#!/bin/bash -
+
+false=0; true=1
+
+# Usage: arch [ hostname ] returns hostname, cores, startcore
+#
+#   Define machine architecture based on starting socket, CPUs (cores) per socket, number of
+#   sockets, has hyperthreading.
+
+start=0
+
+arch() {
+	hostname=${1:-`hostname`}			# return value
+	hashyper=${true}					# assume machine has hyperthreads
+	if [ "${hostname}" = "plg2" ] ; then
+		startsocket=${start}
+		cps=16							# coresPerSocket
+		sockets=2
+		hashyper=${false}				# has no hyperthreads
+	elif [ "${hostname}" = "nasus" ] ; then
+		startsocket=${start}
+		cps=64							# coresPerSocket
+		sockets=2
+	elif [ "${hostname}" = "pyke" ] ; then
+		startsocket=${start}
+		cps=24							# coresPerSocket
+		sockets=2
+	elif [ "${hostname}" = "jax" ] ; then
+		startsocket=${start}
+		cps=24							# coresPerSocket
+		sockets=4
+	else
+		echo "unsupported host" ${hostname}
+		exit 1
+	fi
+	cores=$(( ${cps} * ${sockets} ))
+	startcore=$(( ${startsocket} * ${cps} ))
+}
+
+# Usage: affinity (global cps, sockets, startsocket, hashyper, cores, startcore, wrap)
+#   returns taskset argument
+#
+#   This routine assumes hyperthreading has only 2 hyperthreads per core.
+#
+#   If hyperthread scanning is used: processor units are assigned across the low-number hyperthreads
+#   of the socket's cores. When the low-number hyperthreads are filled, the high-number hyperhtreads
+#   are assigned across the socket's cores. Then the next socket is assigned.
+#
+#   If hyperthread wrapping is used: processor units are assigned in low/high-number pairs of
+#   hyperthreads across the socket's cores. Then the next socket is assigned.
+
+wrap=${false}							# set to control hyperthread assignment across socket cores
+
+affinity() {
+	if [ ${wrap} -eq ${true} -a ${hashyper} -eq ${false} ] ; then
+		echo "architecture does not support hyperthreading for wrapping"
+		exit 1
+	fi
+	taskset=""							# return value
+	set -- $(( ${1} - 1 ))				# decrement $1
+	if [ ${1} -eq 0 ] ; then taskset="${startcore}-${startcore}"; return; fi
+	if [ ${1} -ge $(( ${cps} * ( ${sockets} - ${startsocket} ) * ( ${hashyper} + 1 ) )) ] ; then # error
+		echo "not enough cores $(( ${cores} * ${sockets} )) for $(( ${1} + 1 )) starting at ${startcore}"
+		exit 1
+	fi
+	if [ ${hashyper} -eq ${false} ] ; then taskset="${startcore}-$(( ${1} + ${startcore} ))"; return; fi # no hyperthreads
+	start2=$(( ${startcore} + ${cores} ))
+	if [ ${wrap} -eq ${true} ] ; then 	# hyperthread wrapping
+		end1=$(( ${1} / 2 + ${startcore} ))
+		end2=$(( ${end1} + ${cores} ))
+		if [ $(( ${1} % 2 )) -eq 0 ] ; then
+			end2=$(( ${end2} - 1 ))
+		fi
+		taskset="${startcore}-${end1},${start2}-${end2}"
+	else								# hyperthread scanning
+		if [ ${1} -lt ${cps} ] ; then taskset="${startcore}-$(( ${1} + ${startcore} ))"; return; fi
+		filled=$(( ${1} / ( ${cps} * 2 ) * ${cps} ))
+		modulus=$(( ${1} % ( ${cps} * 2 ) ))	# leftover cores added to saturated sockets
+		if [ ${modulus} -gt ${cps} ] ; then
+			taskset="${startcore}-$(( ${startcore} + ${filled} + ${cps} - 1 )),${start2}-$(( ${start2} + ${filled} + ${modulus} % ${cps} ))"
+		else
+			taskset="${startcore}-$(( ${startcore} + ${filled} + ${modulus} )),${start2}-$(( ${start2} + ${filled} - 1 ))"
+		fi
+	fi
+}
+
+# numtimes=5
+numtimes=1
+
+# num_threads='2 4 8 16 24 32'
+# side_chan_threads='6 12 18 24 30' # must be mults of 6
+num_threads='2'
+side_chan_threads='6'
+
+chan_size='10'
+
+# toggle benchmarks
+spin=${true}
+contend=${true}
+sidechan=${true}
+# spin=${false}
+# contend=${false}
+# sidechan=${false}
+
+runCFA=${true}
+runGO=${true}
+# runCFA=${false}
+# runGO=${false}
+
+cfa=~/cfa-cc/driver/cfa
+
+# Helpers to minimize code duplication
+
+# repeats a command ${numtimes}
+preprint=''
+repeat_command() {
+    t=1
+    while [ ${t} -le ${numtimes} ] ; do
+        echo -n -e ${preprint}
+        "${@}"
+        t=`expr ${t} + 1`
+    done
+}
+
+# prints the leading info for a given run of a variant
+print_header() {
+    echo ${1}':'
+    echo -e "cores\tthroughput (entries)"
+}
+
+# runs the current benchmark with provided args
+# only works for standard-run benchmarks (not Akka)
+# must split into pre and post args to be able to supply val of p
+pre_args=''
+post_args=''
+single_run() {
+    affinity ${1}
+    preprint="${1}\t"
+    repeat_command taskset -c ${taskset} ./a.${hostname} ${pre_args} ${1} ${post_args}
+}
+
+# runs the current bench for all processor vals
+# works for standard benchs that dont need to set a config file (not Akka or CAF)
+run_bench() {
+    for p in ${num_threads} ; do
+        single_run ${p}
+    done
+}
+
+run_side_chan() {
+    i=1
+    for p in ${side_chan_threads} ; do
+        affinity ${p}
+        preprint="${p}\t"
+        repeat_command taskset -c ${taskset} ./a.${hostname} ${pre_args} ${i} ${post_args}
+        i=`expr ${i} + 1`
+    done
+}
+
+arch # get hostname
+
+# set up leading info for python script
+echo $numtimes
+echo $num_threads
+echo $side_chan_threads
+
+if [ ${runCFA} -eq ${true} ]; then
+    echo -n 'CFA '
+fi
+if [ ${runGO} -eq ${true} ]; then
+    echo -n 'Go '
+fi
+echo ""
+
+# done printing header info for output
+
+# cfa flags
+cfa_flags='-quiet -O3 -nodebug -DNDEBUG'
+
+# run the benchmarks
+
+run_contend() {
+    post_args=${1}
+
+    if [ ${runCFA} -eq ${true} ] ; then
+        cd cfa # CFA RUN
+        print_header 'CFA'
+        ${cfa} ${cfa_flags} '-DNUM_CHANS='${3} ${2}.cfa -o a.${hostname} > /dev/null 2>&1
+        run_bench
+        rm a.${hostname}
+        cd - > /dev/null
+    fi # done CFA
+
+    if [ ${runGO} -eq ${true} ] ; then
+        cd go/${2}${3} # Go RUN
+        print_header 'Go'
+        go build -o a.${hostname} > /dev/null 2>&1
+        run_bench
+        rm a.${hostname}
+        cd - > /dev/null
+    fi # done Go
+}
+
+# /usr/bin/time -f "%Uu %Ss %Er %Mkb"
+if [ ${contend} -eq ${true} ] ; then
+    echo "contend2: "
+    run_contend ${chan_size} 'contend' '2'
+    echo "contend4: "
+    run_contend ${chan_size} 'contend' '4'
+    echo "contend8: "
+    run_contend ${chan_size} 'contend' '8'
+fi
+
+if [ ${spin} -eq ${true} ] ; then
+    echo "spin2: "
+    run_contend ${chan_size} 'spin' '2'
+    echo "spin4: "
+    run_contend ${chan_size} 'spin' '4'
+    echo "spin8: "
+    run_contend ${chan_size} 'spin' '8'
+fi
+
+if [ ${sidechan} -eq ${true} ] ; then
+    echo "sidechan: "
+    post_args=${chan_size}
+    if [ ${runCFA} -eq ${true} ] ; then
+        cd cfa # CFA RUN
+        print_header 'CFA'
+        ${cfa} ${cfa_flags} sidechan.cfa -o a.${hostname} > /dev/null 2>&1
+        run_side_chan
+        rm a.${hostname}
+        cd - > /dev/null
+    fi # done CFA
+
+    if [ ${runGO} -eq ${true} ] ; then
+        cd go/sidechan
+        print_header 'Go'
+        go build -o a.${hostname} > /dev/null 2>&1
+        run_side_chan
+        rm a.${hostname}
+        cd - > /dev/null
+    fi # done Go
+fi
+
