Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for popTail (0.12 sec)

  1. src/sync/export_test.go

    	return d.popHead()
    }
    
    func (d *poolDequeue) PopTail() (any, bool) {
    	return d.popTail()
    }
    
    func NewPoolChain() PoolDequeue {
    	return new(poolChain)
    }
    
    func (c *poolChain) PushHead(val any) bool {
    	c.pushHead(val)
    	return true
    }
    
    func (c *poolChain) PopHead() (any, bool) {
    	return c.popHead()
    }
    
    func (c *poolChain) PopTail() (any, bool) {
    	return c.popTail()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 16:39:52 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
Back to top