Skip to content

Commit

Permalink
Make Executor::getStringDictionary thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
asuhan committed Mar 17, 2015
1 parent 713fda5 commit 93f26ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions QueryEngine/Execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ StringDictionary* Executor::getStringDictionary(const int dict_id) const {
const auto dd = catalog_->getMetadataForDict(dict_id);
CHECK(dd);
CHECK_EQ(32, dd->dictNBits);
std::lock_guard<std::mutex> lock(str_dicts_mutex_);
const auto dict_it = str_dicts_.find(dict_id);
if (dict_it != str_dicts_.end()) {
return dict_it->second.get();
Expand Down
1 change: 1 addition & 0 deletions QueryEngine/Execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ class Executor {
std::mutex gpu_exec_mutex_[max_gpu_count];

mutable std::unordered_map<int, std::unique_ptr<StringDictionary>> str_dicts_;
mutable std::mutex str_dicts_mutex_;

std::map<CodeCacheKey, CodeCacheVal> cpu_code_cache_;
std::map<CodeCacheKey, CodeCacheVal> gpu_code_cache_;
Expand Down

0 comments on commit 93f26ba

Please sign in to comment.