Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for LoadOrStore (0.23 sec)

  1. src/sync/map_bench_test.go

    			for ; pb.Next(); i++ {
    				m.LoadOrStore(i, i)
    			}
    		},
    	})
    }
    
    func BenchmarkLoadOrStoreCollision(b *testing.B) {
    	benchMap(b, bench{
    		setup: func(_ *testing.B, m mapInterface) {
    			m.LoadOrStore(0, 0)
    		},
    
    		perG: func(b *testing.B, pb *testing.PB, i int, m mapInterface) {
    			for ; pb.Next(); i++ {
    				m.LoadOrStore(0, 0)
    			}
    		},
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  2. src/sync/map.go

    // read and write operations are defined as follows.
    // [Map.Load], [Map.LoadAndDelete], [Map.LoadOrStore], [Map.Swap], [Map.CompareAndSwap],
    // and [Map.CompareAndDelete] are read operations;
    // [Map.Delete], [Map.LoadAndDelete], [Map.Store], and [Map.Swap] are write operations;
    // [Map.LoadOrStore] is a write operation when it returns loaded set to false;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  3. src/internal/concurrent/hashtriemap.go

    		i = n.indirect()
    	}
    	panic("internal/concurrent.HashMapTrie: ran out of hash bits while iterating")
    }
    
    // LoadOrStore returns the existing value for the key if present.
    // Otherwise, it stores and returns the given value.
    // The loaded result is true if the value was loaded, false if stored.
    func (ht *HashTrieMap[K, V]) LoadOrStore(key K, value V) (result V, loaded bool) {
    	hash := ht.keyHash(abi.NoEscape(unsafe.Pointer(&key)), ht.seed)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 16:01:55 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  4. src/net/net_fake.go

    		ffd.incomingEmpty <- true
    	case syscall.SOCK_DGRAM:
    		ffd.queue = newPacketQueue(defaultBuffer)
    	default:
    		return wrapErr(syscall.EINVAL)
    	}
    
    	fd.fakeNetFD = ffd
    	if _, dup := sockets.LoadOrStore(ffd.fakeAddr, fd); dup {
    		fd.fakeNetFD = nil
    		return wrapErr(syscall.EADDRINUSE)
    	}
    
    	return nil
    }
    
    func fakeConnect(ctx context.Context, fd *netFD, laddr, raddr sockaddr) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 19:24:21 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  5. pkg/controller/volume/persistentvolume/metrics/metrics.go

    // and stores the operation timestamp with the key
    func (c *OperationStartTimeCache) AddIfNotExist(key, pluginName, operationName string) {
    	ts := newOperationTimestamp(pluginName, operationName)
    	c.cache.LoadOrStore(key, ts)
    }
    
    // Delete deletes a value for a key.
    func (c *OperationStartTimeCache) Delete(key string) {
    	c.cache.Delete(key)
    }
    
    // Has returns a bool value indicates the existence of a key in the cache
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 25 13:09:16 UTC 2022
    - 10.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/util/peerproxy/peerproxy_handler_test.go

    		ppI.addToStorageVersionMap(svdata.gvr, svdata.serverId)
    	}
    	return ppI, nil
    }
    
    func (h *peerProxyHandler) addToStorageVersionMap(gvr schema.GroupVersionResource, serverId string) {
    	apiserversi, _ := h.svMap.LoadOrStore(gvr, &sync.Map{})
    	apiservers := apiserversi.(*sync.Map)
    	if serverId != "" {
    		apiservers.Store(serverId, true)
    	}
    }
    
    func testDataExists(gvr schema.GroupVersionResource) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  7. src/encoding/gob/type.go

    	// Store the name and type provided by the user....
    	if t, dup := nameToConcreteType.LoadOrStore(name, reflect.TypeOf(value)); dup && t != ut.user {
    		panic(fmt.Sprintf("gob: registering duplicate types for %q: %s != %s", name, t, ut.user))
    	}
    
    	// but the flattened type in the type table, since that's what decode needs.
    	if n, dup := concreteTypeToName.LoadOrStore(ut.base, name); dup && n != name {
    		nameToConcreteType.Delete(name)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  8. schema/schema.go

    			}
    		}
    	}
    
    	// Cache the schema
    	if v, loaded := cacheStore.LoadOrStore(schemaCacheKey, schema); loaded {
    		s := v.(*Schema)
    		// Wait for the initialization of other goroutines to complete
    		<-s.initialized
    		return s, s.err
    	}
    
    	defer func() {
    		if schema.err != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/util/peerproxy/peerproxy_handler.go

    			versionSplit := strings.Split(version, "/")
    			if len(versionSplit) == 2 {
    				version = versionSplit[1]
    			}
    			gvr.Version = version
    			apiserversi, _ := h.svMap.LoadOrStore(gvr, &sync.Map{})
    			apiservers := apiserversi.(*sync.Map)
    			apiservers.Store(gr.APIServerID, true)
    		}
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 19 00:36:22 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modget/query.go

    // multiple concurrent calls will result in the sets being added in
    // nondeterministic order.
    func (q *query) pathOnce(path string, f func() pathSet) {
    	if _, dup := q.pathSeen.LoadOrStore(path, nil); dup {
    		return
    	}
    
    	cs := f()
    
    	if len(cs.pkgMods) > 0 || cs.mod != (module.Version{}) || cs.err != nil {
    		cs.path = path
    		q.candidatesMu.Lock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 15:48:25 UTC 2023
    - 11.2K bytes
    - Viewed (0)
Back to top