Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for runqdrain (0.11 sec)

  1. src/runtime/mgc.go

    				if gp.preempt {
    					// We were preempted. This is
    					// a useful signal to kick
    					// everything out of the run
    					// queue so it can run
    					// somewhere else.
    					if drainQ, n := runqdrain(pp); n > 0 {
    						lock(&sched.lock)
    						globrunqputbatch(&drainQ, int32(n))
    						unlock(&sched.lock)
    					}
    				}
    				// Go back to draining, this time
    				// without preemption.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 62K bytes
    - Viewed (0)
  2. src/runtime/proc.go

    		if atomic.CasRel(&pp.runqhead, h, h+1) { // cas-release, commits consume
    			return gp, false
    		}
    	}
    }
    
    // runqdrain drains the local runnable queue of pp and returns all goroutines in it.
    // Executed only by the owner P.
    func runqdrain(pp *p) (drainQ gQueue, n uint32) {
    	oldNext := pp.runnext
    	if oldNext != 0 && pp.runnext.cas(oldNext, 0) {
    		drainQ.pushBack(oldNext.ptr())
    		n++
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 207.5K bytes
    - Viewed (0)
Back to top