Index: benchmark/readyQ/locality.go
===================================================================
--- benchmark/readyQ/locality.go	(revision fd8453826f110225473b7e4733526a9736256037)
+++ benchmark/readyQ/locality.go	(revision 024fa4b4a110581c37421b7d8ae2b0c4de095704)
@@ -18,4 +18,5 @@
 	s * semaphore.Weighted
 	d * [] uint64
+	c context.Context
 }
 
@@ -24,7 +25,11 @@
 }
 
-func (this * Spot) put( s * semaphore.Weighted, data [] uint64, share bool) ([] uint64) {
-	ctx := GoCtx{s, &data}
-
+// Main handshake of the code
+// Single seat, first thread arriving waits
+// Next threads unblocks current one and blocks in its place
+// if share == true, exchange data in the process
+func (this * Spot) put( ctx * GoCtx, data * [] uint64, share bool) (* [] uint64) {
+	new := uintptr(unsafe.Pointer(ctx))
+	// fmt.Printf("Enter with %p\n", data)
 	var raw uintptr
 	for true {
@@ -33,5 +38,5 @@
 			return nil
 		}
-		if atomic.CompareAndSwapUintptr(&this.ptr, raw, uintptr(unsafe.Pointer(&ctx))) {
+		if atomic.CompareAndSwapUintptr(&this.ptr, raw, new) {
 			break
 		}
@@ -39,7 +44,8 @@
 
 	if raw != uintptr(0) {
-		val := (*GoCtx)(unsafe.Pointer(raw))
+		var val *GoCtx
+		val = (*GoCtx)(unsafe.Pointer(raw))
 		if share {
-			val.d = &data
+			val.d = data
 		}
 
@@ -47,7 +53,7 @@
 	}
 
-	ctx.s.Acquire(context.Background(), 1)
-
-	return *ctx.d
+	ctx.s.Acquire(ctx.c, 1)
+	// fmt.Printf("Leave with %p (was %p)\n", ctx.d, data)
+	return ctx.d
 }
 
@@ -72,12 +78,14 @@
 func local(result chan uint64, start chan struct{}, size uint64, cnt uint64, channels [] Spot, share bool) {
     	state := rand.Uint64()
-	var data [] uint64
-	data = make([]uint64, size)
+	var my_data [] uint64
+	my_data = make([]uint64, size)
 	for i := uint64(0); i < size; i++ {
-		data[i] = 0
+		my_data[i] = 0
 	}
+	data := &my_data
 
 	sem := semaphore.NewWeighted(1)
 	sem.Acquire(context.Background(), 1)
+	ctx := GoCtx{sem, data, context.Background()}
 
 	count := uint64(0)
@@ -85,14 +93,15 @@
 	for true {
 		for i := uint64(0); i < cnt; i++ {
-			data[__xorshift64(&state) % size] += 1
+			(*data)[__xorshift64(&state) % size] += 1
 		}
 
 		i := __xorshift64(&state) % uint64(len(channels))
-		data = channels[i].put(sem, data, share)
+		// data = channels[i].put(sem, data, share)
+		data = channels[i].put(&ctx, data, share)
 		count += 1
 
 		if  clock_mode && atomic.LoadInt32(&stop) == 1 { break }
 		if !clock_mode && count >= stop_count { break }
-		if uint64(len(data)) != size {
+		if uint64(len(*data)) != size {
 			panic("Data has weird size")
 		}
@@ -150,5 +159,7 @@
 	global_counter := uint64(0)
 	for i := 0; i < nthreads; i++ {
-		global_counter += <- result
+		r := <- result
+		global_counter += r
+		fmt.Printf("%d\n", r)
 	}
 
