diff --git a/wellcoordination/benchmark/pnset-benchmark.cpp b/wellcoordination/benchmark/pnset-benchmark.cpp index 577c461..55cdade 100644 --- a/wellcoordination/benchmark/pnset-benchmark.cpp +++ b/wellcoordination/benchmark/pnset-benchmark.cpp @@ -77,7 +77,7 @@ int main(int argc, char* argv[]) { count < expected_nonconflicting_write_calls_per_node; count++) { std::string callStr; // registerStudent - std::string s_id = std::to_string(std::rand() % 1000000); + std::string s_id = std::to_string(std::rand() % 100000); if(std::rand() %2==0) callStr = "0 " + s_id; else diff --git a/wellcoordination/benchmark/pnset-crdt.hpp b/wellcoordination/benchmark/pnset-crdt.hpp index 4d25bbd..fa84706 100644 --- a/wellcoordination/benchmark/pnset-crdt.hpp +++ b/wellcoordination/benchmark/pnset-crdt.hpp @@ -25,10 +25,10 @@ class PNSet : public ReplicatedObject QUERY = 2 }; std::recursive_mutex m; - int pnsetsource[200001][2]={{0}}; - int pnsetremote[200001][2]={{0}}; - int arraysizesource=0; - int arraysizeremote=0; + int pnsetsource[200001]={0}; + int pnsetremote[200001]={0}; + //int arraysizesource=0; + //int arraysizeremote=0; int setsizesource=0; int setsizeremote=0; /// ------------------------------------------------------------- @@ -51,8 +51,8 @@ class PNSet : public ReplicatedObject //state std::memcpy(pnsetsource, obj.pnsetsource, sizeof(pnsetsource)); std::memcpy(pnsetremote, obj.pnsetremote, sizeof(pnsetremote)); - arraysizesource= obj.arraysizesource; - arraysizeremote= obj.arraysizeremote; + //arraysizesource= obj.arraysizesource; + //arraysizeremote= obj.arraysizeremote; setsizesource=obj.setsizesource; setsizeremote=obj.setsizeremote; ///------------------------------------------------------------------------ @@ -78,42 +78,17 @@ class PNSet : public ReplicatedObject } std::string addDownstream(std::string a, bool b) { - bool find= false; + //bool find= false; //std::scoped_lock lock(m); if (b==false){ - find=false; - for(int i=0; i lock; - int pnset[200001][2]={{0}}; - int arraysize=0; + int pnset[200001]={0}; + //int arraysize=0; //int arraysize=0; //int setsizesource=0; int setsize=0; @@ -50,7 +50,7 @@ class PNSet : public ReplicatedObject { //state std::memcpy(pnset, obj.pnset, sizeof(pnset)); - arraysize = obj.arraysize; + //arraysize = obj.arraysize; setsize= obj.setsize; //removeset = obj.removeset; } @@ -64,47 +64,23 @@ class PNSet : public ReplicatedObject // 0 void add(std::string a) { - bool find=false; + + //bool find=false; while(lock.load()); lock.store(true); - find=false; - for(int i=0; i