Use as.Client in go lang from several goroutines

Hi, should I lock/unlock aerospike client before put/get bins if I use one connection from my app to Aerospike server and working with it from several goroutines? Or I can use it without mutex etc.

No locking is required. If you take a look at how they invoke and implement runBench() you can see that you can use the same client object without any concurrency control from many go-routines. It will manage everything internally (locking, connection pooling, etc), you don’t have to worry about that.

See aerospike-client-go/tools/benchmark/benchmark.go at Github aerospike-client-go/benchmark.go at fae9606198eaaa55f37b0468c24684e941e4b817 · aerospike/aerospike-client-go · GitHub

1 Like