Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. test/chanlinear.go

    		// If five in a row all fail, give up.
    		if fails++; fails >= 5 {
    			panic(fmt.Sprintf("%s: too slow: %d channels: %v; %d channels: %v\n",
    				typ, n, t1, 2*n, t2))
    		}
    	}
    }
    
    func main() {
    	checkLinear("chanSelect", 1000, func(n int) {
    		const messages = 10
    		c := make(chan bool) // global channel
    		var a []chan bool    // local channels for each goroutine
    		for i := 0; i < n; i++ {
    			d := make(chan bool)
    			a = append(a, d)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  2. src/reflect/all_test.go

    				Send: val,
    			})
    			info = append(info, caseInfo{desc: "ready send", canSelect: true})
    		}
    
    		// Ready recv.
    		if x.Maybe() {
    			ch, val := newop(len(cases), 1)
    			ch.Send(val)
    			cases = append(cases, SelectCase{
    				Dir:  SelectRecv,
    				Chan: ch,
    			})
    			info = append(info, caseInfo{desc: "ready recv", canSelect: true, recv: val})
    		}
    
    		// Blocking send.
    		if x.Maybe() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top