runshenzhu / palmtree Goto Github PK
View Code? Open in Web Editor NEWAn implementation of Intel's concurrent B+Tree (Palm Tree)
An implementation of Intel's concurrent B+Tree (Palm Tree)
void redistribute_inner_tasks(int layer, NodeModsMapType &cur_mods) {
cur_mods = node_mods_[layer];
// discard
for (int i = 0; i < worker_id_; i++) {
auto &wthread = palmtree_->workers_[i];
for (auto other_itr = wthread.node_mods_[layer].begin();
other_itr != wthread.node_mods_[layer].end(); other_itr++) {
cur_mods.erase(other_itr->first);
}
}
// Steal work from other threads
for (int i = worker_id_ + 1; i < palmtree_->NUM_WORKER; i++) {
auto &wthread = palmtree_->workers_[i];
for (auto other_itr = wthread.node_mods_[layer].begin();
other_itr != wthread.node_mods_[layer].end(); other_itr++) {
auto itr = cur_mods.find(other_itr->first);
if (itr != cur_mods.end()) {
auto &my_mods = itr->second;
auto &other_mods = other_itr->second;
my_mods.insert(my_mods.end(), other_mods.begin(), other_mods.end());
}
}
}
}
While some thread is traversing a thread's node_mods_[layer], the thread may erase some elements of it. I think there exist data races.
I have read the code and haven't found any method to scan the tree. Does the palm tree support scan operation now?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.