Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 348 for Gomaxprocs (2.42 sec)

  1. 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)
  2. test/fixedbugs/issue19182.go

    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"fmt"
    	"runtime"
    	"sync/atomic"
    	"time"
    )
    
    var a uint64 = 0
    
    func main() {
    	runtime.GOMAXPROCS(2) // With just 1, infinite loop never yields
    
    	go func() {
    		for {
    			atomic.AddUint64(&a, uint64(1))
    		}
    	}()
    
    	time.Sleep(10 * time.Millisecond) // Short sleep is enough in passing case
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 737 bytes
    - Viewed (0)
  3. test/fixedbugs/issue9321.go

    		for i := 0; i < 10; i++ {
    			buf := &bytes.Buffer{}
    			pprof.Lookup("goroutine").WriteTo(buf, 2)
    		}
    		wg.Done()
    	}
    
    	go test()
    	go test()
    	wg.Wait()
    }
    
    func main() {
    	runtime.GOMAXPROCS(4)
    	for i := 0; i < 10; i++ {
    		test()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 538 bytes
    - Viewed (0)
  4. src/sync/mutex_test.go

    	*s = 1
    	HammerSemaphore(s, b.N, make(chan bool, 2))
    }
    
    func BenchmarkContendedSemaphore(b *testing.B) {
    	b.StopTimer()
    	s := new(uint32)
    	*s = 1
    	c := make(chan bool)
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2))
    	b.StartTimer()
    
    	go HammerSemaphore(s, b.N/2, c)
    	go HammerSemaphore(s, b.N/2, c)
    	<-c
    	<-c
    }
    
    func HammerMutex(m *Mutex, loops int, cdone chan bool) {
    	for i := 0; i < loops; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 16 21:25:35 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  5. cmd/untar.go

    	"github.com/klauspost/compress/s2"
    	"github.com/klauspost/compress/zstd"
    	gzip "github.com/klauspost/pgzip"
    	"github.com/pierrec/lz4"
    )
    
    // Max bzip2 concurrency across calls. 50% of GOMAXPROCS.
    var bz2Limiter = pbzip2.CreateConcurrencyPool((runtime.GOMAXPROCS(0) + 1) / 2)
    
    func detect(r *bufio.Reader) format {
    	z, err := r.Peek(4)
    	if err != nil {
    		return formatUnknown
    	}
    	for _, f := range magicHeaders {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 6K 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/cmd/cgo/internal/testcarchive/testdata/libgo8/a.go

    package main
    
    import "C"
    
    import (
    	"os"
    	"runtime"
    	"sync/atomic"
    )
    
    var started int32
    
    // Start a goroutine that loops forever.
    func init() {
    	runtime.GOMAXPROCS(1)
    	go func() {
    		for {
    			atomic.StoreInt32(&started, 1)
    		}
    	}()
    }
    
    //export GoFunction8
    func GoFunction8() {
    	for atomic.LoadInt32(&started) == 0 {
    		runtime.Gosched()
    	}
    	os.Exit(0)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 529 bytes
    - Viewed (0)
  8. src/internal/trace/parser.go

    	EvStack             = 3  // stack [stack id, number of PCs, array of {PC, func string ID, file string ID, line}]
    	EvGomaxprocs        = 4  // current value of GOMAXPROCS [timestamp, GOMAXPROCS, stack id]
    	EvProcStart         = 5  // start of P [timestamp, thread id]
    	EvProcStop          = 6  // stop of P [timestamp]
    	EvGCStart           = 7  // GC start [timestamp, seq, stack id]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:31:04 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  9. cmd/admin-server-info.go

    			Alloc:      memstats.Alloc,
    			TotalAlloc: memstats.TotalAlloc,
    			Mallocs:    memstats.Mallocs,
    			Frees:      memstats.Frees,
    			HeapAlloc:  memstats.HeapAlloc,
    		},
    		GoMaxProcs:     runtime.GOMAXPROCS(0),
    		NumCPU:         runtime.NumCPU(),
    		RuntimeVersion: runtime.Version(),
    		GCStats: &madmin.GCStats{
    			LastGC:     gcStats.LastGC,
    			NumGC:      gcStats.NumGC,
    			PauseTotal: gcStats.PauseTotal,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modcmd/verify.go

    		base.Fatalf("go: verify takes no arguments")
    	}
    	modload.ForceUseModules = true
    	modload.RootMode = modload.NeedRoot
    
    	// Only verify up to GOMAXPROCS zips at once.
    	type token struct{}
    	sem := make(chan token, runtime.GOMAXPROCS(0))
    
    	mg, err := modload.LoadModGraph(ctx, "")
    	if err != nil {
    		base.Fatal(err)
    	}
    	mods := mg.BuildList()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 16:56:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
Back to top