Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 1,357 for atomics (0.53 sec)

  1. src/runtime/race/testdata/atomic_test.go

    	go func() {
    		x1 = 1
    		if atomic.AddInt32(&s, 1) == 2 {
    			x2 = 1
    		}
    		ch <- true
    	}()
    	go func() {
    		x2 = 1
    		if atomic.AddInt32(&s, 1) == 2 {
    			x1 = 1
    		}
    		ch <- true
    	}()
    	<-ch
    	<-ch
    }
    
    func TestNoRaceAtomicLoadAddInt32(t *testing.T) {
    	var x int64
    	_ = x
    	var s int32
    	go func() {
    		x = 2
    		atomic.AddInt32(&s, 1)
    	}()
    	for atomic.LoadInt32(&s) != 1 {
    		runtime.Gosched()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 16 17:26:46 UTC 2020
    - 4.9K bytes
    - Viewed (0)
  2. test/fixedbugs/issue24449.go

    	}
    	if len(a) <= len(b) {
    		atomic.AddInt32(&cnt32, 16)
    	}
    	return atomic.LoadInt32(&cnt32) == 31
    }
    
    var cnt64 int64
    
    //go:noinline
    func test64(a, b []int) bool {
    	// Try to generate flag value, issue atomic
    	// adds and then re-use the flag value to see if
    	// the atomic add has clobbered them.
    	atomic.AddInt64(&cnt64, 1)
    	if len(a) == len(b) {
    		atomic.AddInt64(&cnt64, 2)
    	}
    	atomic.AddInt64(&cnt64, 4)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 20 09:44:50 UTC 2018
    - 1.2K bytes
    - Viewed (0)
  3. cmd/bucket-replication-metrics.go

    func (p *ProxyMetric) add(p2 ProxyMetric) {
    	atomic.AddUint64(&p.GetTotal, p2.GetTotal)
    	atomic.AddUint64(&p.HeadTotal, p2.HeadTotal)
    	atomic.AddUint64(&p.GetTagTotal, p2.GetTagTotal)
    	atomic.AddUint64(&p.PutTagTotal, p2.PutTagTotal)
    	atomic.AddUint64(&p.RmvTagTotal, p2.RmvTagTotal)
    	atomic.AddUint64(&p.GetFailedTotal, p2.GetFailedTotal)
    	atomic.AddUint64(&p.HeadFailedTotal, p2.HeadFailedTotal)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Feb 06 06:00:45 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  4. api/go1.19.txt

    pkg sync/atomic, method (*Uintptr) Load() uintptr #50860
    pkg sync/atomic, method (*Uintptr) Store(uintptr) #50860
    pkg sync/atomic, method (*Uintptr) Swap(uintptr) uintptr #50860
    pkg sync/atomic, type Bool struct #50860
    pkg sync/atomic, type Int32 struct #50860
    pkg sync/atomic, type Int64 struct #50860
    pkg sync/atomic, type Pointer[$0 interface{}] struct #50860
    pkg sync/atomic, type Uint32 struct #50860
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 02 16:29:41 UTC 2022
    - 17.9K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/atomic/doc.go

    // Package atomic defines an Analyzer that checks for common mistakes
    // using the sync/atomic package.
    //
    // # Analyzer atomic
    //
    // atomic: check for common mistakes using the sync/atomic package
    //
    // The atomic checker looks for assignment statements of the form:
    //
    //	x = atomic.AddUint64(&x, 1)
    //
    // which are not atomic.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 505 bytes
    - Viewed (0)
  6. src/internal/runtime/atomic/bench_test.go

    	x = 1
    	ptr := &x
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			atomic.Cas(ptr, 1, 0)
    			atomic.Cas(ptr, 0, 1)
    		}
    	})
    }
    
    func BenchmarkCas64(b *testing.B) {
    	var x uint64
    	x = 1
    	ptr := &x
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			atomic.Cas64(ptr, 1, 0)
    			atomic.Cas64(ptr, 0, 1)
    		}
    	})
    }
    func BenchmarkXchg(b *testing.B) {
    	var x uint32
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  7. src/runtime/race/race_linux_test.go

    	a := (*uint64)(unsafe.Pointer(&mem[0]))
    	if *a != 0 {
    		t.Fatalf("bad atomic value: %v, want 0", *a)
    	}
    	atomic.AddUint64(a, 1)
    	if *a != 1 {
    		t.Fatalf("bad atomic value: %v, want 1", *a)
    	}
    	atomic.AddUint64(a, 1)
    	if *a != 2 {
    		t.Fatalf("bad atomic value: %v, want 2", *a)
    	}
    }
    
    func TestAtomicPageBoundary(t *testing.T) {
    	// Test that atomic access near (but not cross) a page boundary
    	// doesn't fault. See issue 60825.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 16 14:09:02 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  8. internal/rest/rpc-stats.go

    // GetRPCStats returns RPC stats, include calls errors and dhcp/tcp metrics
    func GetRPCStats() RPCStats {
    	s := RPCStats{
    		Errs:     atomic.LoadUint64(&globalStats.errs),
    		DialErrs: atomic.LoadUint64(&globalStats.tcpDialErrs),
    	}
    	if v := atomic.LoadUint64(&globalStats.tcpDialCount); v > 0 {
    		s.DialAvgDuration = atomic.LoadUint64(&globalStats.tcpDialTotalDur) / v
    	}
    	return s
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Sep 29 16:27:58 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  9. src/runtime/lock_futex.go

    }
    
    func mutexContended(l *mutex) bool {
    	return atomic.Load(key32(&l.key)) > mutex_locked
    }
    
    func lock(l *mutex) {
    	lockWithRank(l, getLockRank(l))
    }
    
    func lock2(l *mutex) {
    	gp := getg()
    
    	if gp.m.locks < 0 {
    		throw("runtime·lock: lock count")
    	}
    	gp.m.locks++
    
    	// Speculative grab for lock.
    	v := atomic.Xchg(key32(&l.key), mutex_locked)
    	if v == mutex_unlocked {
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:34 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  10. test/fixedbugs/issue19182.go

    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
    	i, val := 0, atomic.LoadUint64(&a)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 737 bytes
    - Viewed (0)
Back to top