add mutexes for concurrent access to result-map and cache