func workerSearch(results []interface{}, ctrChanged chan<- struct{}, f func(int) interface{}, ctr *int64) {
	for atomic.LoadInt64(ctr) > 0 {
		res := f(0)
		if res == nil {
			continue
		}
		i := atomic.AddInt64(ctr, -1)
		if i >= 0 {
			results[i] = res
		}
		ctrChanged <- struct{}{}
	}
}
workerSearch is the subroutine called when doing a search command.

We need to keep searching for successful queries of f while *ctr > 0.
When we find a successful result, we decrement *ctr.
package pool
import (
	"io"
	"runtime"
	"sync"
	"sync/atomic"
)
func searchAlone(f func() interface{}, count int) []interface{} {
	results := make([]interface{}, count)
	for i := 0; i < len(results); i++ {
		results[i] = nil
		for ; results[i] == nil; results[i] = f() {
		}
	}
	return results
}
func parallelizeAlone(f func(int) interface{}, count int) []interface{} {
	results := make([]interface{}, count)
	for i := 0; i < len(results); i++ {
		results[i] = f(i)
	}
	return results
}
type command struct {
	search bool
	ctr *int64
	ctrChanged chan<- struct{}
	i int
	f func(int) interface{}
	results []interface{}
}