- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for popTail (0.11 sec)
-
src/sync/poolqueue.go
val = nil } // Zero the slot. Unlike popTail, this isn't racing with // pushHead, so we don't need to be careful here. *slot = eface{} return val, true } // popTail removes and returns the element at the tail of the queue. // It returns false if the queue is empty. It may be called by any // number of consumers. func (d *poolDequeue) popTail() (any, bool) { var slot *eface for {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 18:12:29 UTC 2024 - 8.3K bytes - Viewed (0) -
src/sync/pool.go
New func() any } // Local per-P Pool appendix. type poolLocalInternal struct { private any // Can be used only by the respective P. shared poolChain // Local P can pushHead/popHead; any P can popTail. } type poolLocal struct { poolLocalInternal // Prevents false sharing on widespread platforms with // 128 mod (cache line size) = 0 . pad [128 - unsafe.Sizeof(poolLocalInternal{})%128]byte }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 21:14:51 UTC 2024 - 9.4K bytes - Viewed (0) -
src/sync/pool_test.go
atomic.StoreInt32(&stop, 1) } } // Start P-1 consumers. for i := 1; i < P; i++ { wg.Add(1) go func() { fail := 0 for atomic.LoadInt32(&stop) == 0 { val, ok := d.PopTail() if ok { fail = 0 record(val.(int)) } else { // Speed up the test by // allowing the pusher to run. if fail++; fail%100 == 0 { runtime.Gosched() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 8K bytes - Viewed (0)