func Init(posting *store.Store, log *commit.Logger) { lhmap = gotomic.NewHash() dirtymap = gotomic.NewHash() pstore = posting clog = log go checkMemoryUsage() }
func BenchmarkGotomic(b *testing.B) { h := gotomic.NewHash() b.RunParallel(func(pb *testing.PB) { for pb.Next() { key := uint64(rand.Int63()) _, has := h.Get(gotomic.IntKey(key)) if !has { l := posting.NewList() h.Put(gotomic.IntKey(key), l) } } }) }
func MergeLists(numRoutines int) { // We're merging all the lists, so just create a new dirtymap. dirtymap = gotomic.NewHash() ch := make(chan gotomic.Hashable, 10000) c := NewCounters() go c.periodicLog() defer c.ticker.Stop() go queueAll(ch, c) wg := new(sync.WaitGroup) for i := 0; i < numRoutines; i++ { wg.Add(1) go process(ch, c, wg) } wg.Wait() c.ticker.Stop() }
func NewGotomicMap() HashMap { return GotomicMap{gotomic.NewHash()} }
func Init(log *commit.Logger) { lhmap = gotomic.NewHash() dirtymap = gotomic.NewHash() clog = log go checkMemoryUsage() }
func (self *God) setupHashes() { for i := 0; i < len(self.hashes); i++ { self.hashes[i] = gotomic.NewHash() } }