Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 441 for goroutines (0.23 sec)

  1. src/runtime/testdata/testprog/crashdump.go

    	chans := make([]chan bool, count)
    	for i := range chans {
    		chans[i] = make(chan bool)
    		go crashDumpsAllThreadsLoop(i, chans[i])
    	}
    
    	// Wait for all the goroutines to start executing.
    	for _, c := range chans {
    		<-c
    	}
    
    	// Tell our parent that all the goroutines are executing.
    	if _, err := os.NewFile(3, "pipe").WriteString("x"); err != nil {
    		fmt.Fprintf(os.Stderr, "write to pipe failed: %v\n", err)
    		os.Exit(2)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 22 00:34:25 UTC 2021
    - 917 bytes
    - Viewed (0)
  2. src/context/example_test.go

    			defer cond.L.Unlock()
    
    			// If multiple goroutines are waiting on cond simultaneously,
    			// we need to make sure we wake up exactly this one.
    			// That means that we need to Broadcast to all of the goroutines,
    			// which will wake them all up.
    			//
    			// If there are N concurrent calls to waitOnCond, each of the goroutines
    			// will spuriously wake up O(N) other goroutines that aren't ready yet,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 21 20:24:28 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/teststdio/testdata/fib.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build test_run
    
    // Compute Fibonacci numbers with two goroutines
    // that pass integers back and forth.  No actual
    // concurrency, just threads and synchronization
    // and foreign code on multiple pthreads.
    
    package main
    
    import (
    	"runtime"
    	"strconv"
    
    	"cgostdio/stdio"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 965 bytes
    - Viewed (0)
  4. src/syscall/forkpipe2.go

    	return Pipe2(p, O_CLOEXEC)
    }
    
    var (
    	// Guard the forking variable.
    	forkingLock sync.Mutex
    	// Number of goroutines currently forking, and thus the
    	// number of goroutines holding a conceptual write lock
    	// on ForkLock.
    	forking int
    )
    
    // hasWaitingReaders reports whether any goroutine is waiting
    // to acquire a read lock on rw. It is defined in the sync package.
    func hasWaitingReaders(rw *sync.RWMutex) bool
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 10 19:19:59 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/storage/cacher/ready_test.go

    package cacher
    
    import (
    	"context"
    	"sync"
    	"testing"
    	"time"
    )
    
    func Test_newReady(t *testing.T) {
    	errCh := make(chan error, 10)
    	ready := newReady()
    	ready.set(false)
    	// create 10 goroutines waiting for ready
    	for i := 0; i < 10; i++ {
    		go func() {
    			errCh <- ready.wait(context.Background())
    		}()
    	}
    	select {
    	case <-time.After(1 * time.Second):
    	case <-errCh:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 16 13:32:11 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  6. src/cmd/trace/goroutinegen.go

    	gs.augmentName(st.Stack)
    
    	// Handle the goroutine state transition.
    	from, to := st.Goroutine()
    	if from == to {
    		// Filter out no-op events.
    		return
    	}
    	if from.Executing() && !to.Executing() {
    		if to == trace.GoWaiting {
    			// Goroutine started blocking.
    			gs.block(ev.Time(), ev.Stack(), st.Reason, ctx)
    		} else {
    			gs.stop(ev.Time(), ev.Stack(), ctx)
    		}
    	}
    	if !from.Executing() && to.Executing() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  7. src/sync/cond.go

    	runtime_notifyListWait(&c.notify, t)
    	c.L.Lock()
    }
    
    // Signal wakes one goroutine waiting on c, if there is any.
    //
    // It is allowed but not required for the caller to hold c.L
    // during the call.
    //
    // Signal() does not affect goroutine scheduling priority; if other goroutines
    // are attempting to lock c.L, they may be awoken before a "waiting" goroutine.
    func (c *Cond) Signal() {
    	c.checker.check()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  8. src/context/context_test.go

    	return c
    }
    func XTestCustomContextGoroutines(t testingT) {
    	g := goroutines.Load()
    	checkNoGoroutine := func() {
    		t.Helper()
    		now := goroutines.Load()
    		if now != g {
    			t.Fatalf("%d goroutines created", now-g)
    		}
    	}
    	checkCreatedGoroutine := func() {
    		t.Helper()
    		now := goroutines.Load()
    		if now != g+1 {
    			t.Fatalf("%d goroutines created, want 1", now-g)
    		}
    		g = now
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 19 19:13:01 UTC 2023
    - 7.7K bytes
    - Viewed (0)
  9. src/internal/runtime/atomic/atomic_test.go

    		}
    	}
    
    	// Set every bit in array to 1.
    	a := make([]uint8, 1<<12)
    	for i := range a {
    		a[i] = 0xff
    	}
    
    	// Clear array bit-by-bit in different goroutines.
    	done := make(chan bool)
    	for i := 0; i < 8; i++ {
    		m := ^uint8(1 << i)
    		go func() {
    			for i := range a {
    				atomic.And8(&a[i], m)
    			}
    			done <- true
    		}()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  10. src/cmd/go/testdata/script/test_finished_subtest_goroutines.txt

    # Regression test for https://golang.org/issue/45127:
    # Goroutines for completed parallel subtests should exit immediately,
    # not block until earlier subtests have finished.
    
    [short] skip
    
    ! go test .
    stdout 'panic: slow failure'
    ! stdout '\[chan send'
    
    -- go.mod --
    module golang.org/issue45127
    
    go 1.16
    -- issue45127_test.go --
    package main
    
    import (
    	"fmt"
    	"runtime"
    	"runtime/debug"
    	"sync"
    	"testing"
    )
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 19 17:34:25 UTC 2021
    - 1K bytes
    - Viewed (0)
Back to top