Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 441 for goroutines (0.18 sec)

  1. test/chan/goroutines.go

    // run
    
    // 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.
    
    // Torture test for goroutines.
    // Make a lot of goroutines, threaded together, and tear them down cleanly.
    
    package main
    
    import (
    	"os"
    	"strconv"
    )
    
    func f(left, right chan int) {
    	left <- <-right
    }
    
    func main() {
    	var n = 10000
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 06:44:02 UTC 2012
    - 743 bytes
    - Viewed (0)
  2. src/runtime/testdata/testprog/traceback_ancestors.go

    		if !main {
    			ignoreGoroutines[goroutineID()] = true
    		}
    
    		// Start the next goroutine now that there are no more recursions left
    		// for this current goroutine.
    		go recurseThenCallGo(w, frames-1, numFrames, false)
    		return
    	}
    	recurseThenCallGo(w, frames, goroutines-1, main)
    }
    
    func goroutineID() string {
    	buf := make([]byte, 128)
    	runtime.Stack(buf, false)
    	prefix := []byte("goroutine ")
    	var found bool
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 17:14:59 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  3. src/cmd/trace/jsontrace.go

    	mode      traceviewer.Mode
    	startTime time.Duration
    	endTime   time.Duration
    
    	// Used if mode != 0.
    	focusGoroutine trace.GoID
    	goroutines     map[trace.GoID]struct{} // Goroutines to be displayed for goroutine-oriented or task-oriented view. goroutines[0] is the main goroutine.
    	tasks          []*trace.UserTaskSummary
    }
    
    // setTask sets a task to focus on.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  4. tests/util/leak/check.go

    	if err != nil {
    		t.Errorf("failed to fetch pre-test goroutines: %v", err)
    		return
    	}
    	existing := map[uint64]struct{}{}
    	for _, g := range existingRaw {
    		existing[g.id] = struct{}{}
    	}
    	filter := func(in []*goroutine) []*goroutine {
    		res := make([]*goroutine, 0, len(in))
    		for _, i := range in {
    			if _, f := existing[i.id]; !f {
    				// This was not in the goroutines list when the test started
    				res = append(res, i)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Dec 20 10:22:38 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/sync/errgroup/errgroup.go

    		}
    	}()
    	return true
    }
    
    // SetLimit limits the number of active goroutines in this group to at most n.
    // A negative value indicates no limit.
    //
    // Any subsequent call to the Go method will block until it can add an active
    // goroutine without exceeding the configured limit.
    //
    // The limit must not be modified while any goroutines in the group are active.
    func (g *Group) SetLimit(n int) {
    	if n < 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:57:25 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  6. src/math/rand/default_test.go

    		// Call Seed and Uint64 concurrently.
    		wg.Add(goroutines)
    		for i := 0; i < goroutines; i++ {
    			go func(s int64) {
    				defer wg.Done()
    				Seed(s)
    			}(int64(i) + 100)
    		}
    		wg.Add(goroutines)
    		for i := 0; i < goroutines; i++ {
    			go func() {
    				defer wg.Done()
    				ch <- Uint64()
    			}()
    		}
    	case 1:
    		// Call Uint64 concurrently with no Seed.
    		wg.Add(goroutines)
    		for i := 0; i < goroutines; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 07 23:39:35 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. src/internal/trace/testdata/testprog/stress.go

    // Tests a many interesting cases (network, syscalls, a little GC, busy goroutines,
    // blocked goroutines, LockOSThread, pipes, and GOMAXPROCS).
    
    //go:build ignore
    
    package main
    
    import (
    	"log"
    	"net"
    	"os"
    	"runtime"
    	"runtime/trace"
    	"sync"
    	"time"
    )
    
    func main() {
    	var wg sync.WaitGroup
    	done := make(chan bool)
    
    	// Create a goroutine blocked before tracing.
    	wg.Add(1)
    	go func() {
    		<-done
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/counter/interface.go

    type GoRoutineCounter interface {
    	// Add adds the given delta to the count of active goroutines.
    	// Call Add(1) before forking a goroutine, Add(-1) at the end of that goroutine.
    	// Call Add(-1) just before waiting on something from another goroutine (e.g.,
    	// just before a `select`).
    	// Call Add(1) just before doing something that unblocks a goroutine that is
    	// waiting on that something.
    	Add(delta int)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Nov 12 16:12:48 UTC 2019
    - 1.4K bytes
    - Viewed (0)
  9. src/sync/mutex.go

    	}
    }
    
    // Unlock unlocks m.
    // It is a run-time error if m is not locked on entry to Unlock.
    //
    // A locked [Mutex] is not associated with a particular goroutine.
    // It is allowed for one goroutine to lock a Mutex and then
    // arrange for another goroutine to unlock it.
    func (m *Mutex) Unlock() {
    	if race.Enabled {
    		_ = m.state
    		race.Release(unsafe.Pointer(m))
    	}
    
    	// Fast path: drop lock bit.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  10. src/runtime/trace/trace.go

    // additional information such as the category of the message and
    // which goroutine called [Log]. The execution tracer provides UIs to filter
    // and group goroutines using the log category and the message supplied
    // in [Log].
    //
    // A region is for logging a time interval during a goroutine's execution.
    // By definition, a region starts and ends in the same goroutine.
    // Regions can be nested to represent subintervals.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 20 00:47:09 UTC 2023
    - 5.1K bytes
    - Viewed (0)
Back to top