Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 339 for Dequeue (0.13 sec)

  1. src/runtime/sema_test.go

    				for i := 0; i < n; i++ {
    					if i < n/2 {
    						tab.Enqueue(&u[0])
    					} else {
    						tab.Enqueue(&u[SemTableSize])
    					}
    				}
    				for i := 0; i < n; i++ {
    					var ok bool
    					if i < n/2 {
    						ok = tab.Dequeue(&u[0])
    					} else {
    						ok = tab.Dequeue(&u[SemTableSize])
    					}
    					if !ok {
    						b.Fatal("failed to dequeue")
    					}
    				}
    			}
    		})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 21 19:37:22 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list_test.go

    	arrival := []*request{{}, {}, {}, {}, {}, {}}
    
    	list := newRequestFIFO()
    	for i := range arrival {
    		list.Enqueue(arrival[i])
    	}
    
    	dequeued := make([]*request, 0)
    	for list.Length() > 0 {
    		req, _ := list.Dequeue()
    		dequeued = append(dequeued, req)
    	}
    
    	verifyOrder(t, arrival, dequeued)
    }
    
    func TestFIFOWithEnqueueDequeueSomeRequestsRemainInQueue(t *testing.T) {
    	list := newRequestFIFO()
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jul 28 08:48:40 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  3. pilot/pkg/xds/pushqueue_test.go

    		t.Parallel()
    		p := NewPushQueue()
    		defer p.ShutDown()
    		p.Enqueue(proxies[0], &model.PushRequest{})
    		p.Enqueue(proxies[1], &model.PushRequest{})
    
    		ExpectDequeue(t, p, proxies[0])
    		ExpectDequeue(t, p, proxies[1])
    	})
    
    	t.Run("remove too many", func(t *testing.T) {
    		t.Parallel()
    		p := NewPushQueue()
    		defer p.ShutDown()
    
    		p.Enqueue(proxies[0], &model.PushRequest{})
    
    		ExpectDequeue(t, p, proxies[0])
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 30 00:26:45 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  4. src/sync/poolqueue.go

    //
    // This is implemented as a doubly-linked list queue of poolDequeues
    // where each dequeue is double the size of the previous one. Once a
    // dequeue fills up, this allocates a new one and only ever pushes to
    // the latest dequeue. Pops happen from the other end of the list and
    // once a dequeue is exhausted, it gets removed from the list.
    type poolChain struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 18:12:29 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go

    // is not safe for concurrent use by multiple goroutines.
    type fifo interface {
    	// Enqueue enqueues the specified request into the list and
    	// returns a removeFromFIFOFunc function that can be used to remove the
    	// request from the list
    	Enqueue(*request) removeFromFIFOFunc
    
    	// Dequeue pulls out the oldest request from the list.
    	Dequeue() (*request, bool)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 20 16:05:53 UTC 2021
    - 3.9K bytes
    - Viewed (0)
  6. src/internal/fuzz/queue_test.go

    import "testing"
    
    func TestQueue(t *testing.T) {
    	// Zero valued queue should have 0 length and capacity.
    	var q queue
    	if n := q.len; n != 0 {
    		t.Fatalf("empty queue has len %d; want 0", n)
    	}
    	if n := q.cap(); n != 0 {
    		t.Fatalf("empty queue has cap %d; want 0", n)
    	}
    
    	// As we add elements, len should grow.
    	N := 32
    	for i := 0; i < N; i++ {
    		q.enqueue(i)
    		if n := q.len; n != i+1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 02 17:58:51 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  7. pilot/pkg/xds/pushqueue.go

    	for len(p.queue) == 0 && !p.shuttingDown {
    		p.cond.Wait()
    	}
    
    	if len(p.queue) == 0 {
    		// We must be shutting down.
    		return nil, nil, true
    	}
    
    	con = p.queue[0]
    	// The underlying array will still exist, despite the slice changing, so the object may not GC without this
    	// See https://github.com/grpc/grpc-go/issues/4758
    	p.queue[0] = nil
    	p.queue = p.queue[1:]
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Sep 16 01:37:15 UTC 2021
    - 3.8K bytes
    - Viewed (0)
  8. src/internal/fuzz/queue.go

    	q.head = 0
    }
    
    func (q *queue) enqueue(e any) {
    	if q.len+1 > q.cap() {
    		q.grow()
    	}
    	i := (q.head + q.len) % q.cap()
    	q.elems[i] = e
    	q.len++
    }
    
    func (q *queue) dequeue() (any, bool) {
    	if q.len == 0 {
    		return nil, false
    	}
    	e := q.elems[q.head]
    	q.elems[q.head] = nil
    	q.head = (q.head + 1) % q.cap()
    	q.len--
    	return e, true
    }
    
    func (q *queue) peek() (any, bool) {
    	if q.len == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Nov 05 21:02:45 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  9. test/chanlinear.go

    			d := make(chan bool)
    			a = append(a, d)
    			go func() {
    				for j := 0; j < messages; j++ {
    					// queue ourselves on the global channel
    					select {
    					case <-c:
    					case <-d:
    					}
    				}
    			}()
    		}
    		for i := 0; i < messages; i++ {
    			// wake each goroutine up, forcing it to dequeue and then enqueue
    			// on the global channel.
    			for _, d := range a {
    				d <- true
    			}
    		}
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  10. src/runtime/sema.go

    			if s.parent.next != s {
    				panic("semaRoot queue")
    			}
    			root.rotateLeft(s.parent)
    		}
    	}
    }
    
    // dequeue searches for and finds the first goroutine
    // in semaRoot blocked on addr.
    // If the sudog was being profiled, dequeue returns the time
    // at which it was woken up as now. Otherwise now is 0.
    // If there are additional entries in the wait list, dequeue
    // returns tailtime set to the last entry's acquiretime.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 19K bytes
    - Viewed (0)
Back to top