Thread safe memstore.