Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 85 for gomaxprocs (0.41 sec)

  1. src/runtime/proc_test.go

    		t.Skip("skipping during short test")
    	}
    	maxprocs := runtime.GOMAXPROCS(3)
    	compl := make(chan bool, 2)
    	go func() {
    		for i := 0; i != 1000; i += 1 {
    			runtime.GC()
    		}
    		compl <- true
    	}()
    	go func() {
    		for i := 0; i != 1000; i += 1 {
    			runtime.GOMAXPROCS(3)
    		}
    		compl <- true
    	}()
    	go perpetuumMobile()
    	<-compl
    	<-compl
    	stop <- true
    	runtime.GOMAXPROCS(maxprocs)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 25.8K bytes
    - Viewed (0)
  2. src/runtime/testdata/testprog/gc.go

    	// face of varying environments.
    	debug.SetGCPercent(100)
    
    	// Set GOMAXPROCS to 1 to minimize the amount of memory held in the page cache,
    	// and to reduce the chance that the background scavenger gets scheduled.
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
    
    	// Allocate allocTotal bytes of memory in allocChunk byte chunks.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 12.1K bytes
    - Viewed (0)
  3. src/time/sleep_test.go

    	// the indicated delay.
    	//
    	// Even if GOMAXPROCS=1, we expect the runtime to eventually schedule
    	// the AfterFunc goroutine instead of the runnable channel goroutine.
    	// However, in https://go.dev/issue/65178 this was observed to live-lock
    	// on wasip1/wasm and js/wasm after <10000 runs.
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
    
    	var (
    		wg   sync.WaitGroup
    		stop atomic.Bool
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:33:57 UTC 2024
    - 22.5K bytes
    - Viewed (0)
  4. src/runtime/gc_test.go

    func applyGCLoad(b *testing.B) func() {
    	// We’ll apply load to the runtime with maxProcs-1 goroutines
    	// and use one more to actually benchmark. It doesn't make sense
    	// to try to run this test with only 1 P (that's what
    	// BenchmarkReadMemStats is for).
    	maxProcs := runtime.GOMAXPROCS(-1)
    	if maxProcs == 1 {
    		b.Skip("This benchmark can only be run with GOMAXPROCS > 1")
    	}
    
    	// Code to build a big tree with lots of pointers.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  5. src/runtime/metrics_test.go

    			fn: func(t *testing.T) {
    				runtime.GC()
    			},
    		},
    		{
    			name: "runtime.GOMAXPROCS",
    			fn: func(t *testing.T) {
    				if runtime.GOARCH == "wasm" {
    					t.Skip("GOMAXPROCS >1 not supported on wasm")
    				}
    
    				n := runtime.GOMAXPROCS(0)
    				defer runtime.GOMAXPROCS(n)
    
    				runtime.GOMAXPROCS(n + 1)
    			},
    		},
    		{
    			name: "runtime.GoroutineProfile",
    			fn: func(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 45K bytes
    - Viewed (0)
  6. src/runtime/chan_test.go

    package runtime_test
    
    import (
    	"internal/testenv"
    	"math"
    	"runtime"
    	"sync"
    	"sync/atomic"
    	"testing"
    	"time"
    )
    
    func TestChan(t *testing.T) {
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
    	N := 200
    	if testing.Short() {
    		N = 20
    	}
    	for chanCap := 0; chanCap < N; chanCap++ {
    		{
    			// Ensure that receive from empty chan blocks.
    			c := make(chan int, chanCap)
    			recv1 := false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 20:47:35 UTC 2023
    - 23.4K bytes
    - Viewed (0)
  7. src/testing/benchmark.go

    		return true
    	}
    	// Collect matching benchmarks and determine longest name.
    	maxprocs := 1
    	for _, procs := range cpuList {
    		if procs > maxprocs {
    			maxprocs = procs
    		}
    	}
    	ctx := &benchContext{
    		match:  newMatcher(matchString, *matchBenchmarks, "-test.bench", *skip),
    		extLen: len(benchmarkName("", maxprocs)),
    	}
    	var bs []InternalBenchmark
    	for _, Benchmark := range benchmarks {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  8. internal/grid/benchmark_test.go

    	errFatal(err)
    
    	// Wait for all to connect
    	// Parallel writes per server.
    	b.Run("bytes", func(b *testing.B) {
    		for par := 1; par <= 32; par *= 2 {
    			b.Run("par="+strconv.Itoa(par*runtime.GOMAXPROCS(0)), func(b *testing.B) {
    				defer timeout(60 * time.Second)()
    				ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
    				defer cancel()
    				b.ReportAllocs()
    				b.SetBytes(int64(len(payload) * 2))
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  9. src/os/timeout_test.go

    	// Cannot use t.Parallel - modifies global GOMAXPROCS.
    	if testing.Short() {
    		t.Skip("skipping in short mode")
    	}
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
    	testVariousDeadlines(t)
    }
    
    // There is a very similar copy of this in net/timeout_test.go.
    func TestVariousDeadlines4Proc(t *testing.T) {
    	// Cannot use t.Parallel - modifies global GOMAXPROCS.
    	if testing.Short() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 17.1K bytes
    - Viewed (0)
  10. src/internal/trace/gc.go

    				break
    			}
    			gomaxprocs := int(m.Value.Uint64())
    			if len(ps) > gomaxprocs {
    				if flags&UtilPerProc != 0 {
    					// End each P's series.
    					for _, p := range ps[gomaxprocs:] {
    						out[p.series] = addUtil(out[p.series], MutatorUtil{int64(ev.Time()), 0})
    					}
    				}
    				ps = ps[:gomaxprocs]
    			}
    			for len(ps) < gomaxprocs {
    				// Start new P's series.
    				series := 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 26K bytes
    - Viewed (0)
Back to top