From f403a0a87ee57aa7a4a579f12150f33dc5d71356 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 14 May 2016 09:37:52 +0300 Subject: [PATCH] Migrated set-insdel-string stress test to gtest Removed old set stres tests --- build/Makefile | 21 +- projects/Win/vc14/cds.sln | 51 +- .../Win/vc14/stress-set-insdel_string.vcxproj | 279 ++++++ .../stress-set-insdel_string.vcxproj.filters | 57 ++ projects/Win/vc14/unit-set-insdel.vcxproj | 317 ------- .../Win/vc14/unit-set-insdel.vcxproj.filters | 42 - projects/source.unit.set.mk | 11 - test/include/cds_test/stress_test.h | 2 + test/stress/data/test-debug.conf | 3 +- test/stress/data/test-express.conf | 3 +- test/stress/data/test.conf | 4 +- test/stress/framework/stress_test.cpp | 31 + test/stress/set/CMakeLists.txt | 2 + .../set/delodd/set_delodd_feldman_hashset.cpp | 2 +- test/stress/set/insdel_find/CMakeLists.txt | 4 +- .../set_insdelfind_feldman_hashset.cpp | 2 +- test/stress/set/insdel_func/CMakeLists.txt | 4 +- test/stress/set/insdel_func/set_insdel_func.h | 2 - .../set_insdel_func_feldman_hashset.cpp | 2 +- test/stress/set/insdel_string/CMakeLists.txt | 30 + .../set/insdel_string/set_insdel_string.cpp | 118 +++ .../set/insdel_string/set_insdel_string.h | 515 +++++++++++ .../set_insdel_string_cuckoo.cpp | 14 +- .../set_insdel_string_ellentree.cpp | 14 +- .../set_insdel_string_feldman_hashset.cpp | 15 +- .../set_insdel_string_michael.cpp | 14 +- .../insdel_string}/set_insdel_string_skip.cpp | 14 +- .../set_insdel_string_split.cpp | 14 +- .../insdel_string}/set_insdel_string_std.cpp | 13 +- .../set_insdel_string_striped.cpp | 16 +- test/stress/set/set_type.h | 28 + test/stress/set/set_type_feldman_hashset.h | 75 +- tests/unit/CMakeLists.txt | 1 - tests/unit/map2/map_insdel_string.h | 2 +- tests/unit/set2/CMakeLists.txt | 17 - tests/unit/set2/set_defs.h | 850 ------------------ tests/unit/set2/set_delodd.cpp | 70 -- tests/unit/set2/set_delodd.h | 842 ----------------- tests/unit/set2/set_delodd_cuckoo.cpp | 40 - tests/unit/set2/set_delodd_ellentree.cpp | 40 - tests/unit/set2/set_delodd_feldmanhashset.cpp | 41 - tests/unit/set2/set_delodd_michael.cpp | 40 - tests/unit/set2/set_delodd_skip.cpp | 40 - tests/unit/set2/set_delodd_split.cpp | 40 - tests/unit/set2/set_insdel_func.cpp | 60 -- tests/unit/set2/set_insdel_func.h | 596 ------------ tests/unit/set2/set_insdel_func_cuckoo.cpp | 40 - tests/unit/set2/set_insdel_func_ellentree.cpp | 40 - .../set2/set_insdel_func_feldmanhashset.cpp | 41 - tests/unit/set2/set_insdel_func_michael.cpp | 40 - tests/unit/set2/set_insdel_func_skip.cpp | 40 - tests/unit/set2/set_insdel_func_split.cpp | 40 - tests/unit/set2/set_insdel_func_striped.cpp | 41 - tests/unit/set2/set_insdel_string.cpp | 57 -- tests/unit/set2/set_insdel_string.h | 565 ------------ .../set2/set_insdel_string_feldmanhashset.cpp | 41 - tests/unit/set2/set_insdelfind.cpp | 69 -- tests/unit/set2/set_insdelfind.h | 273 ------ tests/unit/set2/set_insdelfind_cuckoo.cpp | 40 - tests/unit/set2/set_insdelfind_ellentree.cpp | 40 - .../set2/set_insdelfind_feldmanhashset.cpp | 40 - tests/unit/set2/set_insdelfind_michael.cpp | 40 - tests/unit/set2/set_insdelfind_skip.cpp | 40 - tests/unit/set2/set_insdelfind_split.cpp | 40 - tests/unit/set2/set_insdelfind_striped.cpp | 41 - tests/unit/set2/set_type.h | 243 ----- tests/unit/set2/set_type_cuckoo.h | 211 ----- tests/unit/set2/set_type_ellen_bintree.h | 321 ------- tests/unit/set2/set_type_feldman_hashset.h | 323 ------- tests/unit/set2/set_type_lazy_list.h | 144 --- tests/unit/set2/set_type_michael.h | 196 ---- tests/unit/set2/set_type_michael_list.h | 144 --- tests/unit/set2/set_type_skip_list.h | 228 ----- tests/unit/set2/set_type_split_list.h | 526 ----------- tests/unit/set2/set_type_std.h | 245 ----- tests/unit/set2/set_type_striped.h | 619 ------------- 76 files changed, 1212 insertions(+), 7954 deletions(-) create mode 100644 projects/Win/vc14/stress-set-insdel_string.vcxproj create mode 100644 projects/Win/vc14/stress-set-insdel_string.vcxproj.filters delete mode 100644 projects/Win/vc14/unit-set-insdel.vcxproj delete mode 100644 projects/Win/vc14/unit-set-insdel.vcxproj.filters delete mode 100644 projects/source.unit.set.mk create mode 100644 test/stress/set/insdel_string/CMakeLists.txt create mode 100644 test/stress/set/insdel_string/set_insdel_string.cpp create mode 100644 test/stress/set/insdel_string/set_insdel_string.h rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_cuckoo.cpp (83%) rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_ellentree.cpp (83%) rename tests/unit/set2/set_insdelfind_std.cpp => test/stress/set/insdel_string/set_insdel_string_feldman_hashset.cpp (84%) rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_michael.cpp (83%) rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_skip.cpp (83%) rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_split.cpp (83%) rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_std.cpp (84%) rename {tests/unit/set2 => test/stress/set/insdel_string}/set_insdel_string_striped.cpp (82%) delete mode 100644 tests/unit/set2/CMakeLists.txt delete mode 100644 tests/unit/set2/set_defs.h delete mode 100644 tests/unit/set2/set_delodd.cpp delete mode 100644 tests/unit/set2/set_delodd.h delete mode 100644 tests/unit/set2/set_delodd_cuckoo.cpp delete mode 100644 tests/unit/set2/set_delodd_ellentree.cpp delete mode 100644 tests/unit/set2/set_delodd_feldmanhashset.cpp delete mode 100644 tests/unit/set2/set_delodd_michael.cpp delete mode 100644 tests/unit/set2/set_delodd_skip.cpp delete mode 100644 tests/unit/set2/set_delodd_split.cpp delete mode 100644 tests/unit/set2/set_insdel_func.cpp delete mode 100644 tests/unit/set2/set_insdel_func.h delete mode 100644 tests/unit/set2/set_insdel_func_cuckoo.cpp delete mode 100644 tests/unit/set2/set_insdel_func_ellentree.cpp delete mode 100644 tests/unit/set2/set_insdel_func_feldmanhashset.cpp delete mode 100644 tests/unit/set2/set_insdel_func_michael.cpp delete mode 100644 tests/unit/set2/set_insdel_func_skip.cpp delete mode 100644 tests/unit/set2/set_insdel_func_split.cpp delete mode 100644 tests/unit/set2/set_insdel_func_striped.cpp delete mode 100644 tests/unit/set2/set_insdel_string.cpp delete mode 100644 tests/unit/set2/set_insdel_string.h delete mode 100644 tests/unit/set2/set_insdel_string_feldmanhashset.cpp delete mode 100644 tests/unit/set2/set_insdelfind.cpp delete mode 100644 tests/unit/set2/set_insdelfind.h delete mode 100644 tests/unit/set2/set_insdelfind_cuckoo.cpp delete mode 100644 tests/unit/set2/set_insdelfind_ellentree.cpp delete mode 100644 tests/unit/set2/set_insdelfind_feldmanhashset.cpp delete mode 100644 tests/unit/set2/set_insdelfind_michael.cpp delete mode 100644 tests/unit/set2/set_insdelfind_skip.cpp delete mode 100644 tests/unit/set2/set_insdelfind_split.cpp delete mode 100644 tests/unit/set2/set_insdelfind_striped.cpp delete mode 100644 tests/unit/set2/set_type.h delete mode 100644 tests/unit/set2/set_type_cuckoo.h delete mode 100644 tests/unit/set2/set_type_ellen_bintree.h delete mode 100644 tests/unit/set2/set_type_feldman_hashset.h delete mode 100644 tests/unit/set2/set_type_lazy_list.h delete mode 100644 tests/unit/set2/set_type_michael.h delete mode 100644 tests/unit/set2/set_type_michael_list.h delete mode 100644 tests/unit/set2/set_type_skip_list.h delete mode 100644 tests/unit/set2/set_type_split_list.h delete mode 100644 tests/unit/set2/set_type_std.h delete mode 100644 tests/unit/set2/set_type_striped.h diff --git a/build/Makefile b/build/Makefile index 78e0fc6b..baca8083 100644 --- a/build/Makefile +++ b/build/Makefile @@ -120,16 +120,11 @@ include ../projects/source.unit.map.mk CDSUNIT_MAP_SOURCES := $(CDSUNIT_MAP_SOURCES:%.cpp=../%.cpp) CDSUNIT_MAP_OBJS := $(CDSUNIT_MAP_SOURCES:%.cpp=%.o) -include ../projects/source.unit.set.mk -CDSUNIT_SET_SOURCES := $(CDSUNIT_SET_SOURCES:%.cpp=../%.cpp) -CDSUNIT_SET_OBJS := $(CDSUNIT_SET_SOURCES:%.cpp=%.o) - include ../projects/source.unit.misc.mk CDSUNIT_MISC_SOURCES := $(CDSUNIT_MISC_SOURCES:%.cpp=../%.cpp) CDSUNIT_MISC_OBJS := $(CDSUNIT_MISC_SOURCES:%.cpp=%.o) -TEST_OBJ_FILE := $(CDSUNIT_COMMON_FILE) $(CDSUNIT_MAP_OBJS) $(CDSUNIT_SET_OBJS) \ - $(CDSUNIT_STACK_OBJS) $(CDSUNIT_MISC_OBJS) +TEST_OBJ_FILE := $(CDSUNIT_COMMON_FILE) $(CDSUNIT_MAP_OBJS) $(CDSUNIT_MISC_OBJS) TEST_OBJ_FILE_DEPS := $(TEST_OBJ_FILE:%.o=%.d) -include $(TEST_OBJ_FILE_DEPS) @@ -137,12 +132,10 @@ $(TEST_OBJ_FILE): %.o: %.cpp $(CXX) $(CPP_COMP_OPT) -I$(TEST_SRC_DIR) -I$(TEST_COMMONHDR_SRC_DIR) $< -o $@ CDSUNIT_MAP_EXE=$(BIN_PATH)/cdsu-map -CDSUNIT_SET_EXE=$(BIN_PATH)/cdsu-set CDSUNIT_MISC_EXE=$(BIN_PATH)/cdsu-misc -CDSUNIT_EXE_FILES= $(CDSUNIT_MAP_EXE) $(CDSUNIT_SET_EXE) $(CDSUNIT_MISC_EXE) +CDSUNIT_EXE_FILES= $(CDSUNIT_MAP_EXE) $(CDSUNIT_MISC_EXE) unit-map: $(CDSUNIT_MAP_EXE) -unit-set: $(CDSUNIT_SET_EXE) ifeq ($(platform),mingw) make_test : $(CDSUNIT_EXE_FILES) @@ -157,20 +150,15 @@ endif $(CDSUNIT_MAP_EXE) : $(CDSUNIT_MAP_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) $(CXX) $(LD_OPTS) -L$(BIN_PATH) $(CDSUNIT_MAP_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) -o $@ $(LD_BOOST_THREAD_LIB) $(LD_TEST_COMMON_LIBS) $(LDLIBS) -$(CDSUNIT_SET_EXE) : $(CDSUNIT_SET_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) - $(CXX) $(LD_OPTS) -L$(BIN_PATH) $(CDSUNIT_SET_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) -o $@ $(LD_BOOST_THREAD_LIB) $(LD_TEST_COMMON_LIBS) $(LDLIBS) - $(CDSUNIT_MISC_EXE) : $(CDSUNIT_MISC_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) $(CXX) $(LD_OPTS) -L$(BIN_PATH) $(CDSUNIT_MISC_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) -o $@ $(LD_BOOST_THREAD_LIB) $(LD_TEST_COMMON_LIBS) $(LDLIBS) CDSUNIT_MAP_EXE_DBG=$(CDSUNIT_MAP_EXE)-d -CDSUNIT_SET_EXE_DBG=$(CDSUNIT_SET_EXE)-d CDSUNIT_MISC_EXE_DBG=$(CDSUNIT_MISC_EXE)-d -CDSUNIT_EXE_DBG_FILES= $(CDSUNIT_MAP_EXE_DBG) $(CDSUNIT_SET_EXE_DBG) $(CDSUNIT_MISC_EXE_DBG) +CDSUNIT_EXE_DBG_FILES= $(CDSUNIT_MAP_EXE_DBG) $(CDSUNIT_MISC_EXE_DBG) unit-map-dbg: $(CDSUNIT_MAP_EXE_DBG) -unit-set-dbg: $(CDSUNIT_SET_EXE_DBG) ifeq ($(platform),mingw) make_debug_test : $(CDSUNIT_EXE_DBG_FILES) @@ -185,9 +173,6 @@ endif $(CDSUNIT_MAP_EXE_DBG) : $(CDSUNIT_MAP_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) $(CXX) $(LD_OPTS) -L$(BIN_PATH) $(CDSUNIT_MAP_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) -o $@ $(LD_BOOST_THREAD_LIB) $(LD_TEST_COMMON_DEBUG_LIBS) $(LDLIBS) -$(CDSUNIT_SET_EXE_DBG) : $(CDSUNIT_SET_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) - $(CXX) $(LD_OPTS) -L$(BIN_PATH) $(CDSUNIT_SET_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) -o $@ $(LD_BOOST_THREAD_LIB) $(LD_TEST_COMMON_DEBUG_LIBS) $(LDLIBS) - $(CDSUNIT_MISC_EXE_DBG) : $(CDSUNIT_MISC_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) $(CXX) $(LD_OPTS) -L$(BIN_PATH) $(CDSUNIT_MISC_OBJS) $(CDSUNIT_COMMON_FILE) $(TEST_COMMON_OBJS) -o $@ $(LD_BOOST_THREAD_LIB) $(LD_TEST_COMMON_DEBUG_LIBS) $(LDLIBS) diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index c3c96110..67019862 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -48,22 +48,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "map", "map", "{6BB7A27F-FC5 ..\..\..\tests\unit\map2\std_map.h = ..\..\..\tests\unit\map2\std_map.h EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "set", "set", "{A64449B7-90FB-4E2B-A686-9EFC0E298644}" - ProjectSection(SolutionItems) = preProject - ..\..\..\tests\unit\set2\set_defs.h = ..\..\..\tests\unit\set2\set_defs.h - ..\..\..\tests\unit\set2\set_type.h = ..\..\..\tests\unit\set2\set_type.h - ..\..\..\tests\unit\set2\set_type_cuckoo.h = ..\..\..\tests\unit\set2\set_type_cuckoo.h - ..\..\..\tests\unit\set2\set_type_ellen_bintree.h = ..\..\..\tests\unit\set2\set_type_ellen_bintree.h - ..\..\..\tests\unit\set2\set_type_feldman_hashset.h = ..\..\..\tests\unit\set2\set_type_feldman_hashset.h - ..\..\..\tests\unit\set2\set_type_lazy_list.h = ..\..\..\tests\unit\set2\set_type_lazy_list.h - ..\..\..\tests\unit\set2\set_type_michael.h = ..\..\..\tests\unit\set2\set_type_michael.h - ..\..\..\tests\unit\set2\set_type_michael_list.h = ..\..\..\tests\unit\set2\set_type_michael_list.h - ..\..\..\tests\unit\set2\set_type_skip_list.h = ..\..\..\tests\unit\set2\set_type_skip_list.h - ..\..\..\tests\unit\set2\set_type_split_list.h = ..\..\..\tests\unit\set2\set_type_split_list.h - ..\..\..\tests\unit\set2\set_type_std.h = ..\..\..\tests\unit\set2\set_type_std.h - ..\..\..\tests\unit\set2\set_type_striped.h = ..\..\..\tests\unit\set2\set_type_striped.h - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-delodd", "unit-map-delodd.vcxproj", "{3C598F96-FB84-4D42-9B43-F697F53B0221}" ProjectSection(ProjectDependencies) = postProject {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} @@ -82,12 +66,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-insdel", "unit-map {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-set-insdel", "unit-set-insdel.vcxproj", "{BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}" - ProjectSection(ProjectDependencies) = postProject - {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} - {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-insdel-item", "unit-map-insdel-item.vcxproj", "{7521DD92-56FF-4ECA-93E5-CCE50862354B}" ProjectSection(ProjectDependencies) = postProject {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81} @@ -227,6 +205,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-insdelfind", "st EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-insdel-func", "stress-set-insdel_func.vcxproj", "{EE7A269E-83E4-402B-9C79-85058826E81E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-insdel-string", "stress-set-insdel_string.vcxproj", "{937D82C6-92AB-4C58-ACE8-F88E7063BFA9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -309,18 +289,6 @@ Global {CA25BDBF-B354-4597-B6D2-220ABBB0D2F4}.Release|Win32.Build.0 = Release|Win32 {CA25BDBF-B354-4597-B6D2-220ABBB0D2F4}.Release|x64.ActiveCfg = Release|x64 {CA25BDBF-B354-4597-B6D2-220ABBB0D2F4}.Release|x64.Build.0 = Release|x64 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Debug|Win32.Build.0 = Debug|Win32 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Debug|x64.ActiveCfg = Debug|x64 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Debug|x64.Build.0 = Debug|x64 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.DebugVLD|x64.Build.0 = DebugVLD|x64 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|Win32.ActiveCfg = Release|Win32 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|Win32.Build.0 = Release|Win32 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|x64.ActiveCfg = Release|x64 - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|x64.Build.0 = Release|x64 {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|Win32.ActiveCfg = Debug|Win32 {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|Win32.Build.0 = Debug|Win32 {7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|x64.ActiveCfg = Debug|x64 @@ -573,6 +541,18 @@ Global {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|Win32.Build.0 = Release|Win32 {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|x64.ActiveCfg = Release|x64 {EE7A269E-83E4-402B-9C79-85058826E81E}.Release|x64.Build.0 = Release|x64 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Debug|Win32.ActiveCfg = Debug|Win32 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Debug|Win32.Build.0 = Debug|Win32 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Debug|x64.ActiveCfg = Debug|x64 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Debug|x64.Build.0 = Debug|x64 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.DebugVLD|x64.Build.0 = DebugVLD|x64 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Release|Win32.ActiveCfg = Release|Win32 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Release|Win32.Build.0 = Release|Win32 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Release|x64.ActiveCfg = Release|x64 + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -581,11 +561,9 @@ Global {61179F2F-07E1-490D-B64D-D85A90B6EF81} = {B30CA283-1796-4763-92C3-2E4848D443F7} {77350FDC-9E51-438B-9A8F-D2FEA11D46B2} = {B30CA283-1796-4763-92C3-2E4848D443F7} {6BB7A27F-FC59-4267-B6FA-D034176D1459} = {B30CA283-1796-4763-92C3-2E4848D443F7} - {A64449B7-90FB-4E2B-A686-9EFC0E298644} = {B30CA283-1796-4763-92C3-2E4848D443F7} {3C598F96-FB84-4D42-9B43-F697F53B0221} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} {BA2A9239-0299-4069-BB0E-16DACE87ADE0} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} {CA25BDBF-B354-4597-B6D2-220ABBB0D2F4} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1} = {A64449B7-90FB-4E2B-A686-9EFC0E298644} {7521DD92-56FF-4ECA-93E5-CCE50862354B} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} {CA6F0834-0628-4CD7-8800-AEABCD636360} = {6BB7A27F-FC59-4267-B6FA-D034176D1459} {5407E9D2-67D9-4266-976E-7A90BDE2541D} = {810490B7-31E5-49AE-8455-CAF99A9658B6} @@ -609,6 +587,7 @@ Global {D968B0F5-52BD-40C1-B230-28104567CE97} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} {133D1AEE-3BAF-42D1-B1AB-93D5239F4926} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} {EE7A269E-83E4-402B-9C79-85058826E81E} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} diff --git a/projects/Win/vc14/stress-set-insdel_string.vcxproj b/projects/Win/vc14/stress-set-insdel_string.vcxproj new file mode 100644 index 00000000..4c22fc70 --- /dev/null +++ b/projects/Win/vc14/stress-set-insdel_string.vcxproj @@ -0,0 +1,279 @@ + + + + + DebugVLD + Win32 + + + DebugVLD + x64 + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + + + + + + + + + {937D82C6-92AB-4C58-ACE8-F88E7063BFA9} + Win32Proj + stress_set_insdel_string + 8.1 + stress-set-insdel-string + + + + Application + true + v140 + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + true + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + $(ProjectName)_d + + + false + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ + $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + true + true + $(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtest.lib;stress-framework.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + _ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + + + Console + true + true + true + $(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir) + gtest.lib;stress-framework.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/projects/Win/vc14/stress-set-insdel_string.vcxproj.filters b/projects/Win/vc14/stress-set-insdel_string.vcxproj.filters new file mode 100644 index 00000000..9e1bf0ed --- /dev/null +++ b/projects/Win/vc14/stress-set-insdel_string.vcxproj.filters @@ -0,0 +1,57 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/projects/Win/vc14/unit-set-insdel.vcxproj b/projects/Win/vc14/unit-set-insdel.vcxproj deleted file mode 100644 index a510845d..00000000 --- a/projects/Win/vc14/unit-set-insdel.vcxproj +++ /dev/null @@ -1,317 +0,0 @@ - - - - - DebugVLD - Win32 - - - DebugVLD - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - {BA23811C-D4CB-4836-B2F3-6791BD6FFCD1} - unitset - Win32Proj - 8.1 - - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - v140 - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - $(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\ - $(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\ - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - $(ProjectName)_d - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4503;4520;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4503;4520;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - 4503;4520;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - Disabled - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - 4503;4520;%(DisableSpecificWarnings) - - - unit-prerequisites_d.lib;%(AdditionalDependencies) - $(TargetPath) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - MultiplyDefinedSymbolOnly - - - - - /bigobj /Zc:inline %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4503;4520;%(DisableSpecificWarnings) - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX86 - $(TargetPath) - MultiplyDefinedSymbolOnly - - - - - X64 - - - /bigobj /Zc:inline %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - $(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\unit;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4503;4520;%(DisableSpecificWarnings) - - - unit-prerequisites.lib;%(AdditionalDependencies) - $(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX64 - $(TargetPath) - MultiplyDefinedSymbolOnly - - - - - - \ No newline at end of file diff --git a/projects/Win/vc14/unit-set-insdel.vcxproj.filters b/projects/Win/vc14/unit-set-insdel.vcxproj.filters deleted file mode 100644 index dd411a95..00000000 --- a/projects/Win/vc14/unit-set-insdel.vcxproj.filters +++ /dev/null @@ -1,42 +0,0 @@ - - - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - set_insdel_string - - - - - {8a51ae1e-c41c-4394-bf84-3de8c45ea8bb} - - - - - set_insdel_string - - - \ No newline at end of file diff --git a/projects/source.unit.set.mk b/projects/source.unit.set.mk deleted file mode 100644 index f0c8ee5e..00000000 --- a/projects/source.unit.set.mk +++ /dev/null @@ -1,11 +0,0 @@ - -CDSUNIT_SET_SOURCES := \ - tests/unit/set2/set_insdel_string.cpp \ - tests/unit/set2/set_insdel_string_cuckoo.cpp \ - tests/unit/set2/set_insdel_string_ellentree.cpp \ - tests/unit/set2/set_insdel_string_michael.cpp \ - tests/unit/set2/set_insdel_string_feldmanhashset.cpp \ - tests/unit/set2/set_insdel_string_skip.cpp \ - tests/unit/set2/set_insdel_string_split.cpp \ - tests/unit/set2/set_insdel_string_striped.cpp \ - tests/unit/set2/set_insdel_string_std.cpp \ diff --git a/test/include/cds_test/stress_test.h b/test/include/cds_test/stress_test.h index 10aeff54..60fe06c8 100644 --- a/test/include/cds_test/stress_test.h +++ b/test/include/cds_test/stress_test.h @@ -167,6 +167,8 @@ namespace cds_test { static config const& get_config( char const * slot ); static config const& get_config( std::string const& slot ); + static std::vector load_dictionary(); + private: thread_pool m_thread_pool; }; diff --git a/test/stress/data/test-debug.conf b/test/stress/data/test-debug.conf index 845b3bec..82fae8db 100644 --- a/test/stress/data/test-debug.conf +++ b/test/stress/data/test-debug.conf @@ -251,13 +251,14 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDel_string] +[map_insdel_string] InsertThreadCount=4 DeleteThreadCount=4 ThreadPassCount=8 MapSize=10000 MaxLoadFactor=4 PrintGCStateFlag=1 + # *** Cuckoo map properties CuckooInitialSize=256 CuckooProbesetSize=8 diff --git a/test/stress/data/test-express.conf b/test/stress/data/test-express.conf index f7171d3b..04e7a10c 100644 --- a/test/stress/data/test-express.conf +++ b/test/stress/data/test-express.conf @@ -245,13 +245,14 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDel_string] +[map_insdel_string] InsertThreadCount=4 DeleteThreadCount=4 ThreadPassCount=2 MapSize=100000 MaxLoadFactor=4 PrintGCStateFlag=1 + # *** Cuckoo map properties CuckooInitialSize=1024 CuckooProbesetSize=16 diff --git a/test/stress/data/test.conf b/test/stress/data/test.conf index 320c965a..50aa398f 100644 --- a/test/stress/data/test.conf +++ b/test/stress/data/test.conf @@ -243,13 +243,13 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=10 FeldmanMapArrayBits=4 -[Map_InsDel_string] +[map_insdel_string] InsertThreadCount=4 DeleteThreadCount=4 ThreadPassCount=2 MapSize=500000 MaxLoadFactor=4 -PrintGCStateFlag=1 + # *** Cuckoo map properties CuckooInitialSize=1024 CuckooProbesetSize=16 diff --git a/test/stress/framework/stress_test.cpp b/test/stress/framework/stress_test.cpp index 498f3146..b9e4d7d4 100644 --- a/test/stress/framework/stress_test.cpp +++ b/test/stress/framework/stress_test.cpp @@ -28,6 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include #include namespace cds_test { @@ -40,4 +42,33 @@ namespace cds_test { static property_stream s_prop_stream; return s_prop_stream; } + + /*static*/ std::vector stress_fixture::load_dictionary() + { + std::vector arrString; + + std::ifstream s; + char const* filename = "./dictionary.txt"; + s.open( filename ); + if ( !s.is_open() ) { + std::cerr << "WARNING: Cannot open test file " << filename << std::endl; + return arrString; + } + + std::string line; + std::getline( s, line ); + + arrString.reserve( std::stoul( line )); + + while ( !s.eof() ) { + std::getline( s, line ); + if ( !line.empty() ) + arrString.push_back( std::move( line )); + } + + s.close(); + + return arrString; + } + } // namespace diff --git a/test/stress/set/CMakeLists.txt b/test/stress/set/CMakeLists.txt index 90dccbce..473f4e5b 100644 --- a/test/stress/set/CMakeLists.txt +++ b/test/stress/set/CMakeLists.txt @@ -4,10 +4,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_USE_URCU") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_find) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_string) add_custom_target( stress-set DEPENDS stress-set-delodd stress-set-insdelfind stress-set-insdel-func + stress-set-insdel-string ) diff --git a/test/stress/set/delodd/set_delodd_feldman_hashset.cpp b/test/stress/set/delodd/set_delodd_feldman_hashset.cpp index 64e9f81b..207139f8 100644 --- a/test/stress/set/delodd/set_delodd_feldman_hashset.cpp +++ b/test/stress/set/delodd/set_delodd_feldman_hashset.cpp @@ -33,6 +33,6 @@ namespace set { - CDSSTRESS_FeldmanHashSet( Set_DelOdd, run_test_extract, key_thread, size_t ) + CDSSTRESS_FeldmanHashSet_fixed( Set_DelOdd, run_test_extract, key_thread, size_t ) } // namespace set diff --git a/test/stress/set/insdel_find/CMakeLists.txt b/test/stress/set/insdel_find/CMakeLists.txt index dd7f88eb..5c8b0d64 100644 --- a/test/stress/set/insdel_find/CMakeLists.txt +++ b/test/stress/set/insdel_find/CMakeLists.txt @@ -1,6 +1,6 @@ set(PACKAGE_NAME stress-set-insdelfind) -set(CDSSTRESS_SET_DELODD_SOURCES +set(CDSSTRESS_SET_INSDELFIND_SOURCES ../../main.cpp set_insdelfind.cpp set_insdelfind_cuckoo.cpp @@ -18,7 +18,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_DELODD_SOURCES} $) +add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_INSDELFIND_SOURCES} $) target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${GTEST_LIBRARY} diff --git a/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp b/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp index 37543c45..586036bb 100644 --- a/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp +++ b/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp @@ -33,6 +33,6 @@ namespace set { - CDSSTRESS_FeldmanHashSet( Set_InsDelFind, run_test, size_t, size_t ) + CDSSTRESS_FeldmanHashSet_fixed( Set_InsDelFind, run_test, size_t, size_t ) } // namespace set diff --git a/test/stress/set/insdel_func/CMakeLists.txt b/test/stress/set/insdel_func/CMakeLists.txt index 99a31d00..13c2b2c0 100644 --- a/test/stress/set/insdel_func/CMakeLists.txt +++ b/test/stress/set/insdel_func/CMakeLists.txt @@ -1,6 +1,6 @@ set(PACKAGE_NAME stress-set-insdel-func) -set(CDSSTRESS_SET_DELODD_SOURCES +set(CDSSTRESS_SET_INSDEL_FUNC_SOURCES ../../main.cpp set_insdel_func.cpp set_insdel_func_cuckoo.cpp @@ -17,7 +17,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_DELODD_SOURCES} $) +add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_INSDEL_FUNC_SOURCES} $) target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${GTEST_LIBRARY} diff --git a/test/stress/set/insdel_func/set_insdel_func.h b/test/stress/set/insdel_func/set_insdel_func.h index 0e69476b..8d6a5bf8 100644 --- a/test/stress/set/insdel_func/set_insdel_func.h +++ b/test/stress/set/insdel_func/set_insdel_func.h @@ -136,7 +136,6 @@ namespace set { public: size_t m_nInsertSuccess = 0; size_t m_nInsertFailed = 0; - size_t m_nTestFunctorRef = 0; public: @@ -349,7 +348,6 @@ namespace set { public: size_t m_nDeleteSuccess = 0; size_t m_nDeleteFailed = 0; - size_t m_nValueSuccess = 0; size_t m_nValueFailed = 0; diff --git a/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp b/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp index 1d88c516..05a8f6c2 100644 --- a/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp +++ b/test/stress/set/insdel_func/set_insdel_func_feldman_hashset.cpp @@ -33,6 +33,6 @@ namespace set { - CDSSTRESS_FeldmanHashSet( Set_InsDel_func, run_test, size_t, value ) + CDSSTRESS_FeldmanHashSet_fixed( Set_InsDel_func, run_test, size_t, value ) } // namespace set diff --git a/test/stress/set/insdel_string/CMakeLists.txt b/test/stress/set/insdel_string/CMakeLists.txt new file mode 100644 index 00000000..0b557e35 --- /dev/null +++ b/test/stress/set/insdel_string/CMakeLists.txt @@ -0,0 +1,30 @@ +set(PACKAGE_NAME stress-set-insdel-string) + +set(CDSSTRESS_SET_INSDEL_STRING_SOURCES + ../../main.cpp + set_insdel_string.cpp + set_insdel_string_cuckoo.cpp + set_insdel_string_ellentree.cpp + set_insdel_string_feldman_hashset.cpp + set_insdel_string_michael.cpp + set_insdel_string_skip.cpp + set_insdel_string_split.cpp + set_insdel_string_std.cpp + set_insdel_string_striped.cpp +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + +add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_INSDEL_STRING_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} + ${CDS_SHARED_LIBRARY} + ${GTEST_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} +) + +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) \ No newline at end of file diff --git a/test/stress/set/insdel_string/set_insdel_string.cpp b/test/stress/set/insdel_string/set_insdel_string.cpp new file mode 100644 index 00000000..eeb9fbc3 --- /dev/null +++ b/test/stress/set/insdel_string/set_insdel_string.cpp @@ -0,0 +1,118 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_insdel_string.h" + +namespace set { + + size_t Set_InsDel_string::s_nSetSize = 1000000; // set size + size_t Set_InsDel_string::s_nInsertThreadCount = 4; // count of insertion thread + size_t Set_InsDel_string::s_nDeleteThreadCount = 4; // count of deletion thread + size_t Set_InsDel_string::s_nThreadPassCount = 4; // pass count for each thread + size_t Set_InsDel_string::s_nMaxLoadFactor = 8; // maximum load factor + + size_t Set_InsDel_string::s_nCuckooInitialSize = 1024;// initial size for CuckooSet + size_t Set_InsDel_string::s_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) + size_t Set_InsDel_string::s_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) + + size_t Set_InsDel_string::s_nFeldmanSet_HeadBits = 10; + size_t Set_InsDel_string::s_nFeldmanSet_ArrayBits = 4; + + size_t Set_InsDel_string::s_nLoadFactor = 1; + std::vector Set_InsDel_string::m_arrString; + + void Set_InsDel_string::SetUpTestCase() + { + cds_test::config const& cfg = get_config( "map_insdel_func" ); + + s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize ); + if ( s_nSetSize < 1000 ) + s_nSetSize = 1000; + + s_nInsertThreadCount = cfg.get_size_t( "InsertThreadCount", s_nInsertThreadCount ); + if ( s_nInsertThreadCount == 0 ) + s_nInsertThreadCount = 2; + + s_nDeleteThreadCount = cfg.get_size_t( "DeleteThreadCount", s_nDeleteThreadCount ); + if ( s_nDeleteThreadCount == 0 ) + s_nDeleteThreadCount = 2; + + s_nThreadPassCount = cfg.get_size_t( "ThreadPassCount", s_nThreadPassCount ); + if ( s_nThreadPassCount == 0 ) + s_nThreadPassCount = 4; + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize ); + if ( s_nCuckooInitialSize < 256 ) + s_nCuckooInitialSize = 256; + + s_nCuckooProbesetSize = cfg.get_size_t( "CuckooProbesetSize", s_nCuckooProbesetSize ); + if ( s_nCuckooProbesetSize < 8 ) + s_nCuckooProbesetSize = 8; + + s_nCuckooProbesetThreshold = cfg.get_size_t( "CuckooProbesetThreshold", s_nCuckooProbesetThreshold ); + + s_nFeldmanSet_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanSet_HeadBits ); + if ( s_nFeldmanSet_HeadBits == 0 ) + s_nFeldmanSet_HeadBits = 2; + + s_nFeldmanSet_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanSet_ArrayBits ); + if ( s_nFeldmanSet_ArrayBits == 0 ) + s_nFeldmanSet_ArrayBits = 2; + + // Load string dictionary + m_arrString = load_dictionary(); + } + + void Set_InsDel_string::TearDownTestCase() + { + m_arrString.clear(); + } + + std::vector Set_InsDel_string_LF::get_load_factors() + { + cds_test::config const& cfg = get_config( "map_insdel_func" ); + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + std::vector lf; + for ( size_t n = 1; n <= s_nMaxLoadFactor; n *= 2 ) + lf.push_back( n ); + + return lf; + } + + INSTANTIATE_TEST_CASE_P( a, Set_InsDel_string_LF, ::testing::ValuesIn( Set_InsDel_string_LF::get_load_factors())); +} // namespace set diff --git a/test/stress/set/insdel_string/set_insdel_string.h b/test/stress/set/insdel_string/set_insdel_string.h new file mode 100644 index 00000000..28e75ee8 --- /dev/null +++ b/test/stress/set/insdel_string/set_insdel_string.h @@ -0,0 +1,515 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "set_type.h" + +namespace set { + +#define TEST_CASE(TAG, X) void X(); + + class Set_InsDel_string: public cds_test::stress_fixture + { + public: + static size_t s_nSetSize; // set size + static size_t s_nInsertThreadCount; // count of insertion thread + static size_t s_nDeleteThreadCount; // count of deletion thread + static size_t s_nThreadPassCount; // pass count for each thread + static size_t s_nMaxLoadFactor; // maximum load factor + + static size_t s_nCuckooInitialSize; // initial size for CuckooSet + static size_t s_nCuckooProbesetSize; // CuckooSet probeset size (only for list-based probeset) + static size_t s_nCuckooProbesetThreshold; // CUckooSet probeset threshold (0 - use default) + + static size_t s_nFeldmanSet_HeadBits; + static size_t s_nFeldmanSet_ArrayBits; + + static size_t s_nLoadFactor; + static std::vector m_arrString; + + static void SetUpTestCase(); + static void TearDownTestCase(); + + private: + typedef std::string key_type; + typedef size_t value_type; + + enum { + insert_thread, + delete_thread, + extract_thread + }; + + template + class Inserter: public cds_test::thread + { + typedef cds_test::thread base_class; + + Set& m_Set; + typedef typename Set::value_type keyval_type; + + public: + size_t m_nInsertSuccess = 0; + size_t m_nInsertFailed = 0; + + public: + Inserter( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, insert_thread ) + , m_Set( set ) + {} + + Inserter( Inserter& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Inserter( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + + Set_InsDel_string& fixture = pool().template fixture(); + size_t nArrSize = m_arrString.size(); + size_t const nSetSize = fixture.s_nSetSize; + size_t const nPassCount = fixture.s_nThreadPassCount; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { + if ( rSet.insert( keyval_type( m_arrString[nItem % nArrSize], nItem * 8 ))) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { + if ( rSet.insert( keyval_type( m_arrString[nItem % nArrSize], nItem * 8 ))) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + } + } + } + } + }; + + template + class Deleter: public cds_test::thread + { + typedef cds_test::thread base_class; + + Set& m_Set; + public: + size_t m_nDeleteSuccess = 0; + size_t m_nDeleteFailed = 0; + + public: + Deleter( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, delete_thread ) + , m_Set( set ) + {} + + Deleter( Deleter& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Deleter( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + + Set_InsDel_string& fixture = pool().template fixture(); + size_t nArrSize = m_arrString.size(); + size_t const nSetSize = fixture.s_nSetSize; + size_t const nPassCount = fixture.s_nThreadPassCount; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { + if ( rSet.erase( m_arrString[nItem % nArrSize] )) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { + if ( rSet.erase( m_arrString[nItem % nArrSize] )) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + } + } + } + }; + + template + class Extractor: public cds_test::thread + { + typedef cds_test::thread base_class; + Set& m_Set; + + public: + size_t m_nDeleteSuccess = 0; + size_t m_nDeleteFailed = 0; + + public: + Extractor( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, extract_thread ) + , m_Set( set ) + {} + + Extractor( Extractor& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Extractor( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + + typename Set::guarded_ptr gp; + + Set_InsDel_string& fixture = pool().template fixture(); + size_t nArrSize = m_arrString.size(); + size_t const nSetSize = fixture.s_nSetSize; + size_t const nPassCount = fixture.s_nThreadPassCount; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { + gp = rSet.extract( m_arrString[nItem % nArrSize] ); + if ( gp ) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + gp.release(); + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { + gp = rSet.extract( m_arrString[nItem % nArrSize] ); + if ( gp ) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + gp.release(); + } + } + } + } + }; + + template + class Extractor, Set >: public cds_test::thread + { + typedef cds_test::thread base_class; + Set& m_Set; + + public: + size_t m_nDeleteSuccess = 0; + size_t m_nDeleteFailed = 0; + + public: + Extractor( cds_test::thread_pool& pool, Set& set ) + : base_class( pool, extract_thread ) + , m_Set( set ) + {} + + Extractor( Extractor& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Extractor( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + + typename Set::exempt_ptr xp; + + Set_InsDel_string& fixture = pool().template fixture(); + size_t nArrSize = m_arrString.size(); + size_t const nSetSize = fixture.s_nSetSize; + size_t const nPassCount = fixture.s_nThreadPassCount; + + if ( id() & 1 ) { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { + if ( Set::c_bExtractLockExternal ) { + typename Set::rcu_lock l; + xp = rSet.extract( m_arrString[nItem % nArrSize] ); + if ( xp ) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + else { + xp = rSet.extract( m_arrString[nItem % nArrSize] ); + if ( xp ) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + xp.release(); + } + } + } + else { + for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { + for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { + if ( Set::c_bExtractLockExternal ) { + typename Set::rcu_lock l; + xp = rSet.extract( m_arrString[nItem % nArrSize] ); + if ( xp ) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + else { + xp = rSet.extract( m_arrString[nItem % nArrSize] ); + if ( xp ) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + } + xp.release(); + } + } + } + } + }; + + protected: + template + void do_test( Set& testSet ) + { + typedef Inserter InserterThread; + typedef Deleter DeleterThread; + + cds_test::thread_pool& pool = get_pool(); + pool.add( new InserterThread( pool, testSet ), s_nInsertThreadCount ); + pool.add( new DeleterThread( pool, testSet ), s_nDeleteThreadCount ); + + propout() << std::make_pair( "insert_thread_count", s_nInsertThreadCount ) + << std::make_pair( "delete_thread_count", s_nDeleteThreadCount ) + << std::make_pair( "thread_pass_count", s_nThreadPassCount ) + << std::make_pair( "set_size", s_nSetSize ); + + std::chrono::milliseconds duration = pool.run(); + + propout() << std::make_pair( "duration", duration ); + + size_t nInsertSuccess = 0; + size_t nInsertFailed = 0; + size_t nDeleteSuccess = 0; + size_t nDeleteFailed = 0; + for ( size_t i = 0; i < pool.size(); ++i ) { + cds_test::thread& thr = pool.get( i ); + switch ( thr.type() ) { + case insert_thread: + { + InserterThread& inserter = static_cast( thr ); + nInsertSuccess += inserter.m_nInsertSuccess; + nInsertFailed += inserter.m_nInsertFailed; + } + break; + case delete_thread: + { + DeleterThread& deleter = static_cast(thr); + nDeleteSuccess += deleter.m_nDeleteSuccess; + nDeleteFailed += deleter.m_nDeleteFailed; + } + break; + default: + assert( false ); // Forgot anything?.. + } + } + + propout() + << std::make_pair( "insert_success", nInsertSuccess ) + << std::make_pair( "delete_success", nDeleteSuccess ) + << std::make_pair( "insert_failed", nInsertFailed ) + << std::make_pair( "delete_failed", nDeleteFailed ) + << std::make_pair( "final_set_size", testSet.size() ); + + testSet.clear(); + EXPECT_TRUE( testSet.empty() ); + + additional_check( testSet ); + print_stat( propout(), testSet ); + additional_cleanup( testSet ); + } + + template + void do_test_extract( Set& testSet ) + { + typedef Inserter InserterThread; + typedef Deleter DeleterThread; + typedef Extractor ExtractThread; + + size_t const nDelThreadCount = s_nDeleteThreadCount / 2; + size_t const nExtractThreadCount = s_nDeleteThreadCount - nDelThreadCount; + + cds_test::thread_pool& pool = get_pool(); + pool.add( new InserterThread( pool, testSet ), s_nInsertThreadCount ); + pool.add( new DeleterThread( pool, testSet ), nDelThreadCount ); + pool.add( new ExtractThread( pool, testSet ), nExtractThreadCount ); + + propout() << std::make_pair( "insert_thread_count", s_nInsertThreadCount ) + << std::make_pair( "delete_thread_count", nDelThreadCount ) + << std::make_pair( "extract_thread_count", nExtractThreadCount ) + << std::make_pair( "thread_pass_count", s_nThreadPassCount ) + << std::make_pair( "set_size", s_nSetSize ); + + std::chrono::milliseconds duration = pool.run(); + + propout() << std::make_pair( "duration", duration ); + + size_t nInsertSuccess = 0; + size_t nInsertFailed = 0; + size_t nDeleteSuccess = 0; + size_t nDeleteFailed = 0; + size_t nExtractSuccess = 0; + size_t nExtractFailed = 0; + for ( size_t i = 0; i < pool.size(); ++i ) { + cds_test::thread& thr = pool.get( i ); + switch ( thr.type() ) { + case insert_thread: + { + InserterThread& inserter = static_cast(thr); + nInsertSuccess += inserter.m_nInsertSuccess; + nInsertFailed += inserter.m_nInsertFailed; + } + break; + case delete_thread: + { + DeleterThread& deleter = static_cast(thr); + nDeleteSuccess += deleter.m_nDeleteSuccess; + nDeleteFailed += deleter.m_nDeleteFailed; + } + break; + case extract_thread: + { + ExtractThread& extractor = static_cast(thr); + nExtractSuccess += extractor.m_nDeleteSuccess; + nExtractFailed += extractor.m_nDeleteFailed; + } + break; + default: + assert( false ); // Forgot anything?.. + } + } + + propout() + << std::make_pair( "insert_success", nInsertSuccess ) + << std::make_pair( "delete_success", nDeleteSuccess ) + << std::make_pair( "extract_success", nExtractSuccess ) + << std::make_pair( "insert_failed", nInsertFailed ) + << std::make_pair( "delete_failed", nDeleteFailed ) + << std::make_pair( "extract_failed", nExtractFailed ) + << std::make_pair( "final_set_size", testSet.size() ); + + testSet.clear(); + EXPECT_TRUE( testSet.empty() ); + + additional_check( testSet ); + print_stat( propout(), testSet ); + additional_cleanup( testSet ); + } + + template + void run_test() + { + ASSERT_TRUE( m_arrString.size() > 0 ); + + Set s( *this ); + do_test( s ); + } + + template + void run_test_extract() + { + ASSERT_TRUE( m_arrString.size() > 0 ); + + Set s( *this ); + do_test_extract( s ); + } + }; + + class Set_InsDel_string_LF: public Set_InsDel_string + , public ::testing::WithParamInterface + { + public: + template + void run_test() + { + s_nLoadFactor = GetParam(); + propout() << std::make_pair( "load_factor", s_nLoadFactor ); + Set_InsDel_string::run_test(); + } + + template + void run_test_extract() + { + s_nLoadFactor = GetParam(); + propout() << std::make_pair( "load_factor", s_nLoadFactor ); + Set_InsDel_string::run_test_extract(); + } + + static std::vector get_load_factors(); + }; + +} // namespace set diff --git a/tests/unit/set2/set_insdel_string_cuckoo.cpp b/test/stress/set/insdel_string/set_insdel_string_cuckoo.cpp similarity index 83% rename from tests/unit/set2/set_insdel_string_cuckoo.cpp rename to test/stress/set/insdel_string/set_insdel_string_cuckoo.cpp index 07557aeb..c9b02b03 100644 --- a/tests/unit/set2/set_insdel_string_cuckoo.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_cuckoo.cpp @@ -28,13 +28,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_cuckoo.h" +#include "set_insdel_string.h" +#include "set_type_cuckoo.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test::X>(); } -#include "set2/set_defs.h" +namespace set { -namespace set2 { - CDSUNIT_DECLARE_CuckooSet -} // namespace set2 + CDSSTRESS_CuckooSet( Set_InsDel_string, run_test, std::string, size_t ) + +} // namespace set diff --git a/tests/unit/set2/set_insdel_string_ellentree.cpp b/test/stress/set/insdel_string/set_insdel_string_ellentree.cpp similarity index 83% rename from tests/unit/set2/set_insdel_string_ellentree.cpp rename to test/stress/set/insdel_string/set_insdel_string_ellentree.cpp index 08fc39f2..7c78bff5 100644 --- a/tests/unit/set2/set_insdel_string_ellentree.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_ellentree.cpp @@ -28,13 +28,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_ellen_bintree.h" +#include "set_insdel_string.h" +#include "set_type_ellen_bintree.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" +namespace set { -namespace set2 { - CDSUNIT_DECLARE_EllenBinTreeSet -} // namespace set2 + CDSSTRESS_EllenBinTreeSet( Set_InsDel_string, run_test_extract, std::string, size_t ) + +} // namespace set diff --git a/tests/unit/set2/set_insdelfind_std.cpp b/test/stress/set/insdel_string/set_insdel_string_feldman_hashset.cpp similarity index 84% rename from tests/unit/set2/set_insdelfind_std.cpp rename to test/stress/set/insdel_string/set_insdel_string_feldman_hashset.cpp index 24b3f2c2..792d1169 100644 --- a/tests/unit/set2/set_insdelfind_std.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_feldman_hashset.cpp @@ -28,13 +28,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdelfind.h" -#include "set2/set_type_std.h" +#include "set_insdel_string.h" +#include "set_type_feldman_hashset.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" +namespace set { -namespace set2 { - CDSUNIT_DECLARE_StdSet -} // namespace set2 + CDSSTRESS_FeldmanHashSet_stdhash( Set_InsDel_string, run_test_extract, std::string, size_t ) + CDSSTRESS_FeldmanHashSet_city( Set_InsDel_string, run_test_extract, std::string, size_t ) + +} // namespace set diff --git a/tests/unit/set2/set_insdel_string_michael.cpp b/test/stress/set/insdel_string/set_insdel_string_michael.cpp similarity index 83% rename from tests/unit/set2/set_insdel_string_michael.cpp rename to test/stress/set/insdel_string/set_insdel_string_michael.cpp index deefcd25..26561cc7 100644 --- a/tests/unit/set2/set_insdel_string_michael.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_michael.cpp @@ -28,13 +28,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_michael.h" +#include "set_insdel_string.h" +#include "set_type_michael.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" +namespace set { -namespace set2 { - CDSUNIT_DECLARE_MichaelSet -} // namespace set2 + CDSSTRESS_MichaelSet( Set_InsDel_string_LF, run_test_extract, std::string, size_t ) + +} // namespace set diff --git a/tests/unit/set2/set_insdel_string_skip.cpp b/test/stress/set/insdel_string/set_insdel_string_skip.cpp similarity index 83% rename from tests/unit/set2/set_insdel_string_skip.cpp rename to test/stress/set/insdel_string/set_insdel_string_skip.cpp index 9fbabf25..1ba4b2ce 100644 --- a/tests/unit/set2/set_insdel_string_skip.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_skip.cpp @@ -28,13 +28,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_skip_list.h" +#include "set_insdel_string.h" +#include "set_type_skip_list.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" +namespace set { -namespace set2 { - CDSUNIT_DECLARE_SkipListSet -} // namespace set2 + CDSSTRESS_SkipListSet( Set_InsDel_string, run_test_extract, std::string, size_t ) + +} // namespace set diff --git a/tests/unit/set2/set_insdel_string_split.cpp b/test/stress/set/insdel_string/set_insdel_string_split.cpp similarity index 83% rename from tests/unit/set2/set_insdel_string_split.cpp rename to test/stress/set/insdel_string/set_insdel_string_split.cpp index 55ef8a0e..b570933b 100644 --- a/tests/unit/set2/set_insdel_string_split.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_split.cpp @@ -28,13 +28,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_split_list.h" +#include "set_insdel_string.h" +#include "set_type_split_list.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" +namespace set { -namespace set2 { - CDSUNIT_DECLARE_SplitList -} // namespace set2 + CDSSTRESS_SplitListSet( Set_InsDel_string_LF, run_test_extract, std::string, size_t ) + +} // namespace set diff --git a/tests/unit/set2/set_insdel_string_std.cpp b/test/stress/set/insdel_string/set_insdel_string_std.cpp similarity index 84% rename from tests/unit/set2/set_insdel_string_std.cpp rename to test/stress/set/insdel_string/set_insdel_string_std.cpp index 04933be8..2bb7b038 100644 --- a/tests/unit/set2/set_insdel_string_std.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_std.cpp @@ -28,13 +28,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_std.h" +#include "set_insdel_string.h" +#include "set_type_std.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test::X>(); } -#include "set2/set_defs.h" +namespace set { + CDSSTRESS_StdSet( Set_InsDel_string, run_test, std::string, size_t ) +} // namespace set -namespace set2 { - CDSUNIT_DECLARE_StdSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_string_striped.cpp b/test/stress/set/insdel_string/set_insdel_string_striped.cpp similarity index 82% rename from tests/unit/set2/set_insdel_string_striped.cpp rename to test/stress/set/insdel_string/set_insdel_string_striped.cpp index 315d4991..3026dfd5 100644 --- a/tests/unit/set2/set_insdel_string_striped.cpp +++ b/test/stress/set/insdel_string/set_insdel_string_striped.cpp @@ -28,14 +28,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "set2/set_insdel_string.h" -#include "set2/set_type_striped.h" +#include "set_insdel_string.h" +#include "set_type_striped.h" -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test::X>(); } -#include "set2/set_defs.h" +namespace set { + + CDSSTRESS_StripedSet( Set_InsDel_string_LF, run_test, std::string, size_t ) + +} // namespace set -namespace set2 { - CDSUNIT_DECLARE_StripedSet - CDSUNIT_DECLARE_RefinableSet -} // namespace set2 diff --git a/test/stress/set/set_type.h b/test/stress/set/set_type.h index 2c524ed5..37bc1069 100644 --- a/test/stress/set/set_type.h +++ b/test/stress/set/set_type.h @@ -111,6 +111,23 @@ namespace set { } }; + template <> + struct less + { + bool operator ()( std::string const& k1, std::string const& k2 ) const + { + return cmp()( k1, k2 ) < 0; + } + bool operator ()( std::string const& k1, char const* k2 ) const + { + return cmp()( k1, k2 ) < 0; + } + bool operator ()( char const* k1, std::string const& k2 ) const + { + return cmp()( k1, k2 ) < 0; + } + }; + template struct hash { @@ -140,6 +157,17 @@ namespace set { } }; + template <> + struct hash + { + typedef size_t result_type; + typedef std::string argument_type; + + size_t operator()( std::string const& k ) const + { + return std::hash()(k); + } + }; // forward template diff --git a/test/stress/set/set_type_feldman_hashset.h b/test/stress/set/set_type_feldman_hashset.h index 03c06869..30e9d623 100644 --- a/test/stress/set/set_type_feldman_hashset.h +++ b/test/stress/set/set_type_feldman_hashset.h @@ -133,11 +133,11 @@ namespace set { hash_type hash; - /*explicit*/ key_val( key_type const& k ): base(k), hash( hasher()( k )) {} + explicit key_val( key_type const& k ): base(k), hash( hasher()( k )) {} key_val( key_type const& k, value_type const& v ): base(k, v), hash( hasher()( k )) {} template - /*explicit*/ key_val( K const& k ): base(k), hash( hasher()( k )) {} + explicit key_val( K const& k ): base(k), hash( hasher()( k )) {} template key_val( K const& k, T const& v ): base(k, v), hash( hasher()( k )) {} @@ -326,17 +326,40 @@ namespace set { } #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSSTRESS_FeldmanHashSet_SHRCU( fixture, test_case, key_type, value_type ) \ +# define CDSSTRESS_FeldmanHashSet_fixed_SHRCU( fixture, test_case, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_fixed, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_fixed, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_fixed_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_fixed_stat, key_type, value_type ) + +# define CDSSTRESS_FeldmanHashSet_stdhash_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_stdhash_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_stdhash_stat, key_type, value_type ) + +# if CDS_BUILD_BITS == 64 +# define CDSSTRESS_FeldmanHashSet_city_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_shb_city128_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_sht_city128_stat, key_type, value_type ) +# else +# define CDSSTRESS_FeldmanHashSet_city_SHRCU( fixture, test_case, key_type, value_type ) +# endif + #else -# define CDSSTRESS_FeldmanHashSet_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashSet_fixed_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashSet_stdhash_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashSet_city_SHRCU( fixture, test_case, key_type, value_type ) #endif -#define CDSSTRESS_FeldmanHashSet( fixture, test_case, key_type, value_type ) \ +#define CDSSTRESS_FeldmanHashSet_fixed( fixture, test_case, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_fixed, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_fixed, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_fixed, key_type, value_type ) \ @@ -347,6 +370,46 @@ namespace set { CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_fixed_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_fixed_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_fixed_stat, key_type, value_type ) \ - CDSSTRESS_FeldmanHashSet_SHRCU( fixture, test_case, key_type, value_type ) + CDSSTRESS_FeldmanHashSet_fixed_SHRCU( fixture, test_case, key_type, value_type ) + +#define CDSSTRESS_FeldmanHashSet_stdhash( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_stdhash, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_stdhash_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_stdhash_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_stdhash_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_stdhash_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_stdhash_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_stdhash_SHRCU( fixture, test_case, key_type, value_type ) + +#if CDS_BUILD_BITS == 64 +# define CDSSTRESS_FeldmanHashSet_city( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_city128, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_city128_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_city128_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpi_city128_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_city128_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_city128_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_city_SHRCU( fixture, test_case, key_type, value_type ) +#else +# define CDSSTRESS_FeldmanHashSet_city( fixture, test_case, key_type, value_type ) +#endif #endif // #ifndef CDSUNIT_SET_TYPE_FELDMAN_HASHSET_H diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 3efcf921..81fe9e1d 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -15,4 +15,3 @@ target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRA add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/map2) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/set2) diff --git a/tests/unit/map2/map_insdel_string.h b/tests/unit/map2/map_insdel_string.h index 8b2e1b3c..3163e210 100644 --- a/tests/unit/map2/map_insdel_string.h +++ b/tests/unit/map2/map_insdel_string.h @@ -291,7 +291,7 @@ namespace map2 { CDSUNIT_DECLARE_CuckooMap CDSUNIT_DECLARE_StdMap - CPPUNIT_TEST_SUITE(Map_InsDel_string) + CPPUNIT_TEST_SUITE_(Map_InsDel_string, "map_insdel_func") CDSUNIT_TEST_MichaelMap CDSUNIT_TEST_SplitList CDSUNIT_TEST_SkipListMap diff --git a/tests/unit/set2/CMakeLists.txt b/tests/unit/set2/CMakeLists.txt deleted file mode 100644 index 8a4a482a..00000000 --- a/tests/unit/set2/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(PACKAGE_NAME cdsu-set) - -set(CDSUNIT_SET_SOURCES - set_insdel_string.cpp - set_insdel_string_cuckoo.cpp - set_insdel_string_ellentree.cpp - set_insdel_string_michael.cpp - set_insdel_string_feldmanhashset.cpp - set_insdel_string_skip.cpp - set_insdel_string_split.cpp - set_insdel_string_striped.cpp - set_insdel_string_std.cpp -) - -add_executable(${PACKAGE_NAME} ${CDSUNIT_SET_SOURCES} $) -target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) -add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) \ No newline at end of file diff --git a/tests/unit/set2/set_defs.h b/tests/unit/set2/set_defs.h deleted file mode 100644 index a6054bb5..00000000 --- a/tests/unit/set2/set_defs.h +++ /dev/null @@ -1,850 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#define CDSUNIT_DECLARE_StdSet \ - TEST_CASE( tag_StdSet, StdSet_Spin) \ - TEST_CASE( tag_StdSet, StdSet_Mutex) \ - TEST_CASE( tag_StdSet, StdHashSet_Spin) - -#define CDSUNIT_TEST_StdSet \ - CPPUNIT_TEST(StdSet_Spin) \ - CPPUNIT_TEST(StdSet_Mutex) \ - CPPUNIT_TEST(StdHashSet_Spin) - -//******************************************************************** -// MichaelHashSet - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_MichaelSet_RCU_signal \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_SHB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_SHB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_SHT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_SHT_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_SHB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_SHB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_SHT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_SHT_less_michaelAlloc) - -# define CDSUNIT_TEST_MichaelSet_RCU_signal \ - CPPUNIT_TEST(MichaelSet_RCU_SHB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_SHB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_SHT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_SHT_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_SHB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_SHB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_SHT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_SHT_less_michaelAlloc) -#else -# define CDSUNIT_DECLARE_MichaelSet_RCU_signal -# define CDSUNIT_TEST_MichaelSet_RCU_signal -#endif - - -#define CDSUNIT_DECLARE_MichaelSet \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_HP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_HP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_DHP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_DHP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_GPI_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_GPI_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_GPB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_GPB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_GPT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_RCU_GPT_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_HP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_HP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_DHP_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_DHP_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_GPI_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_GPI_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_GPB_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_GPB_less_michaelAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_GPT_cmp_stdAlloc) \ - TEST_CASE(tag_MichaelHashSet, MichaelSet_Lazy_RCU_GPT_less_michaelAlloc) \ - CDSUNIT_DECLARE_MichaelSet_RCU_signal - -#define CDSUNIT_TEST_MichaelSet \ - CPPUNIT_TEST(MichaelSet_HP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_HP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_DHP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_DHP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_GPI_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_GPI_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_GPB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_GPB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_GPT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_RCU_GPT_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_HP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_HP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_DHP_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_DHP_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_GPI_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_GPI_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_GPB_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_GPB_less_michaelAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_GPT_cmp_stdAlloc) \ - CPPUNIT_TEST(MichaelSet_Lazy_RCU_GPT_less_michaelAlloc) \ - CDSUNIT_TEST_MichaelSet_RCU_signal - -//******************************************************************** -// SplitListSet - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_SplitList_RCU_signal \ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHB_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHB_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHB_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHB_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHB_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHT_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHT_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHT_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHT_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_SHT_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHB_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHB_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHB_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHB_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHB_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHT_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHT_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHT_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHT_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_SHT_st_less_stat) - -# define CDSUNIT_TEST_SplitList_RCU_signal \ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_SHT_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_SHT_st_less_stat) - -#else -# define CDSUNIT_DECLARE_SplitList_RCU_signal -# define CDSUNIT_TEST_SplitList_RCU_signal -#endif - -#define CDSUNIT_DECLARE_SplitList \ - TEST_CASE(tag_SplitListSet, SplitList_Michael_HP_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_HP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_HP_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_HP_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_HP_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_HP_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_DHP_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_DHP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_DHP_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_DHP_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_DHP_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_DHP_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPI_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPI_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPI_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPI_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPI_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPI_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPB_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPB_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPB_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPB_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPB_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPT_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPT_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPT_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPT_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Michael_RCU_GPT_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_HP_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_HP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_HP_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_HP_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_HP_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_HP_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_DHP_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_DHP_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_DHP_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_DHP_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_DHP_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_DHP_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPI_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPI_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPI_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPI_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPI_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPI_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPB_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPB_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPB_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPB_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPB_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPB_st_less_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPT_dyn_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPT_dyn_cmp_stat)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPT_st_cmp)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPT_dyn_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPT_st_less)\ - TEST_CASE(tag_SplitListSet, SplitList_Lazy_RCU_GPT_st_less_stat)\ - CDSUNIT_DECLARE_SplitList_RCU_signal - -#define CDSUNIT_TEST_SplitList \ - CPPUNIT_TEST(SplitList_Michael_HP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_HP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_HP_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_HP_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_HP_st_less)\ - CPPUNIT_TEST(SplitList_Michael_HP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_DHP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_DHP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_DHP_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_DHP_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_DHP_st_less)\ - CPPUNIT_TEST(SplitList_Michael_DHP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPI_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_st_cmp)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_dyn_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_st_less)\ - CPPUNIT_TEST(SplitList_Michael_RCU_GPT_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_HP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_HP_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_HP_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_HP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_DHP_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPI_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPB_st_less_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_dyn_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_dyn_cmp_stat)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_st_cmp)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_dyn_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_st_less)\ - CPPUNIT_TEST(SplitList_Lazy_RCU_GPT_st_less_stat)\ - CDSUNIT_TEST_SplitList_RCU_signal - -//******************************************************************** -// CuckooSet - -#define CDSUNIT_DECLARE_CuckooSet \ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_list_unord)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_list_unord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_list_ord)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_list_ord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_vector_unord)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_vector_ord)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_vector_unord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_vector_ord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_list_unord)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_list_ord)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_list_unord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_list_ord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_vector_unord)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_vector_unord_stat)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_vector_ord) \ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_vector_ord_stat) \ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_list_unord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_list_ord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_vector_unord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooStripedSet_vector_ord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_list_unord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_list_ord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_vector_unord_storehash)\ - TEST_CASE(tag_CuckooSet, CuckooRefinableSet_vector_ord_storehash) - -#define CDSUNIT_TEST_CuckooSet \ - CPPUNIT_TEST(CuckooStripedSet_list_unord)\ - CPPUNIT_TEST(CuckooStripedSet_list_unord_stat)\ - CPPUNIT_TEST(CuckooStripedSet_list_unord_storehash)\ - CPPUNIT_TEST(CuckooStripedSet_list_ord)\ - CPPUNIT_TEST(CuckooStripedSet_list_ord_stat)\ - CPPUNIT_TEST(CuckooStripedSet_list_ord_storehash)\ - CPPUNIT_TEST(CuckooStripedSet_vector_unord)\ - CPPUNIT_TEST(CuckooStripedSet_vector_unord_stat)\ - CPPUNIT_TEST(CuckooStripedSet_vector_unord_storehash)\ - CPPUNIT_TEST(CuckooStripedSet_vector_ord)\ - CPPUNIT_TEST(CuckooStripedSet_vector_ord_stat)\ - CPPUNIT_TEST(CuckooStripedSet_vector_ord_storehash)\ - CPPUNIT_TEST(CuckooRefinableSet_list_unord)\ - CPPUNIT_TEST(CuckooRefinableSet_list_unord_stat)\ - CPPUNIT_TEST(CuckooRefinableSet_list_unord_storehash)\ - CPPUNIT_TEST(CuckooRefinableSet_list_ord)\ - CPPUNIT_TEST(CuckooRefinableSet_list_ord_stat)\ - CPPUNIT_TEST(CuckooRefinableSet_list_ord_storehash)\ - CPPUNIT_TEST(CuckooRefinableSet_vector_unord)\ - CPPUNIT_TEST(CuckooRefinableSet_vector_unord_stat)\ - CPPUNIT_TEST(CuckooRefinableSet_vector_unord_storehash)\ - CPPUNIT_TEST(CuckooRefinableSet_vector_ord) \ - CPPUNIT_TEST(CuckooRefinableSet_vector_ord_stat) \ - CPPUNIT_TEST(CuckooRefinableSet_vector_ord_storehash) - -//******************************************************************** -// SkipListSet - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_SkipListSet_RCU_signal \ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_shb_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_shb_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_shb_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_shb_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_sht_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_sht_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_sht_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_sht_cmp_xorshift_stat) - -# define CDSUNIT_TEST_SkipListSet_RCU_signal \ - CPPUNIT_TEST(SkipListSet_rcu_shb_less_pascal)\ - CPPUNIT_TEST(SkipListSet_rcu_shb_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_shb_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_rcu_shb_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_sht_less_pascal)\ - CPPUNIT_TEST(SkipListSet_rcu_sht_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_sht_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_rcu_sht_cmp_xorshift_stat) - -#else -# define CDSUNIT_DECLARE_SkipListSet_RCU_signal -# define CDSUNIT_TEST_SkipListSet_RCU_signal -#endif - -#define CDSUNIT_DECLARE_SkipListSet \ - TEST_CASE(tag_SkipListSet, SkipListSet_hp_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_hp_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_hp_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_hp_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_dhp_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_dhp_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_dhp_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_dhp_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpi_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpi_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpi_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpi_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpb_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpb_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpb_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpb_cmp_xorshift_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpt_less_pascal)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpt_cmp_pascal_stat)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpt_less_xorshift)\ - TEST_CASE(tag_SkipListSet, SkipListSet_rcu_gpt_cmp_xorshift_stat)\ - CDSUNIT_DECLARE_SkipListSet_RCU_signal - -#define CDSUNIT_TEST_SkipListSet \ - CPPUNIT_TEST(SkipListSet_hp_less_pascal)\ - CPPUNIT_TEST(SkipListSet_hp_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_hp_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_hp_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListSet_dhp_less_pascal)\ - CPPUNIT_TEST(SkipListSet_dhp_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_dhp_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_dhp_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_gpi_less_pascal)\ - CPPUNIT_TEST(SkipListSet_rcu_gpi_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_gpi_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_rcu_gpi_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_gpb_less_pascal)\ - CPPUNIT_TEST(SkipListSet_rcu_gpb_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_gpb_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_rcu_gpb_cmp_xorshift_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_gpt_less_pascal)\ - CPPUNIT_TEST(SkipListSet_rcu_gpt_cmp_pascal_stat)\ - CPPUNIT_TEST(SkipListSet_rcu_gpt_less_xorshift)\ - CPPUNIT_TEST(SkipListSet_rcu_gpt_cmp_xorshift_stat)\ - CDSUNIT_TEST_SkipListSet_RCU_signal - -//******************************************************************** -// EllenBinTreeSet - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_EllenBinTreeSet_RCU_signal \ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_shb)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_shb_stat)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_sht)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_sht_stat) - -# define CDSUNIT_TEST_EllenBinTreeSet_RCU_signal \ - CPPUNIT_TEST(EllenBinTreeSet_rcu_shb)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_shb_stat)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_sht)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_sht_stat) -#else -# define CDSUNIT_DECLARE_EllenBinTreeSet_RCU_signal -# define CDSUNIT_TEST_EllenBinTreeSet_RCU_signal -#endif - -#define CDSUNIT_DECLARE_EllenBinTreeSet \ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_hp)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_yield_hp)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_hp_stat)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_dhp)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_yield_dhp)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_dhp_stat)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_gpi)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_gpi_stat)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_gpb)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_yield_rcu_gpb)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_gpb_stat)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_gpt)\ - TEST_CASE(tag_EllenBinTreeSet, EllenBinTreeSet_rcu_gpt_stat)\ - CDSUNIT_DECLARE_EllenBinTreeSet_RCU_signal - -#define CDSUNIT_TEST_EllenBinTreeSet \ - CPPUNIT_TEST(EllenBinTreeSet_hp)\ - CPPUNIT_TEST(EllenBinTreeSet_yield_hp)\ - CPPUNIT_TEST(EllenBinTreeSet_hp_stat)\ - CPPUNIT_TEST(EllenBinTreeSet_dhp)\ - CPPUNIT_TEST(EllenBinTreeSet_yield_dhp)\ - CPPUNIT_TEST(EllenBinTreeSet_dhp_stat)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_gpi)\ - /*CPPUNIT_TEST(EllenBinTreeSet_rcu_gpi_stat)*/\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_gpb)\ - CPPUNIT_TEST(EllenBinTreeSet_yield_rcu_gpb)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_gpb_stat)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_gpt)\ - CPPUNIT_TEST(EllenBinTreeSet_rcu_gpt_stat)\ - CDSUNIT_TEST_EllenBinTreeSet_RCU_signal - -//******************************************************************** -// StripedSet - -#define CDSUNIT_DECLARE_StripedSet_common \ - TEST_CASE( tag_StripedSet, StripedSet_list) \ - TEST_CASE( tag_StripedSet, StripedSet_vector) \ - TEST_CASE( tag_StripedSet, StripedSet_set) \ - TEST_CASE( tag_StripedSet, StripedSet_hashset) \ - TEST_CASE( tag_StripedSet, StripedSet_boost_unordered_set) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_list) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_vector) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_set) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_hashset) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_unordered_set) - -#define CDSUNIT_TEST_StripedSet_common \ - CPPUNIT_TEST(StripedSet_list) \ - CPPUNIT_TEST(StripedSet_vector) \ - CPPUNIT_TEST(StripedSet_set) \ - CPPUNIT_TEST(StripedSet_hashset) \ - CPPUNIT_TEST(StripedSet_boost_unordered_set) \ - CPPUNIT_TEST(StripedSet_rational_list) \ - CPPUNIT_TEST(StripedSet_rational_vector) \ - CPPUNIT_TEST(StripedSet_rational_set) \ - CPPUNIT_TEST(StripedSet_rational_hashset) \ - CPPUNIT_TEST(StripedSet_rational_boost_unordered_set) - -#if BOOST_VERSION >= 104800 -# define CDSUNIT_DECLARE_StripedSet_boost_container \ - TEST_CASE( tag_StripedSet, StripedSet_boost_list) \ - TEST_CASE( tag_StripedSet, StripedSet_boost_slist) \ - TEST_CASE( tag_StripedSet, StripedSet_boost_vector) \ - TEST_CASE( tag_StripedSet, StripedSet_boost_stable_vector) \ - TEST_CASE( tag_StripedSet, StripedSet_boost_set) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_list) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_slist) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_vector) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_stable_vector) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_set) - -# define CDSUNIT_TEST_StripedSet_boost_container \ - CPPUNIT_TEST(StripedSet_boost_list) \ - CPPUNIT_TEST(StripedSet_boost_slist) \ - CPPUNIT_TEST(StripedSet_boost_vector) \ - CPPUNIT_TEST(StripedSet_boost_stable_vector) \ - CPPUNIT_TEST(StripedSet_boost_set) \ - CPPUNIT_TEST(StripedSet_rational_boost_list) \ - CPPUNIT_TEST(StripedSet_rational_boost_slist) \ - CPPUNIT_TEST(StripedSet_rational_boost_vector) \ - CPPUNIT_TEST(StripedSet_rational_boost_stable_vector) \ - CPPUNIT_TEST(StripedSet_rational_boost_set) -#else -# define CDSUNIT_DECLARE_StripedSet_boost_container -# define CDSUNIT_TEST_StripedSet_boost_container -#endif - -#if BOOST_VERSION >= 104800 && defined(CDS_UNIT_SET_TYPES_ENABLE_BOOST_FLAT_CONTAINERS) -# define CDSUNIT_DECLARE_StripedSet_boost_flat_container \ - TEST_CASE( tag_StripedSet, StripedSet_boost_flat_set) \ - TEST_CASE( tag_StripedSet, StripedSet_rational_boost_flat_set) - -# define CDSUNIT_TEST_StripedSet_boost_flat_container \ - CPPUNIT_TEST(StripedSet_boost_flat_set) \ - CPPUNIT_TEST(StripedSet_rational_boost_flat_set) -#else -# define CDSUNIT_DECLARE_StripedSet_boost_flat_container -# define CDSUNIT_TEST_StripedSet_boost_flat_container -#endif - -#define CDSUNIT_DECLARE_StripedSet \ - CDSUNIT_DECLARE_StripedSet_common \ - CDSUNIT_DECLARE_StripedSet_boost_container \ - CDSUNIT_DECLARE_StripedSet_boost_flat_container - -#define CDSUNIT_TEST_StripedSet \ - CDSUNIT_TEST_StripedSet_common \ - CDSUNIT_TEST_StripedSet_boost_container \ - CDSUNIT_TEST_StripedSet_boost_flat_container - - -#define CDSUNIT_DECLARE_RefinableSet_common \ - TEST_CASE( tag_StripedSet, RefinableSet_list) \ - TEST_CASE( tag_StripedSet, RefinableSet_vector) \ - TEST_CASE( tag_StripedSet, RefinableSet_set) \ - TEST_CASE( tag_StripedSet, RefinableSet_hashset) \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_unordered_set) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_list) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_vector) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_set) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_hashset) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_unordered_set) - - -//******************************************************************** -// RefinableSet - -#define CDSUNIT_TEST_RefinableSet_common \ - CPPUNIT_TEST(RefinableSet_list) \ - CPPUNIT_TEST(RefinableSet_vector) \ - CPPUNIT_TEST(RefinableSet_set) \ - CPPUNIT_TEST(RefinableSet_hashset) \ - CPPUNIT_TEST(RefinableSet_boost_unordered_set) \ - CPPUNIT_TEST(RefinableSet_rational_list) \ - CPPUNIT_TEST(RefinableSet_rational_vector) \ - CPPUNIT_TEST(RefinableSet_rational_set) \ - CPPUNIT_TEST(RefinableSet_rational_hashset) \ - CPPUNIT_TEST(RefinableSet_rational_boost_unordered_set) - -#if BOOST_VERSION >= 104800 -# define CDSUNIT_DECLARE_RefinableSet_boost_container \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_list) \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_slist) \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_vector) \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_stable_vector) \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_set) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_list) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_slist) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_vector) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_stable_vector) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_set) - -# define CDSUNIT_TEST_RefinableSet_boost_container \ - CPPUNIT_TEST(RefinableSet_boost_list) \ - CPPUNIT_TEST(RefinableSet_boost_slist) \ - CPPUNIT_TEST(RefinableSet_boost_vector) \ - CPPUNIT_TEST(RefinableSet_boost_stable_vector) \ - CPPUNIT_TEST(RefinableSet_boost_set) \ - CPPUNIT_TEST(RefinableSet_rational_boost_list) \ - CPPUNIT_TEST(RefinableSet_rational_boost_slist) \ - CPPUNIT_TEST(RefinableSet_rational_boost_vector) \ - CPPUNIT_TEST(RefinableSet_rational_boost_stable_vector) \ - CPPUNIT_TEST(RefinableSet_rational_boost_set) -#else -# define CDSUNIT_DECLARE_RefinableSet_boost_container -# define CDSUNIT_TEST_RefinableSet_boost_container -#endif - -#if BOOST_VERSION >= 104800 && defined(CDS_UNIT_SET_TYPES_ENABLE_BOOST_FLAT_CONTAINERS) -# define CDSUNIT_DECLARE_RefinableSet_boost_flat_container \ - TEST_CASE( tag_StripedSet, RefinableSet_boost_flat_set) \ - TEST_CASE( tag_StripedSet, RefinableSet_rational_boost_flat_set) - -# define CDSUNIT_TEST_RefinableSet_boost_flat_container \ - CPPUNIT_TEST(RefinableSet_boost_flat_set) \ - CPPUNIT_TEST(RefinableSet_rational_boost_flat_set) -#else -# define CDSUNIT_DECLARE_RefinableSet_boost_flat_container -# define CDSUNIT_TEST_RefinableSet_boost_flat_container -#endif - -#define CDSUNIT_DECLARE_RefinableSet \ - CDSUNIT_DECLARE_RefinableSet_common \ - CDSUNIT_DECLARE_RefinableSet_boost_container \ - CDSUNIT_DECLARE_RefinableSet_boost_flat_container - -#define CDSUNIT_TEST_RefinableSet \ - CDSUNIT_TEST_RefinableSet_common \ - CDSUNIT_TEST_RefinableSet_boost_container \ - CDSUNIT_TEST_RefinableSet_boost_flat_container - - -//*********************************************** -// FeldmanHashSet - -// For fixed-sized key - no hash function is needed - -#undef CDSUNIT_DECLARE_FeldmanHashSet_fixed -#undef CDSUNIT_DECLARE_FeldmanHashSet_fixed_RCU_signal -#undef CDSUNIT_TEST_FeldmanHashSet_fixed -#undef CDSUNIT_TEST_FeldmanHashSet_fixed_RCU_signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashSet_fixed_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_fixed_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_fixed_stat) \ - -# define CDSUNIT_TEST_FeldmanHashSet_fixed_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_fixed_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_fixed_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashSet_fixed_RCU_signal -# define CDSUNIT_TEST_FeldmanHashSet_fixed_RCU_signal -#endif - -#define CDSUNIT_DECLARE_FeldmanHashSet_fixed \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_fixed_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_fixed_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_fixed_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_fixed_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_fixed) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_fixed_stat) \ - CDSUNIT_DECLARE_FeldmanHashSet_fixed_RCU_signal - -#define CDSUNIT_TEST_FeldmanHashSet_fixed \ - CPPUNIT_TEST(FeldmanHashSet_hp_fixed) \ - CPPUNIT_TEST(FeldmanHashSet_hp_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_fixed) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_fixed) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_fixed) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_fixed_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_fixed) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_fixed_stat) \ - CDSUNIT_TEST_FeldmanHashSet_fixed_RCU_signal - -// std::hash -#undef CDSUNIT_DECLARE_FeldmanHashSet_stdhash -#undef CDSUNIT_DECLARE_FeldmanHashSet_stdhash_RCU_signal -#undef CDSUNIT_TEST_FeldmanHashSet_stdhash -#undef CDSUNIT_TEST_FeldmanHashSet_stdhash_RCU_signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashSet_stdhash_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_stdhash_stat) \ - -# define CDSUNIT_TEST_FeldmanHashSet_stdhash_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_stdhash_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashSet_stdhash_RCU_signal -# define CDSUNIT_TEST_FeldmanHashSet_stdhash_RCU_signal -#endif - -#define CDSUNIT_DECLARE_FeldmanHashSet_stdhash \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_stdhash_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_stdhash) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_stdhash_stat) \ - CDSUNIT_DECLARE_FeldmanHashSet_stdhash_RCU_signal - -#define CDSUNIT_TEST_FeldmanHashSet_stdhash \ - CPPUNIT_TEST(FeldmanHashSet_hp_stdhash) \ - CPPUNIT_TEST(FeldmanHashSet_hp_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_stdhash) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_stdhash) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_stdhash) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_stdhash_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_stdhash) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_stdhash_stat) \ - CDSUNIT_TEST_FeldmanHashSet_stdhash_RCU_signal - - -// CityHash -only for 64bit - -#undef CDSUNIT_DECLARE_FeldmanHashSet_city -#undef CDSUNIT_DECLARE_FeldmanHashSet_city_RCU_signal -#undef CDSUNIT_TEST_FeldmanHashSet_city -#undef CDSUNIT_TEST_FeldmanHashSet_city_RCU_signal - -#if CDS_BUILD_BITS == 64 - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashSet_city_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city128_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city128_stat) \ - -# define CDSUNIT_TEST_FeldmanHashSet_city_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_city128_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_city128_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashSet_city_RCU_signal -# define CDSUNIT_TEST_FeldmanHashSet_city_RCU_signal -#endif - -#define CDSUNIT_DECLARE_FeldmanHashSet_city \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_city64) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_city64_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_city128_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_city128_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_city128_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_city128_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_city128) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_city128_stat) \ - CDSUNIT_DECLARE_FeldmanHashSet_city_RCU_signal - -#define CDSUNIT_TEST_FeldmanHashSet_city \ - CPPUNIT_TEST(FeldmanHashSet_hp_city64) \ - CPPUNIT_TEST(FeldmanHashSet_hp_city64_stat) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_city64) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_city64_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_city64) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_city64_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_city64) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_city64_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_city64) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_city64_stat) \ - CPPUNIT_TEST(FeldmanHashSet_hp_city128) \ - CPPUNIT_TEST(FeldmanHashSet_hp_city128_stat) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_city128) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_city128_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_city128) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_city128_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_city128) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_city128_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_city128) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_city128_stat) \ - CDSUNIT_TEST_FeldmanHashSet_city_RCU_signal - -#else -# define CDSUNIT_DECLARE_FeldmanHashSet_city -# define CDSUNIT_DECLARE_FeldmanHashSet_city_RCU_signal -# define CDSUNIT_TEST_FeldmanHashSet_city -# define CDSUNIT_TEST_FeldmanHashSet_city_RCU_signal -#endif // CDS_BUILD_BITS == 64 - - -// All - -#define CDSUNIT_DECLARE_FeldmanHashSet \ - CDSUNIT_DECLARE_FeldmanHashSet_fixed \ - CDSUNIT_DECLARE_FeldmanHashSet_stdhash \ - CDSUNIT_DECLARE_FeldmanHashSet_city - -#define CDSUNIT_TEST_FeldmanHashSet \ - CDSUNIT_TEST_FeldmanHashSet_fixed \ - CDSUNIT_TEST_FeldmanHashSet_stdhash \ - CDSUNIT_TEST_FeldmanHashSet_city diff --git a/tests/unit/set2/set_delodd.cpp b/tests/unit/set2/set_delodd.cpp deleted file mode 100644 index 77f57b54..00000000 --- a/tests/unit/set2/set_delodd.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" - -namespace set2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Set_DelOdd ); - - void Set_DelOdd::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nSetSize = cfg.getSizeT("MapSize", c_nSetSize ); - c_nInsThreadCount = cfg.getSizeT("InsThreadCount", c_nInsThreadCount); - c_nDelThreadCount = cfg.getSizeT("DelThreadCount", c_nDelThreadCount); - c_nExtractThreadCount = cfg.getSizeT("ExtractThreadCount", c_nExtractThreadCount); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize ); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize ); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold ); - - c_nFeldmanSet_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanSet_HeadBits); - c_nFeldmanSet_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanSet_ArrayBits); - - if ( c_nInsThreadCount == 0 ) - c_nInsThreadCount = std::thread::hardware_concurrency(); - if ( c_nDelThreadCount == 0 && c_nExtractThreadCount == 0 ) { - c_nExtractThreadCount = std::thread::hardware_concurrency() / 2; - c_nDelThreadCount = std::thread::hardware_concurrency() - c_nExtractThreadCount; - } - - m_arrData.resize( c_nSetSize ); - for ( size_t i = 0; i < c_nSetSize; ++i ) - m_arrData[i] = i; - shuffle( m_arrData.begin(), m_arrData.end() ); - } - - void Set_DelOdd::endTestCase() - { - m_arrData.resize( 0 ); - } - -} // namespace set2 diff --git a/tests/unit/set2/set_delodd.h b/tests/unit/set2/set_delodd.h deleted file mode 100644 index 086c4bfd..00000000 --- a/tests/unit/set2/set_delodd.h +++ /dev/null @@ -1,842 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "cppunit/thread.h" -#include "set2/set_type.h" - -namespace set2 { - -#define TEST_CASE(TAG, X) void X(); - - namespace { - struct key_thread - { - uint32_t nKey; - uint16_t nThread; - uint16_t pad_; - - key_thread( size_t key, size_t threadNo ) - : nKey( static_cast(key)) - , nThread( static_cast(threadNo)) - , pad_(0) - {} - - key_thread() - {} - }; - - typedef set_type_base::key_val key_value_pair; - } - - template <> - struct cmp { - int operator ()(key_thread const& k1, key_thread const& k2) const - { - if ( k1.nKey < k2.nKey ) - return -1; - if ( k1.nKey > k2.nKey ) - return 1; - if ( k1.nThread < k2.nThread ) - return -1; - if ( k1.nThread > k2.nThread ) - return 1; - return 0; - } - int operator ()(key_thread const& k1, size_t k2) const - { - if ( k1.nKey < k2 ) - return -1; - if ( k1.nKey > k2 ) - return 1; - return 0; - } - int operator ()(size_t k1, key_thread const& k2) const - { - if ( k1 < k2.nKey ) - return -1; - if ( k1 > k2.nKey ) - return 1; - return 0; - } - }; - -} // namespace set2 - -namespace std { - template <> - struct less - { - bool operator()(set2::key_thread const& k1, set2::key_thread const& k2) const - { - if ( k1.nKey <= k2.nKey ) - return k1.nKey < k2.nKey || k1.nThread < k2.nThread; - return false; - } - }; - - template <> - struct hash - { - typedef size_t result_type; - typedef set2::key_thread argument_type; - - size_t operator()( set2::key_thread const& k ) const - { - return std::hash()(k.nKey); - } - size_t operator()( size_t k ) const - { - return std::hash()(k); - } - }; - -} // namespace std - -namespace boost { - inline size_t hash_value( set2::key_thread const& k ) - { - return std::hash()( k.nKey ); - } - - template <> - struct hash - { - typedef size_t result_type; - typedef set2::key_thread argument_type; - - size_t operator()(set2::key_thread const& k) const - { - return boost::hash()( k.nKey ); - } - size_t operator()(size_t k) const - { - return boost::hash()( k ); - } - }; -} // namespace boost - -namespace set2 { - - class Set_DelOdd: public CppUnitMini::TestCase - { - public: - size_t c_nSetSize =1000000; // max set size - size_t c_nInsThreadCount = 4; // insert thread count - size_t c_nDelThreadCount = 4; // delete thread count - size_t c_nExtractThreadCount = 4; // extract thread count - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooSet - size_t c_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) - - size_t c_nFeldmanSet_HeadBits = 10; - size_t c_nFeldmanSet_ArrayBits = 4; - - size_t c_nLoadFactor = 2; - std::vector m_arrData; - - protected: - typedef key_thread key_type; - typedef size_t value_type; - - atomics::atomic m_nInsThreadCount; - - // Inserts keys from [0..N) - template - class InsertThread: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual InsertThread * clone() - { - return new InsertThread( *this ); - } - - struct update_functor - { - template - void operator()( bool /*bNew*/, key_value_pair const&, Q const& ) - {} - - void operator()(key_value_pair& /*cur*/, key_value_pair * /*prev*/) - {} - }; - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - InsertThread( CppUnitMini::ThreadPool& pool, Set& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Set( rMap ) - {} - InsertThread( InsertThread& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nInsertSuccess = - m_nInsertFailed = 0; - - std::vector& arrData = getTest().m_arrData; - for ( size_t i = 0; i < arrData.size(); ++i ) { - if ( rSet.insert( key_type( arrData[i], m_nThreadNo ))) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - - update_functor f; - for ( size_t i = arrData.size() - 1; i > 0; --i ) { - if ( arrData[i] & 1 ) { - rSet.update( key_type( arrData[i], m_nThreadNo ), f, true ); - } - } - - getTest().m_nInsThreadCount.fetch_sub( 1, atomics::memory_order_release ); - } - }; - - struct key_equal { - bool operator()( key_type const& k1, key_type const& k2 ) const - { - return k1.nKey == k2.nKey; - } - bool operator()( size_t k1, key_type const& k2 ) const - { - return k1 == k2.nKey; - } - bool operator()( key_type const& k1, size_t k2 ) const - { - return k1.nKey == k2; - } - bool operator ()( key_value_pair const& k1, key_value_pair const& k2 ) const - { - return operator()( k1.key, k2.key ); - } - bool operator ()( key_value_pair const& k1, key_type const& k2 ) const - { - return operator()( k1.key, k2 ); - } - bool operator ()( key_type const& k1, key_value_pair const& k2 ) const - { - return operator()( k1, k2.key ); - } - bool operator ()( key_value_pair const& k1, size_t k2 ) const - { - return operator()( k1.key, k2 ); - } - bool operator ()( size_t k1, key_value_pair const& k2 ) const - { - return operator()( k1, k2.key ); - } - }; - - struct key_less { - bool operator()( key_type const& k1, key_type const& k2 ) const - { - return k1.nKey < k2.nKey; - } - bool operator()( size_t k1, key_type const& k2 ) const - { - return k1 < k2.nKey; - } - bool operator()( key_type const& k1, size_t k2 ) const - { - return k1.nKey < k2; - } - bool operator ()( key_value_pair const& k1, key_value_pair const& k2 ) const - { - return operator()( k1.key, k2.key ); - } - bool operator ()( key_value_pair const& k1, key_type const& k2 ) const - { - return operator()( k1.key, k2 ); - } - bool operator ()( key_type const& k1, key_value_pair const& k2 ) const - { - return operator()( k1, k2.key ); - } - bool operator ()( key_value_pair const& k1, size_t k2 ) const - { - return operator()( k1.key, k2 ); - } - bool operator ()( size_t k1, key_value_pair const& k2 ) const - { - return operator()( k1, k2.key ); - } - - typedef key_equal equal_to; - }; - - // Deletes odd keys from [0..N) - template - class DeleteThread: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual DeleteThread * clone() - { - return new DeleteThread( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - DeleteThread( CppUnitMini::ThreadPool& pool, Set& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Set( rMap ) - {} - DeleteThread( DeleteThread& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - template - struct eraser { - static bool erase( SetType& s, size_t key, size_t /*thread*/) - { - return s.erase_with( key, key_less() ); - } - }; - - template - struct eraser { - static bool erase(SetType& s, size_t key, size_t thread) - { - return s.erase( key_type(key, thread)); - } - }; - - virtual void test() - { - Set& rSet = m_Set; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - size_t const nInsThreadCount = getTest().c_nInsThreadCount; - std::vector& arrData = getTest().m_arrData; - - if ( m_nThreadNo & 1 ) { - for (size_t i = 0; i < arrData.size(); ++i) { - if (arrData[i] & 1) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - if ( eraser::erase( rSet, arrData[i], k )) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - else { - for (size_t i = arrData.size() - 1; i > 0; --i) { - if (arrData[i] & 1) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - if (eraser::erase(rSet, arrData[i], k)) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - } - }; - - // Extracts odd keys from [0..N) - template - class ExtractThread: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual ExtractThread * clone() - { - return new ExtractThread( *this ); - } - public: - size_t m_nExtractSuccess; - size_t m_nExtractFailed; - - public: - ExtractThread( CppUnitMini::ThreadPool& pool, Set& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Set( rMap ) - {} - ExtractThread( ExtractThread& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - template - struct extractor { - static typename SetType::guarded_ptr extract(SetType& s, size_t key, size_t /*thread*/) - { - return s.extract_with( key, key_less()); - } - }; - - template - struct extractor { - static typename SetType::guarded_ptr extract(SetType& s, size_t key, size_t thread) - { - return s.extract( key_type(key, thread)); - } - }; - - virtual void test() - { - Set& rSet = m_Set; - - m_nExtractSuccess = - m_nExtractFailed = 0; - - typename Set::guarded_ptr gp; - - std::vector& arrData = getTest().m_arrData; - size_t const nInsThreadCount = getTest().c_nInsThreadCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t i = 0; i < arrData.size(); ++i ) { - if (arrData[i] & 1) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - gp = extractor::extract( rSet, arrData[i], k ); - if ( gp ) - ++m_nExtractSuccess; - else - ++m_nExtractFailed; - gp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - else { - for (size_t i = arrData.size() - 1; i > 0; --i) { - if (arrData[i] & 1) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - gp = extractor::extract( rSet, arrData[i], k); - if ( gp ) - ++m_nExtractSuccess; - else - ++m_nExtractFailed; - gp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - } - }; - - template - class ExtractThread< cds::urcu::gc, Set >: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual ExtractThread * clone() - { - return new ExtractThread( *this ); - } - public: - size_t m_nExtractSuccess; - size_t m_nExtractFailed; - - public: - ExtractThread( CppUnitMini::ThreadPool& pool, Set& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Set( rMap ) - {} - ExtractThread( ExtractThread& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_DelOdd& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - template - struct extractor { - static typename SetType::exempt_ptr extract(SetType& s, size_t key, size_t /*thread*/) - { - return s.extract_with(key, key_less()); - } - }; - - template - struct extractor { - static typename SetType::exempt_ptr extract(SetType& s, size_t key, size_t thread) - { - return s.extract(key_type(key, thread)); - } - }; - - virtual void test() - { - Set& rSet = m_Set; - - m_nExtractSuccess = - m_nExtractFailed = 0; - - typename Set::exempt_ptr xp; - - std::vector& arrData = getTest().m_arrData; - size_t const nInsThreadCount = getTest().c_nInsThreadCount; - - if ( m_nThreadNo & 1 ) { - for (size_t i = 0; i < arrData.size(); ++i) { - if (arrData[i] & 1) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - if ( Set::c_bExtractLockExternal ) { - typename Set::rcu_lock l; - xp = extractor::extract( rSet, arrData[i], k); - if ( xp ) - ++m_nExtractSuccess; - else - ++m_nExtractFailed; - } - else { - xp = extractor::extract(rSet, arrData[i], k); - if ( xp ) - ++m_nExtractSuccess; - else - ++m_nExtractFailed; - } - xp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - else { - for (size_t i = arrData.size() - 1; i > 0; --i) { - if (arrData[i] & 1) { - for ( size_t k = 0; k < nInsThreadCount; ++k ) { - if ( Set::c_bExtractLockExternal ) { - typename Set::rcu_lock l; - xp = extractor::extract(rSet, arrData[i], k); - if ( xp ) - ++m_nExtractSuccess; - else - ++m_nExtractFailed; - } - else { - xp = extractor::extract(rSet, arrData[i], k); - if ( xp ) - ++m_nExtractSuccess; - else - ++m_nExtractFailed; - } - xp.release(); - } - } - if ( getTest().m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 ) - break; - } - } - } - }; - - protected: - template - void do_test( size_t nLoadFactor ) - { - Set testSet( c_nSetSize, nLoadFactor ); - do_test_with( testSet ); - analyze( testSet ); - } - - template - void do_test_extract( size_t nLoadFactor ) - { - Set testSet( c_nSetSize, nLoadFactor ); - do_test_extract_with( testSet ); - analyze( testSet ); - } - - template - void do_test_with( Set& testSet ) - { - typedef InsertThread insert_thread; - typedef DeleteThread delete_thread; - - m_nInsThreadCount.store( c_nInsThreadCount, atomics::memory_order_release ); - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new insert_thread( pool, testSet ), c_nInsThreadCount ); - pool.add( new delete_thread( pool, testSet ), c_nDelThreadCount ? c_nDelThreadCount : cds::OS::topology::processor_count()); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - insert_thread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - delete_thread * p = static_cast( *it ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - - CPPUNIT_CHECK( nInsertSuccess == c_nSetSize * c_nInsThreadCount ); - CPPUNIT_CHECK( nInsertFailed == 0 ); - - CPPUNIT_MSG( " Totals (success/failed): \n\t" - << " Insert=" << nInsertSuccess << '/' << nInsertFailed << "\n\t" - << " Delete=" << nDeleteSuccess << '/' << nDeleteFailed << "\n\t" - ); - } - - template - void do_test_extract_with( Set& testSet ) - { - typedef InsertThread insert_thread; - typedef DeleteThread delete_thread; - typedef ExtractThread< typename Set::gc, Set > extract_thread; - - m_nInsThreadCount.store( c_nInsThreadCount, atomics::memory_order_release ); - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new insert_thread( pool, testSet ), c_nInsThreadCount ); - if ( c_nDelThreadCount ) - pool.add( new delete_thread( pool, testSet ), c_nDelThreadCount ); - if ( c_nExtractThreadCount ) - pool.add( new extract_thread( pool, testSet ), c_nExtractThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nExtractSuccess = 0; - size_t nExtractFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - insert_thread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - delete_thread * p = dynamic_cast( *it ); - if ( p ) { - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - else { - extract_thread * pExt = dynamic_cast( *it ); - assert( pExt ); - nExtractSuccess += pExt->m_nExtractSuccess; - nExtractFailed += pExt->m_nExtractFailed; - } - } - } - - CPPUNIT_CHECK( nInsertSuccess == c_nSetSize * c_nInsThreadCount ); - CPPUNIT_CHECK( nInsertFailed == 0 ); - - CPPUNIT_MSG( " Totals (success/failed): \n\t" - << " Insert=" << nInsertSuccess << '/' << nInsertFailed << "\n\t" - << " Delete=" << nDeleteSuccess << '/' << nDeleteFailed << "\n\t" - << " Extract=" << nExtractSuccess << '/' << nExtractFailed << "\n\t" - ); - } - - template - void analyze( Set& testSet ) - { - // All even keys must be in the set - { - CPPUNIT_MSG( " Check even keys..." ); - size_t nErrorCount = 0; - for ( size_t n = 0; n < c_nSetSize; n +=2 ) { - for ( size_t i = 0; i < c_nInsThreadCount; ++i ) { - if ( !testSet.contains( key_type(n, i) ) ) { - if ( ++nErrorCount < 10 ) { - CPPUNIT_MSG( "key " << n << "-" << i << " is not found!"); - } - } - } - } - CPPUNIT_CHECK_EX( nErrorCount == 0, "Totals: " << nErrorCount << " keys is not found"); - } - - check_before_clear( testSet ); - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - cds::OS::Timer timer; - testSet.clear(); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_CHECK_EX( testSet.empty(), ((long long) testSet.size()) ); - - additional_check( testSet ); - print_stat( testSet ); - additional_cleanup( testSet ); - } - - template - void run_test() - { - static_assert( !Set::c_bExtractSupported, "Set class must not support extract() method" ); - - CPPUNIT_MSG( "Insert thread count=" << c_nInsThreadCount - << " delete thread count=" << c_nDelThreadCount - << " set size=" << c_nSetSize - ); - - if ( Set::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - - Set testSet( *this ); - do_test_with( testSet ); - analyze( testSet ); - - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Set testSet( *this ); - do_test_with( testSet ); - analyze( testSet ); - - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - template - void run_test_extract() - { - static_assert( Set::c_bExtractSupported, "Set class must support extract() method" ); - - CPPUNIT_MSG( "Insert thread count=" << c_nInsThreadCount - << " delete thread count=" << c_nDelThreadCount - << " extract thread count=" << c_nExtractThreadCount - << " set size=" << c_nSetSize - ); - - if ( Set::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG( "Load factor=" << c_nLoadFactor ); - - Set testSet( *this ); - do_test_extract_with( testSet ); - analyze( testSet ); - - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Set testSet( *this ); - do_test_extract_with( testSet ); - analyze( testSet ); - - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - virtual void endTestCase(); - -# include "set2/set_defs.h" - CDSUNIT_DECLARE_MichaelSet - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_SkipListSet - CDSUNIT_DECLARE_EllenBinTreeSet - CDSUNIT_DECLARE_CuckooSet - CDSUNIT_DECLARE_FeldmanHashSet_fixed - CDSUNIT_DECLARE_FeldmanHashSet_city - - CPPUNIT_TEST_SUITE_(Set_DelOdd, "Map_DelOdd") - CDSUNIT_TEST_MichaelSet - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListSet - CDSUNIT_TEST_EllenBinTreeSet - CDSUNIT_TEST_FeldmanHashSet_fixed - CDSUNIT_TEST_FeldmanHashSet_city - CDSUNIT_TEST_CuckooSet - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace set2 diff --git a/tests/unit/set2/set_delodd_cuckoo.cpp b/tests/unit/set2/set_delodd_cuckoo.cpp deleted file mode 100644 index b46c4b24..00000000 --- a/tests/unit/set2/set_delodd_cuckoo.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" -#include "set2/set_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_DelOdd::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_CuckooSet -} // namespace set2 diff --git a/tests/unit/set2/set_delodd_ellentree.cpp b/tests/unit/set2/set_delodd_ellentree.cpp deleted file mode 100644 index b9affdee..00000000 --- a/tests/unit/set2/set_delodd_ellentree.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" -#include "set2/set_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_DelOdd::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_EllenBinTreeSet -} // namespace set2 diff --git a/tests/unit/set2/set_delodd_feldmanhashset.cpp b/tests/unit/set2/set_delodd_feldmanhashset.cpp deleted file mode 100644 index 6cfa9e98..00000000 --- a/tests/unit/set2/set_delodd_feldmanhashset.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" -#include "set2/set_type_feldman_hashset.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_DelOdd::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_FeldmanHashSet_fixed - CDSUNIT_DECLARE_FeldmanHashSet_city -} // namespace set2 diff --git a/tests/unit/set2/set_delodd_michael.cpp b/tests/unit/set2/set_delodd_michael.cpp deleted file mode 100644 index 85e09ba3..00000000 --- a/tests/unit/set2/set_delodd_michael.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" -#include "set2/set_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_DelOdd::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_MichaelSet -} // namespace set2 diff --git a/tests/unit/set2/set_delodd_skip.cpp b/tests/unit/set2/set_delodd_skip.cpp deleted file mode 100644 index 3a21fd70..00000000 --- a/tests/unit/set2/set_delodd_skip.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" -#include "set2/set_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_DelOdd::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_SkipListSet -} // namespace set2 diff --git a/tests/unit/set2/set_delodd_split.cpp b/tests/unit/set2/set_delodd_split.cpp deleted file mode 100644 index c3ef2b4d..00000000 --- a/tests/unit/set2/set_delodd_split.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_delodd.h" -#include "set2/set_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_DelOdd::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_SplitList -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func.cpp b/tests/unit/set2/set_insdel_func.cpp deleted file mode 100644 index ffd5d171..00000000 --- a/tests/unit/set2/set_insdel_func.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" - -namespace set2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Set_InsDel_func ); - - void Set_InsDel_func::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nSetSize = cfg.getSizeT("MapSize", c_nSetSize ); - c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount ); - c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount ); - c_nUpdateThreadCount = cfg.getSizeT("UpdateThreadCount", c_nUpdateThreadCount ); - c_nThreadPassCount = cfg.getSizeT("ThreadPassCount", c_nThreadPassCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize ); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize ); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold ); - - c_nFeldmanSet_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanSet_HeadBits); - c_nFeldmanSet_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanSet_ArrayBits); - - if ( c_nInsertThreadCount == 0 ) - c_nInsertThreadCount = std::thread::hardware_concurrency(); - if ( c_nDeleteThreadCount == 0 ) - c_nDeleteThreadCount = std::thread::hardware_concurrency(); - if ( c_nUpdateThreadCount == 0 ) - c_nUpdateThreadCount = std::thread::hardware_concurrency(); - } -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func.h b/tests/unit/set2/set_insdel_func.h deleted file mode 100644 index ed492ced..00000000 --- a/tests/unit/set2/set_insdel_func.h +++ /dev/null @@ -1,596 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include //unique_lock - -#include "set2/set_type.h" -#include "cppunit/thread.h" -#include - -namespace set2 { - -#define TEST_CASE(TAG, X) void X(); - - class Set_InsDel_func: public CppUnitMini::TestCase - { - public: - size_t c_nSetSize = 1000000; // set size - size_t c_nInsertThreadCount = 4; // count of insertion thread - size_t c_nDeleteThreadCount = 4; // count of deletion thread - size_t c_nUpdateThreadCount = 4; // count of ensure thread - size_t c_nThreadPassCount = 4; // pass count for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooSet - size_t c_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) - - size_t c_nFeldmanSet_HeadBits = 10; - size_t c_nFeldmanSet_ArrayBits = 4; - - size_t c_nLoadFactor = 2; - - private: - typedef size_t key_type; - struct value_type { - size_t nKey; - size_t nData; - atomics::atomic nUpdateCall; - bool volatile bInitialized; - cds::OS::ThreadId threadId ; // insert thread id - - typedef cds::sync::spin_lock< cds::backoff::pause > lock_type; - mutable lock_type m_access; - - value_type() - : nKey(0) - , nData(0) - , nUpdateCall(0) - , bInitialized( false ) - , threadId( cds::OS::get_current_thread_id() ) - {} - - value_type( value_type const& s ) - : nKey(s.nKey) - , nData(s.nData) - , nUpdateCall(s.nUpdateCall.load(atomics::memory_order_relaxed)) - , bInitialized( s.bInitialized ) - , threadId( cds::OS::get_current_thread_id() ) - {} - - // boost::container::flat_map requires operator = - value_type& operator=( value_type const& v ) - { - nKey = v.nKey; - nData = v.nData; - nUpdateCall.store( v.nUpdateCall.load(atomics::memory_order_relaxed), atomics::memory_order_relaxed ); - bInitialized = v.bInitialized; - - return *this; - } - - }; - - - size_t * m_pKeyFirst; - size_t * m_pKeyLast; - size_t * m_pKeyArr; - - template - class Inserter: public CppUnitMini::TestThread - { - Set& m_Set; - typedef typename Set::value_type keyval_type; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - - struct insert_functor { - size_t nTestFunctorRef; - - insert_functor() - : nTestFunctorRef(0) - {} - - void operator()( keyval_type& val ) - { - std::unique_lock< typename value_type::lock_type> ac( val.val.m_access ); - - val.val.nKey = val.key; - val.val.nData = val.key * 8; - - ++nTestFunctorRef; - val.val.bInitialized = true; - } - }; - - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - size_t m_nTestFunctorRef; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_func& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nInsertSuccess = - m_nInsertFailed = - m_nTestFunctorRef = 0; - - size_t * pKeyFirst = getTest().m_pKeyFirst; - size_t * pKeyLast = getTest().m_pKeyLast; - size_t const nPassCount = getTest().c_nThreadPassCount; - - // func is passed by reference - insert_functor func; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) { - if ( rSet.insert( *p, std::ref(func) ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) { - if ( rSet.insert( *p, std::ref(func) ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - - m_nTestFunctorRef = func.nTestFunctorRef; - } - }; - - template - class Updater: public CppUnitMini::TestThread - { - Set& m_Set; - typedef typename Set::value_type keyval_type; - - virtual Updater * clone() - { - return new Updater( *this ); - } - - struct update_functor { - size_t nCreated; - size_t nModified; - - update_functor() - : nCreated(0) - , nModified(0) - {} - - void operator()( bool bNew, keyval_type& val, size_t /*nKey*/ ) - { - std::unique_lock ac( val.val.m_access ); - if ( !val.val.bInitialized ) - { - val.val.nKey = val.key; - val.val.nData = val.key * 8; - val.val.bInitialized = true; - } - - if ( bNew ) { - ++nCreated; - } - else { - val.val.nUpdateCall.fetch_add( 1, atomics::memory_order_relaxed ); - ++nModified; - } - } - - void operator()( keyval_type& cur, keyval_type * old ) - { - operator()( old == nullptr, cur, 0 ); - } - - private: - update_functor(const update_functor& ); - }; - - public: - size_t m_nUpdateFailed; - size_t m_nUpdateCreated; - size_t m_nUpdateExisted; - size_t m_nFunctorCreated; - size_t m_nFunctorModified; - - public: - Updater( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Updater( Updater& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_func& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nUpdateCreated = - m_nUpdateExisted = - m_nUpdateFailed = 0; - - size_t * pKeyFirst = getTest().m_pKeyFirst; - size_t * pKeyLast = getTest().m_pKeyLast; - size_t const nPassCount = getTest().c_nThreadPassCount; - - update_functor func; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) { - std::pair ret = rSet.update( *p, std::ref( func ), true ); - if ( ret.first ) { - if ( ret.second ) - ++m_nUpdateCreated; - else - ++m_nUpdateExisted; - } - else - ++m_nUpdateFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t * p = pKeyLast - 1 ; p >= pKeyFirst; --p ) { - std::pair ret = rSet.update( *p, std::ref( func ), true ); - if ( ret.first ) { - if ( ret.second ) - ++m_nUpdateCreated; - else - ++m_nUpdateExisted; - } - else - ++m_nUpdateFailed; - } - } - } - - m_nFunctorCreated = func.nCreated; - m_nFunctorModified = func.nModified; - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Set& m_Set; - typedef typename Set::value_type keyval_type; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - - struct value_container - { - size_t nKeyExpected; - - size_t nSuccessItem; - size_t nFailedItem; - - value_container() - : nSuccessItem(0) - , nFailedItem(0) - {} - }; - - struct erase_functor { - value_container m_cnt; - - void operator ()( keyval_type const& itm ) - { - keyval_type& item = const_cast(itm); - while ( true ) { - bool bBkoff = false; - { - std::unique_lock< typename value_type::lock_type> ac( item.val.m_access ); - if ( item.val.bInitialized ) { - if ( m_cnt.nKeyExpected == item.val.nKey && m_cnt.nKeyExpected * 8 == item.val.nData ) - ++m_cnt.nSuccessItem; - else - ++m_cnt.nFailedItem; - item.val.nData++; - item.val.nKey = 0; - break; - } - else - bBkoff = true; - } - if ( bBkoff ) - cds::backoff::yield()(); - } - } - }; - - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - size_t m_nValueSuccess; - size_t m_nValueFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_func& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - size_t * pKeyFirst = getTest().m_pKeyFirst; - size_t * pKeyLast = getTest().m_pKeyLast; - size_t const nPassCount = getTest().c_nThreadPassCount; - - erase_functor func; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) { - func.m_cnt.nKeyExpected = *p; - if ( rSet.erase( *p, std::ref(func) )) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) { - func.m_cnt.nKeyExpected = *p; - if ( rSet.erase( *p, std::ref(func) )) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - - m_nValueSuccess = func.m_cnt.nSuccessItem; - m_nValueFailed = func.m_cnt.nFailedItem; - } - }; - - protected: - - template - void do_test( Set& testSet ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - typedef Updater UpdaterThread; - - m_pKeyArr = new size_t[ c_nSetSize ]; - m_pKeyFirst = m_pKeyArr; - m_pKeyLast = m_pKeyFirst + c_nSetSize; - for ( size_t i = 0; i < c_nSetSize; ++i ) - m_pKeyArr[i] = i; - shuffle( m_pKeyFirst, m_pKeyLast ); - - cds::OS::Timer timer; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testSet ), c_nInsertThreadCount ); - pool.add( new DeleterThread( pool, testSet ), c_nDeleteThreadCount ); - pool.add( new UpdaterThread( pool, testSet ), c_nUpdateThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - delete [] m_pKeyArr; - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nDelValueSuccess = 0; - size_t nDelValueFailed = 0; - size_t nUpdateFailed = 0; - size_t nUpdateCreated = 0; - size_t nUpdateModified = 0; - size_t nEnsFuncCreated = 0; - size_t nEnsFuncModified = 0; - size_t nTestFunctorRef = 0; - - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - nTestFunctorRef += pThread->m_nTestFunctorRef; - } - else { - DeleterThread * p = dynamic_cast( *it ); - if ( p ) { - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - nDelValueSuccess += p->m_nValueSuccess; - nDelValueFailed += p->m_nValueFailed; - } - else { - UpdaterThread * pEns = static_cast( *it ); - nUpdateCreated += pEns->m_nUpdateCreated; - nUpdateModified += pEns->m_nUpdateExisted; - nUpdateFailed += pEns->m_nUpdateFailed; - nEnsFuncCreated += pEns->m_nFunctorCreated; - nEnsFuncModified += pEns->m_nFunctorModified; - } - } - } - - CPPUNIT_MSG( - " Totals: Ins succ=" << nInsertSuccess - << " Del succ=" << nDeleteSuccess << "\n" - << " : Ins fail=" << nInsertFailed - << " Del fail=" << nDeleteFailed << "\n" - << " : Update succ=" << (nUpdateCreated + nUpdateModified) << " fail=" << nUpdateFailed - << " create=" << nUpdateCreated << " modify=" << nUpdateModified << "\n" - << " Set size=" << testSet.size() - ); - - CPPUNIT_CHECK_EX( nDelValueFailed == 0, "Functor del failed=" << nDelValueFailed ); - CPPUNIT_CHECK_EX( nDelValueSuccess == nDeleteSuccess, "Delete success=" << nDeleteSuccess << " functor=" << nDelValueSuccess ); - - CPPUNIT_CHECK( nUpdateFailed == 0 ); - - CPPUNIT_CHECK_EX( nUpdateCreated == nEnsFuncCreated, "Update created=" << nUpdateCreated << " functor=" << nEnsFuncCreated ); - CPPUNIT_CHECK_EX( nUpdateModified == nEnsFuncModified, "Update modified=" << nUpdateModified << " functor=" << nEnsFuncModified ); - - // nTestFunctorRef is call count of insert functor - CPPUNIT_CHECK_EX( nTestFunctorRef == nInsertSuccess, "nInsertSuccess=" << nInsertSuccess << " functor nTestFunctorRef=" << nTestFunctorRef ); - - CPPUNIT_MSG( " Clear set (single-threaded)..." ); - timer.reset(); - testSet.clear(); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_CHECK( testSet.empty() ); - - additional_check( testSet ); - print_stat( testSet ); - - additional_cleanup( testSet ); - } - - template - void run_test() - { - CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount - << " delete=" << c_nDeleteThreadCount - << " ensure=" << c_nUpdateThreadCount - << " pass count=" << c_nThreadPassCount - << " set size=" << c_nSetSize - ); - - if ( Set::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG(" LoadFactor = " << c_nLoadFactor ); - Set s( *this ); - do_test( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Set s( *this ); - do_test( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "set2/set_defs.h" - CDSUNIT_DECLARE_MichaelSet - CDSUNIT_DECLARE_SkipListSet - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_StripedSet - CDSUNIT_DECLARE_RefinableSet - CDSUNIT_DECLARE_CuckooSet - CDSUNIT_DECLARE_EllenBinTreeSet - CDSUNIT_DECLARE_FeldmanHashSet_fixed - CDSUNIT_DECLARE_FeldmanHashSet_city - - CPPUNIT_TEST_SUITE_(Set_InsDel_func, "Map_InsDel_func") - CDSUNIT_TEST_MichaelSet - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListSet - CDSUNIT_TEST_FeldmanHashSet_fixed - CDSUNIT_TEST_FeldmanHashSet_city - CDSUNIT_TEST_EllenBinTreeSet - CDSUNIT_TEST_StripedSet - CDSUNIT_TEST_RefinableSet - CDSUNIT_TEST_CuckooSet - CPPUNIT_TEST_SUITE_END(); - - }; -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_cuckoo.cpp b/tests/unit/set2/set_insdel_func_cuckoo.cpp deleted file mode 100644 index 69525f1b..00000000 --- a/tests/unit/set2/set_insdel_func_cuckoo.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_CuckooSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_ellentree.cpp b/tests/unit/set2/set_insdel_func_ellentree.cpp deleted file mode 100644 index 3b07226c..00000000 --- a/tests/unit/set2/set_insdel_func_ellentree.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_EllenBinTreeSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_feldmanhashset.cpp b/tests/unit/set2/set_insdel_func_feldmanhashset.cpp deleted file mode 100644 index 651d938f..00000000 --- a/tests/unit/set2/set_insdel_func_feldmanhashset.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_feldman_hashset.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_FeldmanHashSet_fixed - CDSUNIT_DECLARE_FeldmanHashSet_city -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_michael.cpp b/tests/unit/set2/set_insdel_func_michael.cpp deleted file mode 100644 index 24d6ac0e..00000000 --- a/tests/unit/set2/set_insdel_func_michael.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_MichaelSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_skip.cpp b/tests/unit/set2/set_insdel_func_skip.cpp deleted file mode 100644 index 91ad183d..00000000 --- a/tests/unit/set2/set_insdel_func_skip.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_SkipListSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_split.cpp b/tests/unit/set2/set_insdel_func_split.cpp deleted file mode 100644 index d7d50f92..00000000 --- a/tests/unit/set2/set_insdel_func_split.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_SplitList -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_func_striped.cpp b/tests/unit/set2/set_insdel_func_striped.cpp deleted file mode 100644 index 374441bf..00000000 --- a/tests/unit/set2/set_insdel_func_striped.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_func.h" -#include "set2/set_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_func::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_StripedSet - CDSUNIT_DECLARE_RefinableSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_string.cpp b/tests/unit/set2/set_insdel_string.cpp deleted file mode 100644 index 0e9af0b3..00000000 --- a/tests/unit/set2/set_insdel_string.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_string.h" - -namespace set2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Set_InsDel_string ); - - void Set_InsDel_string::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nSetSize = cfg.getSizeT("MapSize", c_nSetSize ); - c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount ); - c_nDeleteThreadCount = cfg.getSizeT("DeleteThreadCount", c_nDeleteThreadCount ); - c_nThreadPassCount = cfg.getSizeT("ThreadPassCount", c_nThreadPassCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize ); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize ); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold ); - - c_nFeldmanSet_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanSet_HeadBits); - c_nFeldmanSet_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanSet_ArrayBits); - - if ( c_nInsertThreadCount == 0 ) - c_nInsertThreadCount = std::thread::hardware_concurrency(); - if ( c_nDeleteThreadCount == 0 ) - c_nDeleteThreadCount = std::thread::hardware_concurrency(); - } -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_string.h b/tests/unit/set2/set_insdel_string.h deleted file mode 100644 index 00257041..00000000 --- a/tests/unit/set2/set_insdel_string.h +++ /dev/null @@ -1,565 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_type.h" -#include "cppunit/thread.h" - -#include - -namespace set2 { - -#define TEST_CASE(TAG, X) void X(); - - class Set_InsDel_string: public CppUnitMini::TestCase - { - public: - size_t c_nSetSize = 1000000; // set size - size_t c_nInsertThreadCount = 4; // count of insertion thread - size_t c_nDeleteThreadCount = 4; // count of deletion thread - size_t c_nThreadPassCount = 4; // pass count for each thread - size_t c_nMaxLoadFactor = 8; // maximum load factor - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooSet - size_t c_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) - - size_t c_nFeldmanSet_HeadBits = 10; - size_t c_nFeldmanSet_ArrayBits = 4; - - size_t c_nLoadFactor = 2; - - private: - typedef std::string key_type; - typedef size_t value_type; - - const std::vector * m_parrString; - - template - class Inserter: public CppUnitMini::TestThread - { - Set& m_Set; - typedef typename Set::value_type keyval_type; - - virtual Inserter * clone() - { - return new Inserter( *this ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - - public: - Inserter( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Inserter( Inserter& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nInsertSuccess = - m_nInsertFailed = 0; - - const std::vector& arrString = *getTest().m_parrString; - size_t nArrSize = arrString.size(); - size_t const nSetSize = getTest().c_nSetSize; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { - if ( rSet.insert( keyval_type(arrString[nItem % nArrSize], nItem * 8) ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { - if ( rSet.insert( keyval_type( arrString[nItem % nArrSize], nItem * 8) ) ) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - } - } - } - } - }; - - template - class Deleter: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual Deleter * clone() - { - return new Deleter( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Deleter( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Deleter( Deleter& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - const std::vector& arrString = *getTest().m_parrString; - size_t nArrSize = arrString.size(); - size_t const nSetSize = getTest().c_nSetSize; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { - if ( rSet.erase( arrString[nItem % nArrSize] ) ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { - if ( rSet.erase( arrString[nItem % nArrSize] ) ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - } - } - }; - - template - class Extractor: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual Extractor * clone() - { - return new Extractor( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Extractor( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Extractor( Extractor& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - typename Set::guarded_ptr gp; - - const std::vector& arrString = *getTest().m_parrString; - size_t nArrSize = arrString.size(); - size_t const nSetSize = getTest().c_nSetSize; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { - gp = rSet.extract( arrString[nItem % nArrSize]); - if ( gp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - gp.release(); - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { - gp = rSet.extract( arrString[nItem % nArrSize]); - if ( gp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - gp.release(); - } - } - } - } - }; - - template - class Extractor, Set >: public CppUnitMini::TestThread - { - Set& m_Set; - - virtual Extractor * clone() - { - return new Extractor( *this ); - } - public: - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - - public: - Extractor( CppUnitMini::ThreadPool& pool, Set& rSet ) - : CppUnitMini::TestThread( pool ) - , m_Set( rSet ) - {} - Extractor( Extractor& src ) - : CppUnitMini::TestThread( src ) - , m_Set( src.m_Set ) - {} - - Set_InsDel_string& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rSet = m_Set; - - m_nDeleteSuccess = - m_nDeleteFailed = 0; - - typename Set::exempt_ptr xp; - - const std::vector& arrString = *getTest().m_parrString; - size_t nArrSize = arrString.size(); - size_t const nSetSize = getTest().c_nSetSize; - size_t const nPassCount = getTest().c_nThreadPassCount; - - if ( m_nThreadNo & 1 ) { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = 0; nItem < nSetSize; ++nItem ) { - if ( Set::c_bExtractLockExternal ) { - { - typename Set::rcu_lock l; - xp = rSet.extract( arrString[nItem % nArrSize] ); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - else { - xp = rSet.extract( arrString[nItem % nArrSize] ); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - xp.release(); - } - } - } - else { - for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) { - for ( size_t nItem = nSetSize; nItem > 0; --nItem ) { - if ( Set::c_bExtractLockExternal ) { - { - typename Set::rcu_lock l; - xp = rSet.extract( arrString[nItem % nArrSize] ); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - } - else { - xp = rSet.extract( arrString[nItem % nArrSize] ); - if ( xp ) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - } - xp.release(); - } - } - } - } - }; - - protected: - template - void do_test( Set& testSet ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - cds::OS::Timer timer; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testSet ), c_nInsertThreadCount ); - pool.add( new DeleterThread( pool, testSet ), c_nDeleteThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - DeleterThread * p = static_cast( *it ); - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - } - - CPPUNIT_MSG( " Totals: Ins succ=" << nInsertSuccess - << " Del succ=" << nDeleteSuccess << "\n" - << " : Ins fail=" << nInsertFailed - << " Del fail=" << nDeleteFailed - << " Set size=" << testSet.size() - ); - - - CPPUNIT_MSG( " Clear set (single-threaded)..." ); - timer.reset(); - for ( size_t i = 0; i < m_parrString->size(); ++i ) - testSet.erase( (*m_parrString)[i] ); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_ASSERT( testSet.empty() ); - - additional_check( testSet ); - print_stat( testSet ); - additional_cleanup( testSet ); - } - - template - void do_test_extract( Set& testSet ) - { - typedef Inserter InserterThread; - typedef Deleter DeleterThread; - typedef Extractor ExtractThread; - - size_t nDelThreadCount = c_nDeleteThreadCount / 2; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new InserterThread( pool, testSet ), c_nInsertThreadCount ); - pool.add( new DeleterThread( pool, testSet ), nDelThreadCount ); - pool.add( new ExtractThread( pool, testSet ), c_nDeleteThreadCount - nDelThreadCount ); - pool.run(); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nExtractSuccess = 0; - size_t nExtractFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - InserterThread * pThread = dynamic_cast( *it ); - if ( pThread ) { - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - } - else { - DeleterThread * p = dynamic_cast( *it ); - if ( p ) { - nDeleteSuccess += p->m_nDeleteSuccess; - nDeleteFailed += p->m_nDeleteFailed; - } - else { - ExtractThread * pExtract = dynamic_cast( *it ); - assert( pExtract ); - nExtractSuccess += pExtract->m_nDeleteSuccess; - nExtractFailed += pExtract->m_nDeleteFailed; - } - } - } - - CPPUNIT_MSG( " Totals: Ins succ=" << nInsertSuccess - << " Del succ=" << nDeleteSuccess - << " Extract succ= " << nExtractSuccess << "\n" - << " : Ins fail=" << nInsertFailed - << " Del fail=" << nDeleteFailed - << " Extract fail=" << nExtractFailed - << " Set size=" << testSet.size() - ); - - - CPPUNIT_MSG( " Clear set (single-threaded)..." ); - cds::OS::Timer timer; - for ( size_t i = 0; i < m_parrString->size(); ++i ) - testSet.erase( (*m_parrString)[i] ); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_ASSERT( testSet.empty() ); - - additional_check( testSet ); - print_stat( testSet ); - additional_cleanup( testSet ); - } - - template - void run_test() - { - m_parrString = &CppUnitMini::TestCase::getTestStrings(); - - CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount - << " delete=" << c_nDeleteThreadCount - << " pass count=" << c_nThreadPassCount - << " set size=" << c_nSetSize - ); - - if ( Set::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG(" LoadFactor = " << c_nLoadFactor ); - Set s( *this ); - do_test( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Set s( *this ); - do_test( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - template - void run_test_extract() - { - m_parrString = &CppUnitMini::TestCase::getTestStrings(); - - CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount - << " delete=" << c_nDeleteThreadCount - << " pass count=" << c_nThreadPassCount - << " set size=" << c_nSetSize - ); - - if ( Set::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG(" LoadFactor = " << c_nLoadFactor ); - Set s( *this ); - do_test_extract( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Set s( *this ); - do_test_extract( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "set2/set_defs.h" - CDSUNIT_DECLARE_MichaelSet - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_StripedSet - CDSUNIT_DECLARE_RefinableSet - CDSUNIT_DECLARE_CuckooSet - CDSUNIT_DECLARE_SkipListSet - CDSUNIT_DECLARE_EllenBinTreeSet - CDSUNIT_DECLARE_FeldmanHashSet_stdhash - CDSUNIT_DECLARE_FeldmanHashSet_city - CDSUNIT_DECLARE_StdSet - - CPPUNIT_TEST_SUITE_(Set_InsDel_string, "Map_InsDel_func") - CDSUNIT_TEST_MichaelSet - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListSet - CDSUNIT_TEST_FeldmanHashSet_stdhash - CDSUNIT_TEST_FeldmanHashSet_city - CDSUNIT_TEST_EllenBinTreeSet - CDSUNIT_TEST_StripedSet - CDSUNIT_TEST_RefinableSet - CDSUNIT_TEST_CuckooSet - CDSUNIT_TEST_StdSet - CPPUNIT_TEST_SUITE_END(); - }; -} // namespace set2 diff --git a/tests/unit/set2/set_insdel_string_feldmanhashset.cpp b/tests/unit/set2/set_insdel_string_feldmanhashset.cpp deleted file mode 100644 index 30727748..00000000 --- a/tests/unit/set2/set_insdel_string_feldmanhashset.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdel_string.h" -#include "set2/set_type_feldman_hashset.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDel_string::X() { run_test_extract::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_FeldmanHashSet_stdhash - CDSUNIT_DECLARE_FeldmanHashSet_city -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind.cpp b/tests/unit/set2/set_insdelfind.cpp deleted file mode 100644 index 77ca18ad..00000000 --- a/tests/unit/set2/set_insdelfind.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" - -namespace set2 { - CPPUNIT_TEST_SUITE_REGISTRATION( Set_InsDelFind ); - - void Set_InsDelFind::setUpParams( const CppUnitMini::TestCfg& cfg ) - { - c_nSetSize = cfg.getSizeT("InitialMapSize", c_nSetSize ); - c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount ); - c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor ); - c_nInsertPercentage = cfg.getUInt("InsertPercentage", c_nInsertPercentage ); - c_nDeletePercentage = cfg.getUInt("DeletePercentage", c_nDeletePercentage ); - c_nDuration = cfg.getUInt("Duration", c_nDuration ); - c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); - - c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize ); - c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize ); - c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold ); - - c_nFeldmanSet_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanSet_HeadBits); - c_nFeldmanSet_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanSet_ArrayBits); - - if ( c_nThreadCount == 0 ) - c_nThreadCount = std::thread::hardware_concurrency(); - - CPPUNIT_ASSERT( c_nInsertPercentage + c_nDeletePercentage <= 100 ); - - actions * pFirst = m_arrShuffle; - actions * pLast = m_arrShuffle + c_nInsertPercentage; - std::fill( pFirst, pLast, do_insert ); - pFirst = pLast; - pLast += c_nDeletePercentage; - std::fill( pFirst, pLast, do_delete ); - pFirst = pLast; - pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]); - std::fill( pFirst, pLast, do_find ); - shuffle( m_arrShuffle, pLast ); - } -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind.h b/tests/unit/set2/set_insdelfind.h deleted file mode 100644 index ad534bb9..00000000 --- a/tests/unit/set2/set_insdelfind.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_type.h" -#include "cppunit/thread.h" - -namespace set2 { - -#define TEST_CASE(TAG, X) void X(); - - class Set_InsDelFind: public CppUnitMini::TestCase - { - public: - size_t c_nSetSize = 500000; // initial set size - size_t c_nThreadCount = 8; // thread count - size_t c_nMaxLoadFactor = 8; // maximum load factor - unsigned int c_nInsertPercentage = 5; - unsigned int c_nDeletePercentage = 5; - unsigned int c_nDuration = 30; // test duration, seconds - bool c_bPrintGCState = true; - - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooSet - size_t c_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) - - size_t c_nFeldmanSet_HeadBits = 10; - size_t c_nFeldmanSet_ArrayBits = 4; - - size_t c_nLoadFactor = 2; - - public: - enum actions - { - do_find, - do_insert, - do_delete - }; - static const unsigned int c_nShuffleSize = 100; - actions m_arrShuffle[c_nShuffleSize]; - - protected: - typedef size_t key_type; - typedef size_t value_type; - - template - class WorkThread: public CppUnitMini::TestThread - { - Set& m_Map; - - virtual WorkThread * clone() - { - return new WorkThread( *this ); - } - public: - size_t m_nInsertSuccess; - size_t m_nInsertFailed; - size_t m_nDeleteSuccess; - size_t m_nDeleteFailed; - size_t m_nFindSuccess; - size_t m_nFindFailed; - - public: - WorkThread( CppUnitMini::ThreadPool& pool, Set& rMap ) - : CppUnitMini::TestThread( pool ) - , m_Map( rMap ) - {} - WorkThread( WorkThread& src ) - : CppUnitMini::TestThread( src ) - , m_Map( src.m_Map ) - {} - - Set_InsDelFind& getTest() - { - return reinterpret_cast( m_Pool.m_Test ); - } - - virtual void init() { cds::threading::Manager::attachThread() ; } - virtual void fini() { cds::threading::Manager::detachThread() ; } - - virtual void test() - { - Set& rMap = m_Map; - - m_nInsertSuccess = - m_nInsertFailed = - m_nDeleteSuccess = - m_nDeleteFailed = - m_nFindSuccess = - m_nFindFailed = 0; - - actions * pAct = getTest().m_arrShuffle; - unsigned int i = 0; - size_t const nNormalize = size_t(-1) / ( getTest().c_nSetSize * 2); - - size_t nRand = 0; - while ( !time_elapsed() ) { - nRand = cds::bitop::RandXorShift(nRand); - size_t n = nRand / nNormalize; - switch ( pAct[i] ) { - case do_find: - if ( rMap.contains( n )) - ++m_nFindSuccess; - else - ++m_nFindFailed; - break; - case do_insert: - if ( rMap.insert( n )) - ++m_nInsertSuccess; - else - ++m_nInsertFailed; - break; - case do_delete: - if ( rMap.erase( n )) - ++m_nDeleteSuccess; - else - ++m_nDeleteFailed; - break; - } - - if ( ++i >= c_nShuffleSize ) - i = 0; - } - } - }; - - protected: - template - void do_test( Set& testSet ) - { - typedef WorkThread work_thread; - - // fill map - only odd number - { - size_t * pInitArr = new size_t[ c_nSetSize ]; - size_t * pEnd = pInitArr + c_nSetSize; - for ( size_t i = 0; i < c_nSetSize; ++i ) - pInitArr[i] = i * 2 + 1; - shuffle( pInitArr, pEnd ); - for ( size_t * p = pInitArr; p < pEnd; ++p ) - testSet.insert( typename Set::value_type( *p, *p ) ); - delete [] pInitArr; - } - - cds::OS::Timer timer; - - CppUnitMini::ThreadPool pool( *this ); - pool.add( new work_thread( pool, testSet ), c_nThreadCount ); - pool.run( c_nDuration ); - CPPUNIT_MSG( " Duration=" << pool.avgDuration() ); - - size_t nInsertSuccess = 0; - size_t nInsertFailed = 0; - size_t nDeleteSuccess = 0; - size_t nDeleteFailed = 0; - size_t nFindSuccess = 0; - size_t nFindFailed = 0; - for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { - work_thread * pThread = static_cast( *it ); - assert( pThread != nullptr ); - nInsertSuccess += pThread->m_nInsertSuccess; - nInsertFailed += pThread->m_nInsertFailed; - nDeleteSuccess += pThread->m_nDeleteSuccess; - nDeleteFailed += pThread->m_nDeleteFailed; - nFindSuccess += pThread->m_nFindSuccess; - nFindFailed += pThread->m_nFindFailed; - } - - size_t nTotalOps = nInsertSuccess + nInsertFailed + nDeleteSuccess + nDeleteFailed + nFindSuccess + nFindFailed; - - CPPUNIT_MSG( " Totals (success/failed): \n\t" - << " Insert=" << nInsertSuccess << '/' << nInsertFailed << "\n\t" - << " Delete=" << nDeleteSuccess << '/' << nDeleteFailed << "\n\t" - << " Find=" << nFindSuccess << '/' << nFindFailed << "\n\t" - << " Speed=" << (nFindSuccess + nFindFailed) / c_nDuration << " find/sec\n\t" - << " " << (nInsertSuccess + nDeleteSuccess) / c_nDuration << " modify/sec\n\t" - << " Total ops=" << nTotalOps << "\n\t" - << " speed=" << nTotalOps / c_nDuration << " ops/sec\n\t" - << " Set size=" << testSet.size() - ); - - - CPPUNIT_MSG( " Clear map (single-threaded)..." ); - timer.reset(); - testSet.clear(); - CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_CHECK_EX( testSet.empty(), ((long long) testSet.size()) ); - - additional_check( testSet ); - print_stat( testSet ); - additional_cleanup( testSet ); - } - - template - void run_test() - { - CPPUNIT_MSG( "Thread count=" << c_nThreadCount - << " initial map size=" << c_nSetSize - << " insert=" << c_nInsertPercentage << '%' - << " delete=" << c_nDeletePercentage << '%' - << " duration=" << c_nDuration << "s" - ); - - if ( Set::c_bLoadFactorDepended ) { - for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) { - CPPUNIT_MSG(" LoadFactor = " << c_nLoadFactor ); - Set s( *this ); - do_test( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - else { - Set s( *this ); - do_test( s ); - if ( c_bPrintGCState ) - print_gc_state(); - } - } - - void setUpParams( const CppUnitMini::TestCfg& cfg ); - -# include "set2/set_defs.h" - CDSUNIT_DECLARE_MichaelSet - CDSUNIT_DECLARE_SplitList - CDSUNIT_DECLARE_StripedSet - CDSUNIT_DECLARE_RefinableSet - CDSUNIT_DECLARE_CuckooSet - CDSUNIT_DECLARE_SkipListSet - CDSUNIT_DECLARE_EllenBinTreeSet - CDSUNIT_DECLARE_FeldmanHashSet - CDSUNIT_DECLARE_StdSet - - CPPUNIT_TEST_SUITE_(Set_InsDelFind, "Map_InsDelFind") - CDSUNIT_TEST_MichaelSet - CDSUNIT_TEST_SplitList - CDSUNIT_TEST_SkipListSet - CDSUNIT_TEST_FeldmanHashSet - CDSUNIT_TEST_EllenBinTreeSet - CDSUNIT_TEST_StripedSet - CDSUNIT_TEST_RefinableSet - CDSUNIT_TEST_CuckooSet - CDSUNIT_TEST_StdSet - CPPUNIT_TEST_SUITE_END(); - - }; -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_cuckoo.cpp b/tests/unit/set2/set_insdelfind_cuckoo.cpp deleted file mode 100644 index df5ff29e..00000000 --- a/tests/unit/set2/set_insdelfind_cuckoo.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_cuckoo.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_CuckooSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_ellentree.cpp b/tests/unit/set2/set_insdelfind_ellentree.cpp deleted file mode 100644 index 670622f2..00000000 --- a/tests/unit/set2/set_insdelfind_ellentree.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_ellen_bintree.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_EllenBinTreeSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_feldmanhashset.cpp b/tests/unit/set2/set_insdelfind_feldmanhashset.cpp deleted file mode 100644 index 115947eb..00000000 --- a/tests/unit/set2/set_insdelfind_feldmanhashset.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_feldman_hashset.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_FeldmanHashSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_michael.cpp b/tests/unit/set2/set_insdelfind_michael.cpp deleted file mode 100644 index 022acdb9..00000000 --- a/tests/unit/set2/set_insdelfind_michael.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_michael.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_MichaelSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_skip.cpp b/tests/unit/set2/set_insdelfind_skip.cpp deleted file mode 100644 index 631081f4..00000000 --- a/tests/unit/set2/set_insdelfind_skip.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_skip_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_SkipListSet -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_split.cpp b/tests/unit/set2/set_insdelfind_split.cpp deleted file mode 100644 index 8719d8f4..00000000 --- a/tests/unit/set2/set_insdelfind_split.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_split_list.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_SplitList -} // namespace set2 diff --git a/tests/unit/set2/set_insdelfind_striped.cpp b/tests/unit/set2/set_insdelfind_striped.cpp deleted file mode 100644 index dde750d0..00000000 --- a/tests/unit/set2/set_insdelfind_striped.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "set2/set_insdelfind.h" -#include "set2/set_type_striped.h" - -#undef TEST_CASE -#define TEST_CASE(TAG, X) void Set_InsDelFind::X() { run_test::X>(); } -#include "set2/set_defs.h" - -namespace set2 { - CDSUNIT_DECLARE_StripedSet - CDSUNIT_DECLARE_RefinableSet -} // namespace set2 diff --git a/tests/unit/set2/set_type.h b/tests/unit/set2/set_type.h deleted file mode 100644 index 1b5a8eaf..00000000 --- a/tests/unit/set2/set_type.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_H -#define CDSUNIT_SET_TYPE_H - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "cppunit/cppunit_mini.h" -#include "lock/nolock.h" -#include "michael_alloc.h" - -namespace set2 { - namespace cc = cds::container; - namespace co = cds::opt; - - typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_gpi; - typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_gpb; - typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_gpt; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_shb; - typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_sht; -#endif - - template - struct cmp { - int operator ()(Key const& k1, Key const& k2) const - { - if ( std::less( k1, k2 ) ) - return -1; - return std::less( k2, k1 ) ? 1 : 0; - } - }; - -#define CDSUNIT_INT_COMPARE(t) template <> struct cmp { int operator()( t k1, t k2 ){ return (int)(k1 - k2); } } - CDSUNIT_INT_COMPARE(char); - CDSUNIT_INT_COMPARE(unsigned char); - CDSUNIT_INT_COMPARE(int); - CDSUNIT_INT_COMPARE(unsigned int); - CDSUNIT_INT_COMPARE(long); - CDSUNIT_INT_COMPARE(unsigned long); - CDSUNIT_INT_COMPARE(long long); - CDSUNIT_INT_COMPARE(unsigned long long); -#undef CDSUNIT_INT_COMPARE - - template <> - struct cmp - { - int operator()(std::string const& s1, std::string const& s2) - { - return s1.compare( s2 ); - } - int operator()(std::string const& s1, char const * s2) - { - return s1.compare( s2 ); - } - int operator()(char const * s1, std::string const& s2) - { - return -s2.compare( s1 ); - } - }; - - // forward - template - struct set_type; - - template - struct set_type_base - { - typedef Key key_type; - typedef Value value_type; - - struct key_val { - key_type key; - value_type val; - - /*explicit*/ key_val( key_type const& k ): key(k), val() {} - key_val( key_type const& k, value_type const& v ): key(k), val(v) {} - - template - /*explicit*/ key_val( K const& k ): key(k) {} - - template - key_val( K const& k, T const& v ): key(k), val(v) {} - }; - - typedef co::v::hash key_hash; - typedef std::less key_less; - typedef cmp key_compare; - - struct less { - bool operator()( key_val const& k1, key_val const& k2 ) const - { - return key_less()( k1.key, k2.key ); - } - bool operator()( key_type const& k1, key_val const& k2 ) const - { - return key_less()( k1, k2.key ); - } - bool operator()( key_val const& k1, key_type const& k2 ) const - { - return key_less()( k1.key, k2 ); - } - }; - - struct compare { - int operator()( key_val const& k1, key_val const& k2 ) const - { - return key_compare()( k1.key, k2.key ); - } - int operator()( key_type const& k1, key_val const& k2 ) const - { - return key_compare()( k1, k2.key ); - } - int operator()( key_val const& k1, key_type const& k2 ) const - { - return key_compare()( k1.key, k2 ); - } - }; - - struct equal_to { - bool operator()( key_val const& k1, key_val const& k2 ) const - { - return key_compare()( k1.key, k2.key ) == 0; - } - bool operator()( key_type const& k1, key_val const& k2 ) const - { - return key_compare()( k1, k2.key ) == 0; - } - bool operator()( key_val const& k1, key_type const& k2 ) const - { - return key_compare()( k1.key, k2 ) == 0; - } - }; - - - struct hash: public key_hash - { - size_t operator()( key_val const& v ) const - { - return key_hash::operator()( v.key ); - } - size_t operator()( key_type const& key ) const - { - return key_hash::operator()( key ); - } - template - size_t operator()( Q const& k ) const - { - return key_hash::operator()( k ); - } - }; - - struct hash2: public hash - { - size_t operator()( key_val const& k ) const - { - size_t seed = ~hash::operator ()( k ); - boost::hash_combine( seed, k.key ); - return seed; - } - size_t operator()( key_type const& k ) const - { - size_t seed = ~hash::operator ()( k ); - boost::hash_combine( seed, k ); - return seed; - } - template - size_t operator()( Q const& k ) const - { - return key_hash::operator()( k ); - } - }; - }; - - - // ************************************************* - // print_stat - // ************************************************* - - template - static inline void print_stat( Set const& /*s*/ ) - {} - - - //******************************************************* - // additional_check - //******************************************************* - - template - static inline void additional_check( Set& /*set*/ ) - {} - - template - static inline void additional_cleanup( Set& /*set*/ ) - {} - - //******************************************************* - // check_before_clear - //******************************************************* - - template - static inline void check_before_clear( Set& /*s*/ ) - {} - -} // namespace set2 - -#endif // ifndef CDSUNIT_SET_TYPE_H diff --git a/tests/unit/set2/set_type_cuckoo.h b/tests/unit/set2/set_type_cuckoo.h deleted file mode 100644 index a392cb3c..00000000 --- a/tests/unit/set2/set_type_cuckoo.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_CUCKOO_H -#define CDSUNIT_SET_TYPE_CUCKOO_H - -#include "set2/set_type.h" - -#include -#include "print_cuckoo_stat.h" - -namespace set2 { - - template - class CuckooSet : public cc::CuckooSet< V, Traits > - { - public: - typedef cc::CuckooSet< V, Traits > cuckoo_base_class; - - public: - template - CuckooSet( Config const& cfg ) - : cuckoo_base_class( - - cfg.c_nCuckooInitialSize, - static_cast( cfg.c_nCuckooProbesetSize ), - static_cast( cfg.c_nCuckooProbesetThreshold ) - ) - {} - - template - bool erase_with( Q const& key, Pred /*pred*/ ) - { - return cuckoo_base_class::erase_with( key, typename std::conditional< cuckoo_base_class::c_isSorted, Pred, typename Pred::equal_to>::type() ); - } - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_CuckooSet; - - template - struct set_type< tag_CuckooSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_val key_val; - typedef typename base_class::compare compare; - typedef typename base_class::equal_to equal_to; - typedef typename base_class::less less; - typedef typename base_class::hash hash; - typedef typename base_class::hash2 hash2; - - // *************************************************************************** - // CuckooSet - - template - struct traits_CuckooStripedSet : public Traits - { - typedef cc::cuckoo::striping<> mutex_policy; - }; - template - struct traits_CuckooRefinableSet : public Traits - { - typedef cc::cuckoo::refinable<> mutex_policy; - }; - - struct traits_CuckooSet_list_unord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::list > - , co::equal_to< equal_to > - , co::hash< std::tuple< hash, hash2 > > - > ::type - {}; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_unord; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_unord; - - struct traits_CuckooSet_list_unord_stat : public traits_CuckooSet_list_unord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_unord_stat; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_unord_stat; - - struct traits_CuckooSet_list_unord_storehash : public traits_CuckooSet_list_unord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_unord_storehash; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_unord_storehash; - - struct traits_CuckooSet_list_ord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::list > - , co::compare< compare > - , co::hash< std::tuple< hash, hash2 > > - > ::type - {}; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_ord; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_ord; - - struct traits_CuckooSet_list_ord_stat : public traits_CuckooSet_list_ord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_ord_stat; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_ord_stat; - - struct traits_CuckooSet_list_ord_storehash : public traits_CuckooSet_list_ord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_list_ord_storehash; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_list_ord_storehash; - - - struct traits_CuckooSet_vector_unord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - , co::equal_to< equal_to > - , co::hash< std::tuple< hash, hash2 > > - > ::type - {}; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_unord; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_unord; - - struct traits_CuckooSet_vector_unord_stat : public traits_CuckooSet_vector_unord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_unord_stat; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_unord_stat; - - struct traits_CuckooSet_vector_unord_storehash : public traits_CuckooSet_vector_unord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_unord_storehash; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_unord_storehash; - - struct traits_CuckooSet_vector_ord : - public cc::cuckoo::make_traits < - cc::cuckoo::probeset_type< cc::cuckoo::vector<4> > - , co::compare< compare > - , co::hash< std::tuple< hash, hash2 > > - > ::type - {}; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_ord; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_ord; - - struct traits_CuckooSet_vector_ord_stat : public traits_CuckooSet_vector_ord - { - typedef cc::cuckoo::stat stat; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_ord_stat; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_ord_stat; - - struct traits_CuckooSet_vector_ord_storehash : public traits_CuckooSet_vector_ord - { - static CDS_CONSTEXPR const bool store_hash = true; - }; - typedef CuckooSet< key_val, traits_CuckooStripedSet> CuckooStripedSet_vector_ord_storehash; - typedef CuckooSet< key_val, traits_CuckooRefinableSet> CuckooRefinableSet_vector_ord_storehash; - - }; - - template - static inline void print_stat( cc::CuckooSet< T, Traits > const& s ) - { - CPPUNIT_MSG( s.statistics() << s.mutex_policy_statistics() ); - } - - template - static inline void print_stat( CuckooSet< V, Traits > const& s ) - { - typedef CuckooSet< V, Traits > set_type; - print_stat( static_cast(s) ); - } - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_CUCKOO_H diff --git a/tests/unit/set2/set_type_ellen_bintree.h b/tests/unit/set2/set_type_ellen_bintree.h deleted file mode 100644 index 845f24a6..00000000 --- a/tests/unit/set2/set_type_ellen_bintree.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_ELLEN_BINTREE_H -#define CDSUNIT_SET_TYPE_ELLEN_BINTREE_H - -#include "set2/set_type.h" - -#include -#include -#include - -#include "print_ellenbintree_stat.h" - -namespace set2 { - - template - class EllenBinTreeSet : public cc::EllenBinTreeSet< GC, Key, T, Traits > - { - typedef cc::EllenBinTreeSet< GC, Key, T, Traits > base_class; - public: - template - EllenBinTreeSet( Config const& /*cfg*/ ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_EllenBinTreeSet; - - template - struct set_type< tag_EllenBinTreeSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_type key_type; - typedef typename base_class::key_val key_val; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::key_less key_less; - - struct ellen_bintree_props { - struct key_extractor { - void operator()( key_type& dest, key_val const& src ) const - { - dest = src.key; - } - }; - - struct less { - bool operator()( key_val const& v1, key_val const& v2 ) const - { - return key_less()( v1.key, v2.key ); - } - bool operator()( key_type const& k, key_val const& v ) const - { - return key_less()( k, v.key ); - } - bool operator()( key_val const& v, key_type const& k ) const - { - return key_less()( v.key, k ); - } - bool operator()( key_type const& k1, key_type const& k2 ) const - { - return key_less()( k1, k2 ); - } - }; - - struct hp_gc { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - - struct dhp_gc { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - - struct gpi { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct gpb { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct gpt { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct shb { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; - struct sht { - typedef cc::ellen_bintree::node leaf_node; - typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; - typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; - }; -#endif - }; - - struct traits_EllenBinTreeSet: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - - struct traits_EllenBinTreeSet_hp : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_hp > EllenBinTreeSet_hp; - - struct traits_EllenBinTreeSet_dhp : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_dhp > EllenBinTreeSet_dhp; - - struct traits_EllenBinTreeSet_gpi : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_gpi > EllenBinTreeSet_rcu_gpi; - - struct traits_EllenBinTreeSet_gpb : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_gpb > EllenBinTreeSet_rcu_gpb; - - struct traits_EllenBinTreeSet_gpt : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_gpt > EllenBinTreeSet_rcu_gpt; - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits_EllenBinTreeSet_shb : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_shb > EllenBinTreeSet_rcu_shb; - - struct traits_EllenBinTreeSet_sht : public traits_EllenBinTreeSet - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_sht > EllenBinTreeSet_rcu_sht; -#endif - - // - struct traits_EllenBinTreeSet_yield : public traits_EllenBinTreeSet - { - typedef cds::backoff::yield back_off; - }; - - struct traits_EllenBinTreeSet_yield_hp : public traits_EllenBinTreeSet_yield - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_yield_hp > EllenBinTreeSet_yield_hp; - - struct traits_EllenBinTreeSet_yield_dhp : public traits_EllenBinTreeSet_yield - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_yield_dhp > EllenBinTreeSet_yield_dhp; - - - struct traits_EllenBinTreeSet_yield_gpb : public traits_EllenBinTreeSet_yield - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_yield_gpb > EllenBinTreeSet_yield_rcu_gpb; - - - struct traits_EllenBinTreeSet_stat: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - - struct traits_EllenBinTreeSet_stat_hp : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_stat_hp > EllenBinTreeSet_hp_stat; - - struct traits_EllenBinTreeSet_stat_dhp : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_stat_dhp > EllenBinTreeSet_dhp_stat; - - struct traits_EllenBinTreeSet_stat_gpi : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_stat_gpi > EllenBinTreeSet_rcu_gpi_stat; - - struct traits_EllenBinTreeSet_stat_gpb : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_stat_gpb > EllenBinTreeSet_rcu_gpb_stat; - - struct traits_EllenBinTreeSet_stat_gpt : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_stat_gpt > EllenBinTreeSet_rcu_gpt_stat; - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits_EllenBinTreeSet_stat_shb : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_stat_shb > EllenBinTreeSet_rcu_shb_stat; - - struct traits_EllenBinTreeSet_stat_sht : public traits_EllenBinTreeSet_stat - { - typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; - }; - typedef EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_stat_sht > EllenBinTreeSet_rcu_sht_stat; -#endif - - }; - - template - static inline void print_stat( EllenBinTreeSet const& s ) - { - CPPUNIT_MSG( s.statistics() ); - } - - namespace ellen_bintree_check { - static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& /*s*/ ) - { - // Not true for threaded RCU - /* - CPPUNIT_CHECK_CURRENT_EX( ellen_bintree_pool::internal_node_counter::m_nAlloc.get() == ellen_bintree_pool::internal_node_counter::m_nFree.get(), - "m_nAlloc=" << ellen_bintree_pool::internal_node_counter::m_nAlloc.get() - << ", m_nFree=" << ellen_bintree_pool::internal_node_counter::m_nFree.get() - ); - */ - } - - static inline void check_stat( cds::intrusive::ellen_bintree::stat<> const& stat ) - { - CPPUNIT_CHECK_CURRENT( stat.m_nInternalNodeCreated == stat.m_nInternalNodeDeleted ); - CPPUNIT_CHECK_CURRENT( stat.m_nUpdateDescCreated == stat.m_nUpdateDescDeleted ); - //CPPUNIT_CHECK_CURRENT( ellen_bintree_pool::internal_node_counter::m_nAlloc.get() == ellen_bintree_pool::internal_node_counter::m_nFree.get() ); - CPPUNIT_CHECK_CURRENT( ellen_bintree_pool::internal_node_counter::m_nAlloc.get() == stat.m_nInternalNodeCreated ); - // true if RCU is not threaded - //CPPUNIT_CHECK_CURRENT( stat.m_nInternalNodeDeleted == ellen_bintree_pool::internal_node_counter::m_nFree.get() ); - } - } // namespace ellen_bintree_check - - template - static inline void additional_check( EllenBinTreeSet& s ) - { - GC::force_dispose(); - ellen_bintree_check::check_stat( s.statistics() ); - } - - template - static inline void additional_cleanup( EllenBinTreeSet& /*s*/ ) - { - ellen_bintree_pool::internal_node_counter::reset(); - } - - template - static inline void check_before_clear( cds::container::EllenBinTreeSet& s ) - { - CPPUNIT_CHECK_CURRENT( s.check_consistency() ); - } - - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_ELLEN_BINTREE_H diff --git a/tests/unit/set2/set_type_feldman_hashset.h b/tests/unit/set2/set_type_feldman_hashset.h deleted file mode 100644 index 87cb7443..00000000 --- a/tests/unit/set2/set_type_feldman_hashset.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_MICHAEL_H -#define CDSUNIT_SET_TYPE_MICHAEL_H - -#include "set2/set_type.h" - -#include -#include -#include - -#include "print_feldman_hashset_stat.h" -#include "hashing/hash_func.h" - -namespace set2 { - - template - class FeldmanHashSet : public cc::FeldmanHashSet< GC, T, Traits > - { - typedef cc::FeldmanHashSet< GC, T, Traits > base_class; - - template - struct get_extracted_ptr - { - typedef typename base_class::guarded_ptr extracted_ptr; - }; - - template - struct get_extracted_ptr> - { - typedef typename base_class::exempt_ptr extracted_ptr; - }; - - public: - typedef typename T::hasher hasher; - typedef typename get_extracted_ptr::extracted_ptr extracted_ptr; - - template - FeldmanHashSet( Config const& cfg ) - : base_class( cfg.c_nFeldmanSet_HeadBits, cfg.c_nFeldmanSet_ArrayBits ) - {} - - template - bool erase( Q const& key ) - { - return base_class::erase( hasher()( key )); - } - - template - bool erase( Q const& key, Func f ) - { - return base_class::erase( hasher()( key ), f ); - } - - template - extracted_ptr extract(Q const& key) - { - return base_class::extract( hasher()(key) ); - } - - template - bool contains( Q const& key ) - { - return base_class::contains( hasher()(key) ); - } - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = true; - }; - - struct tag_FeldmanHashSet; - - template - struct set_type< tag_FeldmanHashSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::hash hash; - typedef typename base_class::key_type key_type; - typedef typename base_class::value_type value_type; - - template - struct hash_type - { - typedef Hasher hasher; - typedef typename hasher::hash_type type; - }; - - template - struct hash_type> - { - typedef std::hash hasher; - typedef size_t type; - }; - - template - struct key_val: base_class::key_val - { - typedef typename base_class::key_val base; - typedef Hasher hasher; - typedef typename hash_type::type hash_type; - - hash_type hash; - - /*explicit*/ key_val( key_type const& k ): base(k), hash( hasher()( k )) {} - key_val( key_type const& k, value_type const& v ): base(k, v), hash( hasher()( k )) {} - - template - /*explicit*/ key_val( K const& k ): base(k), hash( hasher()( k )) {} - - template - key_val( K const& k, T const& v ): base(k, v), hash( hasher()( k )) {} - }; - - struct default_traits : public cc::feldman_hashset::traits - { - struct hash_accessor { - template - typename key_val::hash_type const& operator()( key_val const& kv ) - { - return kv.hash; - } - }; - }; - - typedef FeldmanHashSet< cds::gc::HP, key_val>, default_traits > FeldmanHashSet_hp_stdhash; - typedef FeldmanHashSet< cds::gc::DHP, key_val>, default_traits > FeldmanHashSet_dhp_stdhash; - typedef FeldmanHashSet< rcu_gpi, key_val>, default_traits > FeldmanHashSet_rcu_gpi_stdhash; - typedef FeldmanHashSet< rcu_gpb, key_val>, default_traits > FeldmanHashSet_rcu_gpb_stdhash; - typedef FeldmanHashSet< rcu_gpt, key_val>, default_traits > FeldmanHashSet_rcu_gpt_stdhash; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val>, default_traits > FeldmanHashSet_rcu_shb_stdhash; - typedef FeldmanHashSet< rcu_sht, key_val>, default_traits > FeldmanHashSet_rcu_sht_stdhash; -#endif - - struct traits_FeldmanHashSet_stat: public cc::feldman_hashset::make_traits< - co::type_traits< default_traits >, - co::stat< cc::feldman_hashset::stat<>> - >::type - {}; - - typedef FeldmanHashSet< cds::gc::HP, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_hp_stdhash_stat; - typedef FeldmanHashSet< cds::gc::DHP, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_dhp_stdhash_stat; - typedef FeldmanHashSet< rcu_gpi, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_gpi_stdhash_stat; - typedef FeldmanHashSet< rcu_gpb, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_gpb_stdhash_stat; - typedef FeldmanHashSet< rcu_gpt, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_gpt_stdhash_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_shb_stdhash_stat; - typedef FeldmanHashSet< rcu_sht, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_sht_stdhash_stat; -#endif - - // CityHash -#if CDS_BUILD_BITS == 64 - struct traits_FeldmanHashSet_city64 : public default_traits - { - typedef ::hashing::city64::less less; - }; - typedef FeldmanHashSet< cds::gc::HP, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_hp_city64; - typedef FeldmanHashSet< cds::gc::DHP, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_dhp_city64; - typedef FeldmanHashSet< rcu_gpi, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_gpi_city64; - typedef FeldmanHashSet< rcu_gpb, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_gpb_city64; - typedef FeldmanHashSet< rcu_gpt, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_gpt_city64; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_shb_city64; - typedef FeldmanHashSet< rcu_sht, key_val<::hashing::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_sht_city64; -#endif - - struct traits_FeldmanHashSet_city64_stat : public traits_FeldmanHashSet_city64 - { - typedef cc::feldman_hashset::stat<> stat; - }; - typedef FeldmanHashSet< cds::gc::HP, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_hp_city64_stat; - typedef FeldmanHashSet< cds::gc::DHP, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_dhp_city64_stat; - typedef FeldmanHashSet< rcu_gpi, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_gpi_city64_stat; - typedef FeldmanHashSet< rcu_gpb, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_gpb_city64_stat; - typedef FeldmanHashSet< rcu_gpt, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_gpt_city64_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_shb_city64_stat; - typedef FeldmanHashSet< rcu_sht, key_val<::hashing::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_sht_city64_stat; -#endif - - struct traits_FeldmanHashSet_city128 : public default_traits - { - typedef ::hashing::city128::less less; - }; - typedef FeldmanHashSet< cds::gc::HP, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_hp_city128; - typedef FeldmanHashSet< cds::gc::DHP, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_dhp_city128; - typedef FeldmanHashSet< rcu_gpi, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_gpi_city128; - typedef FeldmanHashSet< rcu_gpb, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_gpb_city128; - typedef FeldmanHashSet< rcu_gpt, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_gpt_city128; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_shb_city128; - typedef FeldmanHashSet< rcu_sht, key_val<::hashing::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_sht_city128; -#endif - - struct traits_FeldmanHashSet_city128_stat : public traits_FeldmanHashSet_city128 - { - typedef cc::feldman_hashset::stat<> stat; - }; - typedef FeldmanHashSet< cds::gc::HP, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_hp_city128_stat; - typedef FeldmanHashSet< cds::gc::DHP, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_dhp_city128_stat; - typedef FeldmanHashSet< rcu_gpi, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_gpi_city128_stat; - typedef FeldmanHashSet< rcu_gpb, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_gpb_city128_stat; - typedef FeldmanHashSet< rcu_gpt, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_gpt_city128_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_shb_city128_stat; - typedef FeldmanHashSet< rcu_sht, key_val<::hashing::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_sht_city128_stat; -#endif - -#endif // #if CDS_BUILD_BITS == 64 - - - // for fixed-sized key - // No hash function is necessary - - struct fixed_sized_key - { - typedef typename set_type_base< Key, Val >::key_type key_type; - struct key_val : public set_type_base< Key, Val >::key_val - { - typedef typename set_type_base< Key, Val >::key_val base_class; - - /*explicit*/ key_val(key_type const& k) : base_class(k) {} - key_val(key_type const& k, value_type const& v) : base_class(k, v) {} - - template - /*explicit*/ key_val(K const& k) : base_class(k) {} - - template - key_val(K const& k, T const& v) : base_class(k, v) {} - - // mock hasher - struct hasher { - template - key_type operator()( Q const& k ) const - { - return key_type( k ); - } - }; - }; - - struct traits : public cc::feldman_hashset::traits - { - struct hash_accessor { - key_type operator()(key_val const& kv) - { - return kv.key; - } - }; - }; - - struct traits_stat : public traits - { - typedef cc::feldman_hashset::stat<> stat; - }; - }; - - typedef FeldmanHashSet< cds::gc::HP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_hp_fixed; - typedef FeldmanHashSet< cds::gc::DHP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_dhp_fixed; - typedef FeldmanHashSet< rcu_gpi, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_gpi_fixed; - typedef FeldmanHashSet< rcu_gpb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_gpb_fixed; - typedef FeldmanHashSet< rcu_gpt, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_gpt_fixed; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_shb_fixed; - typedef FeldmanHashSet< rcu_sht, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_sht_fixed; -#endif - - typedef FeldmanHashSet< cds::gc::HP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_hp_fixed_stat; - typedef FeldmanHashSet< cds::gc::DHP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_dhp_fixed_stat; - typedef FeldmanHashSet< rcu_gpi, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_gpi_fixed_stat; - typedef FeldmanHashSet< rcu_gpb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_gpb_fixed_stat; - typedef FeldmanHashSet< rcu_gpt, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_gpt_fixed_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_shb_fixed_stat; - typedef FeldmanHashSet< rcu_sht, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_sht_fixed_stat; -#endif - - }; - - template - static inline void print_stat( FeldmanHashSet< GC, T, Traits > const& s ) - { - CPPUNIT_MSG( s.statistics() ); - - std::vector< cds::intrusive::feldman_hashset::level_statistics > level_stat; - s.get_level_statistics( level_stat ); - CPPUNIT_MSG( level_stat ); - } - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_MICHAEL_H diff --git a/tests/unit/set2/set_type_lazy_list.h b/tests/unit/set2/set_type_lazy_list.h deleted file mode 100644 index 5eaa0ada..00000000 --- a/tests/unit/set2/set_type_lazy_list.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_LAZY_LIST_H -#define CDSUNIT_SET_TYPE_LAZY_LIST_H - -#include "set2/set_type.h" - -#include -#include -#include - -namespace set2 { - - template - struct lazy_list_type - { - typedef typename set_type_base< Key, Val >::key_val key_val; - typedef typename set_type_base< Key, Val >::compare compare; - typedef typename set_type_base< Key, Val >::less less; - - struct traits_LazyList_cmp_stdAlloc : - public cc::lazy_list::make_traits< - co::compare< compare > - >::type - {}; - typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_cmp_stdAlloc > LazyList_HP_cmp_stdAlloc; - typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_cmp_stdAlloc > LazyList_DHP_cmp_stdAlloc; - typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPI_cmp_stdAlloc; - typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPB_cmp_stdAlloc; - typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_SHB_cmp_stdAlloc; - typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_SHT_cmp_stdAlloc; -#endif - struct traits_LazyList_cmp_stdAlloc_seqcst : - public cc::lazy_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_HP_cmp_stdAlloc_seqcst; - typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_DHP_cmp_stdAlloc_seqcst; - typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPI_cmp_stdAlloc_seqcst; - typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPB_cmp_stdAlloc_seqcst; - typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPT_cmp_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_SHB_cmp_stdAlloc_seqcst; - typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_SHT_cmp_stdAlloc_seqcst; -#endif - struct traits_LazyList_cmp_michaelAlloc : - public cc::lazy_list::make_traits< - co::compare< compare >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_HP_cmp_michaelAlloc; - typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_DHP_cmp_michaelAlloc; - typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPI_cmp_michaelAlloc; - typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPB_cmp_michaelAlloc; - typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_SHB_cmp_michaelAlloc; - typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_SHT_cmp_michaelAlloc; -#endif - - struct traits_LazyList_less_stdAlloc: - public cc::lazy_list::make_traits< - co::less< less > - >::type - {}; - typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_less_stdAlloc > LazyList_HP_less_stdAlloc; - typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_less_stdAlloc > LazyList_DHP_less_stdAlloc; - typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_GPI_less_stdAlloc; - typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_GPB_less_stdAlloc; - typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_SHB_less_stdAlloc; - typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_SHT_less_stdAlloc; -#endif - - struct traits_LazyList_less_stdAlloc_seqcst : - public cc::lazy_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_HP_less_stdAlloc_seqcst; - typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_DHP_less_stdAlloc_seqcst; - typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPI_less_stdAlloc_seqcst; - typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPB_less_stdAlloc_seqcst; - typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_SHB_less_stdAlloc_seqcst; - typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_SHT_less_stdAlloc_seqcst; -#endif - - struct traits_LazyList_less_michaelAlloc : - public cc::lazy_list::make_traits< - co::less< less >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_less_michaelAlloc > LazyList_HP_less_michaelAlloc; - typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_less_michaelAlloc > LazyList_DHP_less_michaelAlloc; - typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPI_less_michaelAlloc; - typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPB_less_michaelAlloc; - typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_SHB_less_michaelAlloc; - typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_SHT_less_michaelAlloc; -#endif - }; - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_LAZY_LIST_H diff --git a/tests/unit/set2/set_type_michael.h b/tests/unit/set2/set_type_michael.h deleted file mode 100644 index 8d0c08bd..00000000 --- a/tests/unit/set2/set_type_michael.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_MICHAEL_H -#define CDSUNIT_SET_TYPE_MICHAEL_H - -#include "set2/set_type_michael_list.h" -#include "set2/set_type_lazy_list.h" - -#include -#include - -#include "michael_alloc.h" - -namespace set2 { - - template - class MichaelHashSet : public cc::MichaelHashSet< GC, List, Traits > - { - typedef cc::MichaelHashSet< GC, List, Traits > base_class; - public: - template - MichaelHashSet( Config const& cfg ) - : base_class( cfg.c_nSetSize, cfg.c_nLoadFactor ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_MichaelHashSet; - - template - struct set_type< tag_MichaelHashSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_val key_val; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::hash hash; - - // *************************************************************************** - // MichaelHashSet based on MichaelList - - typedef michael_list_type< Key, Val > ml; - - struct traits_MichaelSet_stdAlloc : - public cc::michael_set::make_traits< - co::hash< hash > - >::type - {}; - typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_HP_cmp_stdAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_DHP_cmp_stdAlloc; - typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPI_cmp_stdAlloc; - typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPB_cmp_stdAlloc; - typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHB_cmp_stdAlloc; - typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHT_cmp_stdAlloc; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_HP_less_stdAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_DHP_less_stdAlloc; - typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPI_less_stdAlloc; - typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPB_less_stdAlloc; - typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHB_less_stdAlloc; - typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHT_less_stdAlloc; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_HP_less_stdAlloc_seqcst; - typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_DHP_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPI_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPB_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHB_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHT_less_stdAlloc_seqcst; -#endif - - struct traits_MichaelSet_michaelAlloc : - public cc::michael_set::make_traits< - co::hash< hash >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_HP_cmp_michaelAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_DHP_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPI_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPB_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHB_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHT_cmp_michaelAlloc; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_HP_less_michaelAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_DHP_less_michaelAlloc; - typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPI_less_michaelAlloc; - typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPB_less_michaelAlloc; - typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHB_less_michaelAlloc; - typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHT_less_michaelAlloc; -#endif - - - // *************************************************************************** - // MichaelHashSet based on LazyList - - typedef lazy_list_type< Key, Val > ll; - - typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_HP_cmp_stdAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_DHP_cmp_stdAlloc; - typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPI_cmp_stdAlloc; - typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPB_cmp_stdAlloc; - typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHB_cmp_stdAlloc; - typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHT_cmp_stdAlloc; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_HP_less_stdAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_DHP_less_stdAlloc; - typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPI_less_stdAlloc; - typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPB_less_stdAlloc; - typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHB_less_stdAlloc; - typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHT_less_stdAlloc; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_HP_less_stdAlloc_seqcst; - typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_DHP_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPI_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPB_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHB_less_stdAlloc_seqcst; - typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHT_less_stdAlloc_seqcst; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_HP_cmp_michaelAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_DHP_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPI_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPB_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHB_cmp_michaelAlloc; - typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHT_cmp_michaelAlloc; -#endif - - typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_HP_less_michaelAlloc; - typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_DHP_less_michaelAlloc; - typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPI_less_michaelAlloc; - typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPB_less_michaelAlloc; - typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHB_less_michaelAlloc; - typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHT_less_michaelAlloc; -#endif - }; - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_MICHAEL_H diff --git a/tests/unit/set2/set_type_michael_list.h b/tests/unit/set2/set_type_michael_list.h deleted file mode 100644 index e2766dc6..00000000 --- a/tests/unit/set2/set_type_michael_list.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_MICHAEL_LIST_H -#define CDSUNIT_SET_TYPE_MICHAEL_LIST_H - -#include "set2/set_type.h" - -#include -#include -#include - -namespace set2 { - - template - struct michael_list_type - { - typedef typename set_type_base< Key, Val >::key_val key_val; - typedef typename set_type_base< Key, Val >::compare compare; - typedef typename set_type_base< Key, Val >::less less; - - struct traits_MichaelList_cmp_stdAlloc: - public cc::michael_list::make_traits< - co::compare< compare > - >::type - {}; - typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_HP_cmp_stdAlloc; - typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_DHP_cmp_stdAlloc; - typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPI_cmp_stdAlloc; - typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPB_cmp_stdAlloc; - typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPT_cmp_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_SHB_cmp_stdAlloc; - typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_SHT_cmp_stdAlloc; -#endif - - struct traits_MichaelList_cmp_stdAlloc_seqcst : public traits_MichaelList_cmp_stdAlloc - { - typedef co::v::sequential_consistent memory_model; - }; - typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_HP_cmp_stdAlloc_seqcst; - typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_DHP_cmp_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPI_cmp_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPB_cmp_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPT_cmp_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_SHB_cmp_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_SHT_cmp_stdAlloc_seqcst; -#endif - - struct traits_MichaelList_less_stdAlloc : - public cc::michael_list::make_traits< - co::less< less > - >::type - {}; - typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_less_stdAlloc > MichaelList_HP_less_stdAlloc; - typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_less_stdAlloc > MichaelList_DHP_less_stdAlloc; - typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPI_less_stdAlloc; - typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPB_less_stdAlloc; - typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPT_less_stdAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_SHB_less_stdAlloc; - typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_SHT_less_stdAlloc; -#endif - - struct traits_MichaelList_less_stdAlloc_seqcst : - public cc::michael_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - {}; - typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_HP_less_stdAlloc_seqcst; - typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_DHP_less_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPI_less_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPB_less_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPT_less_stdAlloc_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_SHB_less_stdAlloc_seqcst; - typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_SHT_less_stdAlloc_seqcst; -#endif - - struct traits_MichaelList_cmp_michaelAlloc : - public cc::michael_list::make_traits< - co::compare< compare >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_HP_cmp_michaelAlloc; - typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_DHP_cmp_michaelAlloc; - typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPI_cmp_michaelAlloc; - typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPB_cmp_michaelAlloc; - typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPT_cmp_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_SHB_cmp_michaelAlloc; - typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_SHT_cmp_michaelAlloc; -#endif - - struct traits_MichaelList_less_michaelAlloc : - public cc::michael_list::make_traits< - co::less< less >, - co::allocator< memory::MichaelAllocator > - >::type - {}; - typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_HP_less_michaelAlloc; - typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_DHP_less_michaelAlloc; - typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPI_less_michaelAlloc; - typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPB_less_michaelAlloc; - typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPT_less_michaelAlloc; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_SHB_less_michaelAlloc; - typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_SHT_less_michaelAlloc; -#endif - }; - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_MICHAEL_LIST_H diff --git a/tests/unit/set2/set_type_skip_list.h b/tests/unit/set2/set_type_skip_list.h deleted file mode 100644 index 3a639266..00000000 --- a/tests/unit/set2/set_type_skip_list.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H -#define CDSUNIT_SET_TYPE_SKIP_LIST_H - -#include "set2/set_type.h" - -#include -#include -#include - -#include "print_skip_list_stat.h" - -namespace set2 { - - template - class SkipListSet : public cc::SkipListSet - { - typedef cc::SkipListSet base_class; - public: - template - SkipListSet( Config const& /*cfg*/ ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_SkipListSet; - - template - struct set_type< tag_SkipListSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_val key_val; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::hash hash; - - class traits_SkipListSet_less_pascal: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_pascal > SkipListSet_hp_less_pascal; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_pascal > SkipListSet_dhp_less_pascal; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_gpi_less_pascal; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_gpb_less_pascal; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_gpt_less_pascal; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_shb_less_pascal; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_sht_less_pascal; -#endif - - class traits_SkipListSet_less_pascal_seqcst: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::memory_model< co::v::sequential_consistent > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_hp_less_pascal_seqcst; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_dhp_less_pascal_seqcst; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_gpi_less_pascal_seqcst; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_gpb_less_pascal_seqcst; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_gpt_less_pascal_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_shb_less_pascal_seqcst; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_sht_less_pascal_seqcst; -#endif - - class traits_SkipListSet_less_pascal_stat: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_hp_less_pascal_stat; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_dhp_less_pascal_stat; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_gpi_less_pascal_stat; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_gpb_less_pascal_stat; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_gpt_less_pascal_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_shb_less_pascal_stat; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_sht_less_pascal_stat; -#endif - - class traits_SkipListSet_cmp_pascal: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_hp_cmp_pascal; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_dhp_cmp_pascal; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_gpi_cmp_pascal; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_gpb_cmp_pascal; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_gpt_cmp_pascal; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_shb_cmp_pascal; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_sht_cmp_pascal; -#endif - - class traits_SkipListSet_cmp_pascal_stat: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_hp_cmp_pascal_stat; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_dhp_cmp_pascal_stat; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_gpi_cmp_pascal_stat; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_gpb_cmp_pascal_stat; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_gpt_cmp_pascal_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_shb_cmp_pascal_stat; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_sht_cmp_pascal_stat; -#endif - - class traits_SkipListSet_less_xorshift: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift > SkipListSet_hp_less_xorshift; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift > SkipListSet_dhp_less_xorshift; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_gpi_less_xorshift; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_gpb_less_xorshift; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_gpt_less_xorshift; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_shb_less_xorshift; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_sht_less_xorshift; -#endif - - class traits_SkipListSet_less_xorshift_stat: public cc::skip_list::make_traits < - co::less< less > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_hp_less_xorshift_stat; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_dhp_less_xorshift_stat; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_gpi_less_xorshift_stat; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_gpb_less_xorshift_stat; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_gpt_less_xorshift_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_shb_less_xorshift_stat; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_sht_less_xorshift_stat; -#endif - - class traits_SkipListSet_cmp_xorshift: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_hp_cmp_xorshift; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_dhp_cmp_xorshift; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_gpi_cmp_xorshift; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_gpb_cmp_xorshift; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_gpt_cmp_xorshift; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_shb_cmp_xorshift; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_sht_cmp_xorshift; -#endif - - class traits_SkipListSet_cmp_xorshift_stat: public cc::skip_list::make_traits < - co::compare< compare > - ,cc::skip_list::random_level_generator< cc::skip_list::xorshift > - ,co::stat< cc::skip_list::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_hp_cmp_xorshift_stat; - typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_dhp_cmp_xorshift_stat; - typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_gpi_cmp_xorshift_stat; - typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_gpb_cmp_xorshift_stat; - typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_gpt_cmp_xorshift_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_shb_cmp_xorshift_stat; - typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_sht_cmp_xorshift_stat; -#endif - }; - - template - static inline void print_stat( SkipListSet const& s ) - { - CPPUNIT_MSG( s.statistics() ); - } - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H diff --git a/tests/unit/set2/set_type_split_list.h b/tests/unit/set2/set_type_split_list.h deleted file mode 100644 index 7187f285..00000000 --- a/tests/unit/set2/set_type_split_list.h +++ /dev/null @@ -1,526 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_SPLIT_LIST_H -#define CDSUNIT_SET_TYPE_SPLIT_LIST_H - -#include "set2/set_type.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "print_split_list_stat.h" - -namespace set2 { - - template - class SplitListSet : public cc::SplitListSet< GC, T, Traits > - { - typedef cc::SplitListSet< GC, T, Traits > base_class; - public: - template - SplitListSet( Config const& cfg ) - : base_class( cfg.c_nSetSize, cfg.c_nLoadFactor ) - {} - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = true; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - struct tag_SplitListSet; - - template - struct set_type< tag_SplitListSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_val key_val; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::hash hash; - - // *************************************************************************** - // SplitListSet based on MichaelList - - struct traits_SplitList_Michael_dyn_cmp : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_HP_dyn_cmp; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_DHP_dyn_cmp; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPI_dyn_cmp; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPB_dyn_cmp; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPT_dyn_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_SHB_dyn_cmp; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_SHT_dyn_cmp; -#endif - - struct traits_SplitList_Michael_dyn_cmp_stat : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::stat< cc::split_list::stat<> > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_HP_dyn_cmp_stat; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_DHP_dyn_cmp_stat; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPI_dyn_cmp_stat; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPB_dyn_cmp_stat; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPT_dyn_cmp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_SHB_dyn_cmp_stat; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_SHT_dyn_cmp_stat; -#endif - - struct traits_SplitList_Michael_dyn_cmp_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_HP_dyn_cmp_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_DHP_dyn_cmp_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPI_dyn_cmp_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPB_dyn_cmp_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPT_dyn_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_SHB_dyn_cmp_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_SHT_dyn_cmp_seqcst; -#endif - - struct traits_SplitList_Michael_st_cmp : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_HP_st_cmp; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_DHP_st_cmp; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPI_st_cmp; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPB_st_cmp; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPT_st_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_SHB_st_cmp; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_SHT_st_cmp; -#endif - - struct traits_SplitList_Michael_st_cmp_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_HP_st_cmp_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_DHP_st_cmp_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_GPI_st_cmp_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_GPB_st_cmp_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_GPT_st_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_SHB_st_cmp_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_SHT_st_cmp_seqcst; -#endif - - //HP + less - struct traits_SplitList_Michael_dyn_less : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_HP_dyn_less; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_DHP_dyn_less; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPI_dyn_less; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPB_dyn_less; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPT_dyn_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_SHB_dyn_less; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_SHT_dyn_less; -#endif - - struct traits_SplitList_Michael_dyn_less_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_HP_dyn_less_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_DHP_dyn_less_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPI_dyn_less_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPB_dyn_less_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPT_dyn_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_SHB_dyn_less_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_SHT_dyn_less_seqcst; -#endif - - struct traits_SplitList_Michael_st_less : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_HP_st_less; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_DHP_st_less; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPI_st_less; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPB_st_less; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPT_st_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_SHB_st_less; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_SHT_st_less; -#endif - - struct traits_SplitList_Michael_st_less_stat : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,co::stat< cc::split_list::stat<>> - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_HP_st_less_stat; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_DHP_st_less_stat; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPI_st_less_stat; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPB_st_less_stat; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPT_st_less_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_SHB_st_less_stat; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_SHT_st_less_stat; -#endif - - struct traits_SplitList_Michael_st_less_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::michael_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_HP_st_less_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_DHP_st_less_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPI_st_less_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPB_st_less_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPT_st_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_SHB_st_less_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_SHT_st_less_seqcst; -#endif - - // *************************************************************************** - // SplitListSet based on LazyList - - struct traits_SplitList_Lazy_dyn_cmp : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_HP_dyn_cmp; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_DHP_dyn_cmp; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPI_dyn_cmp; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPB_dyn_cmp; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPT_dyn_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHB_dyn_cmp; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHT_dyn_cmp; -#endif - - struct traits_SplitList_Lazy_dyn_cmp_stat : public traits_SplitList_Lazy_dyn_cmp - { - typedef cc::split_list::stat<> stat; - }; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_HP_dyn_cmp_stat; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_DHP_dyn_cmp_stat; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPI_dyn_cmp_stat; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPB_dyn_cmp_stat; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPT_dyn_cmp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHB_dyn_cmp_stat; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHT_dyn_cmp_stat; -#endif - - struct traits_SplitList_Lazy_dyn_cmp_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_HP_dyn_cmp_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_DHP_dyn_cmp_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPI_dyn_cmp_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPB_dyn_cmp_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPT_dyn_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_SHB_dyn_cmp_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_SHT_dyn_cmp_seqcst; -#endif - - struct traits_SplitList_Lazy_st_cmp : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_HP_st_cmp; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_DHP_st_cmp; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPI_st_cmp; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPB_st_cmp; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPT_st_cmp; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_SHB_st_cmp; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_SHT_st_cmp; -#endif - - struct traits_SplitList_Lazy_st_cmp_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::compare< compare > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_HP_st_cmp_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_DHP_st_cmp_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_GPI_st_cmp_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_GPB_st_cmp_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_GPT_st_cmp_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_SHB_st_cmp_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_SHT_st_cmp_seqcst; -#endif - - struct traits_SplitList_Lazy_dyn_less : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_HP_dyn_less; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_DHP_dyn_less; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPI_dyn_less; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPB_dyn_less; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPT_dyn_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_SHB_dyn_less; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_SHT_dyn_less; -#endif - - struct traits_SplitList_Lazy_dyn_less_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_HP_dyn_less_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_DHP_dyn_less_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPI_dyn_less_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPB_dyn_less_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPT_dyn_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_SHB_dyn_less_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_SHT_dyn_less_seqcst; -#endif - - struct traits_SplitList_Lazy_st_less : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,cc::split_list::dynamic_bucket_table< false > - ,co::hash< hash > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_HP_st_less; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_DHP_st_less; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPI_st_less; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPB_st_less; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPT_st_less; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_SHB_st_less; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_SHT_st_less; -#endif - - struct traits_SplitList_Lazy_st_less_seqcst : - public cc::split_list::make_traits< - cc::split_list::ordered_list - ,co::hash< hash > - ,cc::split_list::dynamic_bucket_table< false > - ,co::memory_model< co::v::sequential_consistent > - ,cc::split_list::ordered_list_traits< - typename cc::lazy_list::make_traits< - co::less< less > - ,co::memory_model< co::v::sequential_consistent > - >::type - > - >::type - {}; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_HP_st_less_seqcst; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_DHP_st_less_seqcst; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPI_st_less_seqcst; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPB_st_less_seqcst; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPT_st_less_seqcst; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_SHB_st_less_seqcst; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_SHT_st_less_seqcst; -#endif - - struct traits_SplitList_Lazy_st_less_stat : public traits_SplitList_Lazy_st_less - { - typedef cc::split_list::stat<> stat; - }; - typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_HP_st_less_stat; - typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_DHP_st_less_stat; - typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPI_st_less_stat; - typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPB_st_less_stat; - typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPT_st_less_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_SHB_st_less_stat; - typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_SHT_st_less_stat; -#endif - }; - - template - static inline void print_stat( SplitListSet const& s ) - { - CPPUNIT_MSG( s.statistics() ); - } - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_SPLIT_LIST_H diff --git a/tests/unit/set2/set_type_std.h b/tests/unit/set2/set_type_std.h deleted file mode 100644 index 565dea5e..00000000 --- a/tests/unit/set2/set_type_std.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_STD_H -#define CDSUNIT_SET_TYPE_STD_H - -#include -#include -#include //unique_lock - -#include "set2/set_type.h" - -namespace set2 { - - struct tag_StdSet; - - template ::other - > - class StdHashSet - : public std::unordered_set< - Value - , Hash - , EqualTo - , Alloc - > - { - public: - Lock m_lock; - typedef std::unique_lock scoped_lock; - typedef std::unordered_set< - Value - , Hash - , EqualTo - , Alloc - > base_class; - - public: - typedef typename base_class::value_type value_type; - - template - StdHashSet( Config const& ) - {} - - template - bool contains( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::find( value_type(key) ) != base_class::end(); - } - - template - bool insert( Key const& key ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( value_type( key )); - return pRet.second; - } - - template - bool insert( Key const& key, Func func ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( value_type( key )); - if ( pRet.second ) { - func( *pRet.first ); - return true; - } - return false; - } - - template - std::pair ensure( const T& key, Func func ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( value_type( key )); - if ( pRet.second ) { - func( true, *pRet.first, key ); - return std::make_pair( true, true ); - } - else { - func( false, *pRet.first, key ); - return std::make_pair( true, false ); - } - } - - template - bool erase( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::erase( value_type(key) ) != 0; - } - - template - bool erase( const T& key, Func func ) - { - scoped_lock al( m_lock ); - typename base_class::iterator it = base_class::find( value_type(key) ); - if ( it != base_class::end() ) { - func( *it ); - return base_class::erase( it ) != base_class::end(); - } - return false; - } - - std::ostream& dump( std::ostream& stm ) { return stm; } - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = true; - }; - - template ::other - > - class StdSet: public std::set - { - Lock m_lock; - typedef std::unique_lock scoped_lock; - typedef std::set base_class; - public: - typedef typename base_class::key_type value_type; - - template - StdSet( Config const& ) - {} - - template - bool contains( const Key& key ) - { - value_type v( key ); - scoped_lock al( m_lock ); - return base_class::find( v ) != base_class::end(); - } - - bool insert( value_type const& v ) - { - scoped_lock al( m_lock ); - return base_class::insert( v ).second; - } - - template - bool insert( Key const& key, Func func ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( value_type( key )); - if ( pRet.second ) { - func( *pRet.first ); - return true; - } - return false; - } - - template - std::pair ensure( const T& key, Func func ) - { - scoped_lock al( m_lock ); - std::pair pRet = base_class::insert( value_type( key )); - if ( pRet.second ) { - func( true, *pRet.first, key ); - return std::make_pair( true, true ); - } - else { - func( false, *pRet.first, key ); - return std::make_pair( true, false ); - } - } - - template - bool erase( const Key& key ) - { - scoped_lock al( m_lock ); - return base_class::erase( value_type(key) ) != 0; - } - - template - bool erase( const T& key, Func func ) - { - scoped_lock al( m_lock ); - typename base_class::iterator it = base_class::find( value_type(key) ); - if ( it != base_class::end() ) { - func( *it ); - - base_class::erase( it ); - return true; - } - return false; - } - - std::ostream& dump( std::ostream& stm ) { return stm; } - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - }; - - template - struct set_type< tag_StdSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_val key_val; - typedef typename base_class::less less; - typedef typename base_class::hash hash; - typedef typename base_class::equal_to equal_to; - - typedef StdSet< key_val, less, cds::sync::spin > StdSet_Spin; - typedef StdSet< key_val, less, std::mutex > StdSet_Mutex; - typedef StdSet< key_val, less, lock::NoLock> StdSet_NoLock; - - typedef StdHashSet< key_val, hash, less, equal_to, cds::sync::spin > StdHashSet_Spin; - typedef StdHashSet< key_val, hash, less, equal_to, std::mutex > StdHashSet_Mutex; - typedef StdHashSet< key_val, hash, less, equal_to, lock::NoLock > StdHashSet_NoLock; - }; - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_STD_H diff --git a/tests/unit/set2/set_type_striped.h b/tests/unit/set2/set_type_striped.h deleted file mode 100644 index 797a4334..00000000 --- a/tests/unit/set2/set_type_striped.h +++ /dev/null @@ -1,619 +0,0 @@ -/* - This file is a part of libcds - Concurrent Data Structures library - - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 - - Source code repo: http://github.com/khizmax/libcds/ - Download: http://sourceforge.net/projects/libcds/files/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CDSUNIT_SET_TYPE_STRIPED_H -#define CDSUNIT_SET_TYPE_STRIPED_H - -#include "set2/set_type.h" - -#include -#include -#include -#include -#include - -#include -#if BOOST_VERSION >= 104800 -# include -# include -# include -# include -# include -# include -#endif -#include - -namespace set2 { - - struct tag_StripedSet; - - template - struct set_type< tag_StripedSet, Key, Val >: public set_type_base< Key, Val > - { - typedef set_type_base< Key, Val > base_class; - typedef typename base_class::key_val key_val; - typedef typename base_class::compare compare; - typedef typename base_class::less less; - typedef typename base_class::equal_to equal_to; - typedef typename base_class::hash hash; - typedef typename base_class::hash2 hash2; - - - // *************************************************************************** - // StripedSet - - // for sequential containers - template - class StripedHashSet_seq: - public cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::striping<> > - ,co::resizing_policy > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::striping<> > - ,co::resizing_policy > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - StripedHashSet_seq( Config const& cfg ) - : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nLoadFactor )) ) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - template - class StripedHashSet_seq_rational: - public cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::striping<> > - ,co::resizing_policy > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::striping<> > - ,co::resizing_policy > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - StripedHashSet_seq_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator - : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( 1, cfg.c_nLoadFactor )) ) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - // for non-sequential ordered containers - template - class StripedHashSet_ord: - public cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::striping<> > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::striping<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - StripedHashSet_ord( Config const& cfg ) - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) ) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - template - class StripedHashSet_ord_rational: - public cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::striping<> > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::striping<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - StripedHashSet_ord_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.c_nLoadFactor ))) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - static CDS_CONSTEXPR bool const c_bEraseExactKey = false; - }; - - typedef StripedHashSet_seq< - std::list< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_list; - - typedef StripedHashSet_seq_rational< - std::list< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_rational_list; - - typedef StripedHashSet_seq< - std::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_vector; - - typedef StripedHashSet_seq_rational< - std::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_rational_vector; - -#if BOOST_VERSION >= 104800 - typedef StripedHashSet_seq< - boost::container::slist< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_boost_slist; - - typedef StripedHashSet_seq_rational< - boost::container::slist< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_rational_boost_slist; - - typedef StripedHashSet_seq< - boost::container::list< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_boost_list; - - typedef StripedHashSet_seq_rational< - boost::container::list< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_rational_boost_list; - - typedef StripedHashSet_seq< - boost::container::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_boost_vector; - - typedef StripedHashSet_seq_rational< - boost::container::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_rational_boost_vector; - - typedef StripedHashSet_seq< - boost::container::stable_vector< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_boost_stable_vector; - - typedef StripedHashSet_seq_rational< - boost::container::stable_vector< key_val > - , co::hash< hash2 > - , co::less< less > - > StripedSet_rational_boost_stable_vector; -#endif - - typedef StripedHashSet_ord< - std::set< key_val, less > - , co::hash< hash2 > - > StripedSet_set; - - typedef StripedHashSet_ord_rational< - std::set< key_val, less > - , co::hash< hash2 > - > StripedSet_rational_set; - - typedef StripedHashSet_ord< - std::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > StripedSet_hashset; - - typedef StripedHashSet_ord_rational< - std::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > StripedSet_rational_hashset; - -#if BOOST_VERSION >= 104800 - typedef StripedHashSet_ord< - boost::container::set< key_val, less > - , co::hash< hash2 > - > StripedSet_boost_set; - - typedef StripedHashSet_ord_rational< - boost::container::set< key_val, less > - , co::hash< hash2 > - > StripedSet_rational_boost_set; - - typedef StripedHashSet_ord< - boost::container::flat_set< key_val, less > - , co::hash< hash2 > - > StripedSet_boost_flat_set; - - typedef StripedHashSet_ord_rational< - boost::container::flat_set< key_val, less > - , co::hash< hash2 > - > StripedSet_rational_boost_flat_set; -#endif - - typedef StripedHashSet_ord< - boost::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > StripedSet_boost_unordered_set; - - typedef StripedHashSet_ord_rational< - boost::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > StripedSet_rational_boost_unordered_set; - - - // *************************************************************************** - // RefinableSet - - // for sequential containers - template - class RefinableHashSet_seq: - public cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::refinable<> > - ,co::resizing_policy > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::refinable<> > - ,co::resizing_policy > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - RefinableHashSet_seq( Config const& cfg ) - : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nLoadFactor )) ) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - }; - - template - class RefinableHashSet_seq_rational: - public cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::refinable<> > - ,co::resizing_policy > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::mutex_policy< cc::striped_set::refinable<> > - ,co::resizing_policy > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - RefinableHashSet_seq_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator - : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( 1, cfg.c_nLoadFactor ))) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - }; - - // for non-sequential ordered containers - template - class RefinableHashSet_ord: - public cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - RefinableHashSet_ord( Config const& cfg ) - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) ) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false; - }; - - template - class RefinableHashSet_ord_rational: - public cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > - { - typedef cc::StripedSet< BucketEntry, - co::resizing_policy > - ,co::mutex_policy< cc::striped_set::refinable<> > - , Options... - > base_class; - typedef typename base_class::resizing_policy resizing_policy_t; - - resizing_policy_t m_placeHolder; - public: - template - RefinableHashSet_ord_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.c_nLoadFactor ))) - {} - - /* - template - bool erase_with( Q const& v, Less pred ) - { - return base_class::erase( v ); - } - */ - - // for testing - static CDS_CONSTEXPR bool const c_bExtractSupported = false; - static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true; - }; - - typedef RefinableHashSet_seq< - std::list< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_list; - - typedef RefinableHashSet_seq_rational< - std::list< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_rational_list; - - typedef RefinableHashSet_seq< - std::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_vector; - - typedef RefinableHashSet_seq_rational< - std::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_rational_vector; - -#if BOOST_VERSION >= 104800 - typedef RefinableHashSet_seq< - boost::container::slist< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_boost_slist; - - typedef RefinableHashSet_seq_rational< - boost::container::slist< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_rational_boost_slist; - - typedef RefinableHashSet_seq< - boost::container::list< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_boost_list; - - typedef RefinableHashSet_seq_rational< - boost::container::list< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_rational_boost_list; - - typedef RefinableHashSet_seq< - boost::container::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_boost_vector; - - typedef RefinableHashSet_seq_rational< - boost::container::vector< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_rational_boost_vector; - - typedef RefinableHashSet_seq< - boost::container::stable_vector< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_boost_stable_vector; - - typedef RefinableHashSet_seq_rational< - boost::container::stable_vector< key_val > - , co::hash< hash2 > - , co::less< less > - > RefinableSet_rational_boost_stable_vector; -#endif - - typedef RefinableHashSet_ord< - std::set< key_val, less > - , co::hash< hash2 > - > RefinableSet_set; - - typedef RefinableHashSet_ord_rational< - std::set< key_val, less > - , co::hash< hash2 > - > RefinableSet_rational_set; - - typedef RefinableHashSet_ord< - std::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > RefinableSet_hashset; - - typedef RefinableHashSet_ord_rational< - std::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > RefinableSet_rational_hashset; - -#if BOOST_VERSION >= 104800 - typedef RefinableHashSet_ord< - boost::container::set< key_val, less > - , co::hash< hash2 > - > RefinableSet_boost_set; - - typedef RefinableHashSet_ord_rational< - boost::container::set< key_val, less > - , co::hash< hash2 > - > RefinableSet_rational_boost_set; - - typedef RefinableHashSet_ord< - boost::container::flat_set< key_val, less > - , co::hash< hash2 > - > RefinableSet_boost_flat_set; - - typedef RefinableHashSet_ord_rational< - boost::container::flat_set< key_val, less > - , co::hash< hash2 > - > RefinableSet_rational_boost_flat_set; -#endif - - typedef RefinableHashSet_ord< - boost::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > RefinableSet_boost_unordered_set; - - typedef RefinableHashSet_ord_rational< - boost::unordered_set< key_val, hash, equal_to > - , co::hash< hash2 > - > RefinableSet_rational_boost_unordered_set; - }; - -} // namespace set2 - -#endif // #ifndef CDSUNIT_SET_TYPE_STRIPED_H -- 2.34.1