synchronizing access to cache