Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 156 for gomaxprocs (0.21 sec)

  1. src/internal/trace/testdata/testprog/gomaxprocs.go

    	// Start tracing.
    	if err := trace.Start(os.Stdout); err != nil {
    		log.Fatalf("failed to start tracing: %v", err)
    	}
    	// Run GOMAXPROCS a bunch of times, up and down.
    	for i := 1; i <= 16; i *= 2 {
    		runtime.GOMAXPROCS(i)
    		time.Sleep(1 * time.Millisecond)
    	}
    	for i := 16; i >= 1; i /= 2 {
    		runtime.GOMAXPROCS(i)
    		time.Sleep(1 * time.Millisecond)
    	}
    	// Stop tracing.
    	trace.Stop()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 967 bytes
    - Viewed (0)
  2. src/runtime/testdata/testprog/lockosthread.go

    	// checks that the runtime doesn't do anything terrible.
    
    	// This requires GOMAXPROCS=1 from the beginning to reliably
    	// start a goroutine on the main thread.
    	if runtime.GOMAXPROCS(-1) != 1 {
    		println("requires GOMAXPROCS=1")
    		os.Exit(1)
    	}
    
    	ready := make(chan bool, 1)
    	go func() {
    		// Because GOMAXPROCS=1, this *should* be on the main
    		// thread. Stay there.
    		runtime.LockOSThread()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 20:00:09 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  3. src/internal/trace/testdata/testprog/stress-start-stop.go

    // blocked goroutines, LockOSThread, pipes, and GOMAXPROCS).
    
    //go:build ignore
    
    package main
    
    import (
    	"bytes"
    	"io"
    	"log"
    	"net"
    	"os"
    	"runtime"
    	"runtime/trace"
    	"sync"
    	"time"
    )
    
    func main() {
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(8))
    	outerDone := make(chan bool)
    
    	go func() {
    		defer func() {
    			outerDone <- true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  4. src/internal/trace/testdata/testprog/stress.go

    // license that can be found in the LICENSE file.
    
    // 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)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  5. hack/make-rules/test-integration.sh

    KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY:-"-1"}
    if [[ ${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY} -gt 0 ]]; then
      GOMAXPROCS=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY}
      export GOMAXPROCS
      kube::log::status "Setting parallelism to ${GOMAXPROCS}"
    fi
    
    # Give integration tests longer to run by default.
    KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout=600s}
    LOG_LEVEL=${LOG_LEVEL:-2}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:06:57 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  6. src/internal/trace/testdata/testprog/stacks.go

    	if err != nil {
    		log.Fatalf("failed to dial: %v", err)
    	}
    	c.Close()
    	var data [1]byte
    	wp.Write(data[:])
    	<-pipeReadDone
    
    	oldGoMaxProcs := runtime.GOMAXPROCS(0)
    	runtime.GOMAXPROCS(oldGoMaxProcs + 1)
    
    	trace.Stop()
    
    	runtime.GOMAXPROCS(oldGoMaxProcs)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  7. src/internal/trace/testdata/testprog/futile-wakeup.go

    	"log"
    	"os"
    	"runtime"
    	"runtime/trace"
    	"sync"
    )
    
    func main() {
    	if err := trace.Start(os.Stdout); err != nil {
    		log.Fatalf("failed to start tracing: %v", err)
    	}
    
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(8))
    	c0 := make(chan int, 1)
    	c1 := make(chan int, 1)
    	c2 := make(chan int, 1)
    	const procs = 2
    	var done sync.WaitGroup
    	done.Add(4 * procs)
    	for p := 0; p < procs; p++ {
    		const iters = 1e3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  8. src/runtime/debug.go

    package runtime
    
    import (
    	"internal/runtime/atomic"
    	"unsafe"
    )
    
    // GOMAXPROCS sets the maximum number of CPUs that can be executing
    // simultaneously and returns the previous setting. It defaults to
    // the value of [runtime.NumCPU]. If n < 1, it does not change the current setting.
    // This call will go away when the scheduler improves.
    func GOMAXPROCS(n int) int {
    	if GOARCH == "wasm" && n > 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 11 20:38:24 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top