-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Is there any reason using just Mutex instead of RWMutex?
Query speed will be super faster with RWMutex (read lock on query and write lock on other parts),
tendermint/abci/client/local_client.go
Line 18 in 9b6d6a3
| mtx *tmsync.Mutex |
If we can ensure these queries are not doing write operation, we can change them to use read lock and can support concurrent queries.
-
tendermint/abci/client/local_client.go
Lines 246 to 251 in 9b6d6a3
func (app *localClient) QuerySync( ctx context.Context, req types.RequestQuery, ) (*types.ResponseQuery, error) { app.mtx.Lock() defer app.mtx.Unlock() -
tendermint/abci/client/local_client.go
Lines 100 to 102 in 9b6d6a3
func (app *localClient) QueryAsync(ctx context.Context, req types.RequestQuery) (*ReqRes, error) { app.mtx.Lock() defer app.mtx.Unlock()
Reactions are currently unavailable