Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleValue_readMostly (0.2 sec)

  1. src/sync/atomic/example_test.go

    				_, _ = r, c
    			}
    		}()
    	}
    }
    
    // The following example shows how to maintain a scalable frequently read,
    // but infrequently updated data structure using copy-on-write idiom.
    func ExampleValue_readMostly() {
    	type Map map[string]string
    	var m atomic.Value
    	m.Store(make(Map))
    	var mu sync.Mutex // used only by writers
    	// read function can be used to read the data without further synchronization
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 18 23:58:54 UTC 2018
    - 2.2K bytes
    - Viewed (0)
Back to top