From 34942cfd107335e11b59e59efb4ca3b6474b1e2b Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 8 May 2016 17:01:55 +0300 Subject: [PATCH] Migrated set-insDelFind stress test to gtest framework Fixed stress test framework deadlock Simplified set stress test framework --- projects/Win/vc14/cds.sln | 34 +- .../Win/vc14/stress-set-insdelfind.vcxproj | 265 +++++++++++++++ .../stress-set-insdelfind.vcxproj.filters | 54 +++ projects/Win/vc14/unit-set-insdelfind.vcxproj | 317 ------------------ projects/source.unit.set.mk | 9 - test/include/cds_test/thread.h | 44 ++- test/stress/data/test-debug.conf | 6 +- test/stress/data/test-express.conf | 6 +- test/stress/data/test.conf | 4 +- test/stress/set/CMakeLists.txt | 2 + test/stress/set/delodd/set_delodd.h | 2 +- test/stress/set/delodd/set_delodd_cuckoo.cpp | 33 +- .../set/delodd/set_delodd_ellentree.cpp | 30 +- .../set/delodd/set_delodd_feldman_hashset.cpp | 27 +- test/stress/set/delodd/set_delodd_michael.cpp | 88 +---- test/stress/set/delodd/set_delodd_skip.cpp | 99 +----- test/stress/set/delodd/set_delodd_split.cpp | 136 +------- test/stress/set/insdel_find/CMakeLists.txt | 30 ++ .../stress/set/insdel_find/set_insdelfind.cpp | 114 +++++++ test/stress/set/insdel_find/set_insdelfind.h | 227 +++++++++++++ .../set/insdel_find/set_insdelfind_cuckoo.cpp | 38 +++ .../insdel_find/set_insdelfind_ellentree.cpp | 38 +++ .../set_insdelfind_feldman_hashset.cpp | 38 +++ .../insdel_find/set_insdelfind_michael.cpp | 38 +++ .../set/insdel_find/set_insdelfind_skip.cpp | 38 +++ .../set/insdel_find/set_insdelfind_split.cpp | 38 +++ .../set/insdel_find/set_insdelfind_std.cpp | 37 ++ .../insdel_find/set_insdelfind_striped.cpp | 39 +++ test/stress/set/set_type.h | 41 +++ test/stress/set/set_type_cuckoo.h | 34 ++ test/stress/set/set_type_ellen_bintree.h | 34 +- test/stress/set/set_type_feldman_hashset.h | 32 +- test/stress/set/set_type_michael.h | 73 ++++ test/stress/set/set_type_skip_list.h | 79 +++++ test/stress/set/set_type_split_list.h | 109 ++++++ test/stress/set/set_type_std.h | 23 +- test/stress/set/set_type_striped.h | 87 ++--- tests/unit/map2/map_insdelfind.h | 2 +- tests/unit/set2/CMakeLists.txt | 9 - 39 files changed, 1516 insertions(+), 838 deletions(-) create mode 100644 projects/Win/vc14/stress-set-insdelfind.vcxproj create mode 100644 projects/Win/vc14/stress-set-insdelfind.vcxproj.filters delete mode 100644 projects/Win/vc14/unit-set-insdelfind.vcxproj create mode 100644 test/stress/set/insdel_find/CMakeLists.txt create mode 100644 test/stress/set/insdel_find/set_insdelfind.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind.h create mode 100644 test/stress/set/insdel_find/set_insdelfind_cuckoo.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_ellentree.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_michael.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_skip.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_split.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_std.cpp create mode 100644 test/stress/set/insdel_find/set_insdelfind_striped.cpp diff --git a/projects/Win/vc14/cds.sln b/projects/Win/vc14/cds.sln index 29f183c3..ff985140 100644 --- a/projects/Win/vc14/cds.sln +++ b/projects/Win/vc14/cds.sln @@ -100,12 +100,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-insdelfind", "unit {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-set-insdelfind", "unit-set-insdelfind.vcxproj", "{DE256E91-EE96-412E-82EE-DD7BD1A1130D}" - 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("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{810490B7-31E5-49AE-8455-CAF99A9658B6}" ProjectSection(SolutionItems) = preProject ..\..\..\tests\test-hdr\size_check.h = ..\..\..\tests\test-hdr\size_check.h @@ -229,6 +223,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Header Files", "Header File ..\..\..\test\stress\set\set_type_striped.h = ..\..\..\test\stress\set\set_type_striped.h EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-insdelfind", "stress-set-insdelfind.vcxproj", "{133D1AEE-3BAF-42D1-B1AB-93D5239F4926}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -347,18 +343,6 @@ Global {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|Win32.Build.0 = Release|Win32 {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|x64.ActiveCfg = Release|x64 {CA6F0834-0628-4CD7-8800-AEABCD636360}.Release|x64.Build.0 = Release|x64 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Debug|Win32.ActiveCfg = Debug|Win32 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Debug|Win32.Build.0 = Debug|Win32 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Debug|x64.ActiveCfg = Debug|x64 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Debug|x64.Build.0 = Debug|x64 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.DebugVLD|x64.Build.0 = DebugVLD|x64 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Release|Win32.ActiveCfg = Release|Win32 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Release|Win32.Build.0 = Release|Win32 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Release|x64.ActiveCfg = Release|x64 - {DE256E91-EE96-412E-82EE-DD7BD1A1130D}.Release|x64.Build.0 = Release|x64 {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Debug|Win32.ActiveCfg = Debug|Win32 {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Debug|Win32.Build.0 = Debug|Win32 {5407E9D2-67D9-4266-976E-7A90BDE2541D}.Debug|x64.ActiveCfg = Debug|x64 @@ -563,6 +547,18 @@ Global {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|Win32.Build.0 = Release|Win32 {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|x64.ActiveCfg = Release|x64 {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|x64.Build.0 = Release|x64 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Debug|Win32.ActiveCfg = Debug|Win32 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Debug|Win32.Build.0 = Debug|Win32 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Debug|x64.ActiveCfg = Debug|x64 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Debug|x64.Build.0 = Debug|x64 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.DebugVLD|Win32.Build.0 = DebugVLD|Win32 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.DebugVLD|x64.ActiveCfg = DebugVLD|x64 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.DebugVLD|x64.Build.0 = DebugVLD|x64 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|Win32.ActiveCfg = Release|Win32 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|Win32.Build.0 = Release|Win32 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|x64.ActiveCfg = Release|x64 + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -578,7 +574,6 @@ Global {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} - {DE256E91-EE96-412E-82EE-DD7BD1A1130D} = {A64449B7-90FB-4E2B-A686-9EFC0E298644} {5407E9D2-67D9-4266-976E-7A90BDE2541D} = {810490B7-31E5-49AE-8455-CAF99A9658B6} {EA5D825A-83A4-4A36-83C1-3D048D21D55B} = {810490B7-31E5-49AE-8455-CAF99A9658B6} {ED94B1D1-2442-43C2-A71C-A757122408A6} = {810490B7-31E5-49AE-8455-CAF99A9658B6} @@ -598,6 +593,7 @@ Global {0D83E8C7-97D1-4BA1-928A-6846E7089652} = {10E1FAF2-904D-405E-8AB5-6878A1B03346} {8202D428-1E08-4744-B372-6B2E83A9928E} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} {D968B0F5-52BD-40C1-B230-28104567CE97} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926} = {0D83E8C7-97D1-4BA1-928A-6846E7089652} EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} diff --git a/projects/Win/vc14/stress-set-insdelfind.vcxproj b/projects/Win/vc14/stress-set-insdelfind.vcxproj new file mode 100644 index 00000000..e191936b --- /dev/null +++ b/projects/Win/vc14/stress-set-insdelfind.vcxproj @@ -0,0 +1,265 @@ + + + + + DebugVLD + Win32 + + + DebugVLD + x64 + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + + + + + 4503 + 4503 + 4503 + 4503 + 4503 + 4503 + + + + + + + + + {133D1AEE-3BAF-42D1-B1AB-93D5239F4926} + Win32Proj + stress_set_insdelfind + 8.1 + stress-set-insdelfind + + + + 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-insdelfind.vcxproj.filters b/projects/Win/vc14/stress-set-insdelfind.vcxproj.filters new file mode 100644 index 00000000..019c79b9 --- /dev/null +++ b/projects/Win/vc14/stress-set-insdelfind.vcxproj.filters @@ -0,0 +1,54 @@ + + + + + {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-insdelfind.vcxproj b/projects/Win/vc14/unit-set-insdelfind.vcxproj deleted file mode 100644 index 3a9efa3d..00000000 --- a/projects/Win/vc14/unit-set-insdelfind.vcxproj +++ /dev/null @@ -1,317 +0,0 @@ - - - - - DebugVLD - Win32 - - - DebugVLD - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - {DE256E91-EE96-412E-82EE-DD7BD1A1130D} - 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/source.unit.set.mk b/projects/source.unit.set.mk index d1266be2..d6047224 100644 --- a/projects/source.unit.set.mk +++ b/projects/source.unit.set.mk @@ -17,12 +17,3 @@ CDSUNIT_SET_SOURCES := \ tests/unit/set2/set_insdel_string_split.cpp \ tests/unit/set2/set_insdel_string_striped.cpp \ tests/unit/set2/set_insdel_string_std.cpp \ - tests/unit/set2/set_insdelfind.cpp \ - tests/unit/set2/set_insdelfind_cuckoo.cpp \ - tests/unit/set2/set_insdelfind_ellentree.cpp \ - tests/unit/set2/set_insdelfind_michael.cpp \ - tests/unit/set2/set_insdelfind_feldmanhashset.cpp \ - tests/unit/set2/set_insdelfind_skip.cpp \ - tests/unit/set2/set_insdelfind_split.cpp \ - tests/unit/set2/set_insdelfind_striped.cpp \ - tests/unit/set2/set_insdelfind_std.cpp \ diff --git a/test/include/cds_test/thread.h b/test/include/cds_test/thread.h index 333c2683..00ed2b36 100644 --- a/test/include/cds_test/thread.h +++ b/test/include/cds_test/thread.h @@ -81,6 +81,7 @@ namespace cds_test { thread_pool& pool() { return m_pool; } int type() const { return m_type; } size_t id() const { return m_id; } + bool time_elapsed() const; private: friend class thread_pool; @@ -100,6 +101,8 @@ namespace cds_test { , m_bRunning( false ) , m_bStopped( false ) , m_doneCount( 0 ) + , m_bTimeElapsed( false ) + , m_readyCount( 0 ) {} ~thread_pool() @@ -122,14 +125,30 @@ namespace cds_test { } std::chrono::milliseconds run() + { + return run( std::chrono::seconds::zero() ); + } + + std::chrono::milliseconds run( std::chrono::seconds duration ) { m_bStopped = false; m_doneCount = 0; + while ( m_readyCount.load() != m_threads.size() ) + std::this_thread::yield(); + + m_bTimeElapsed.store( false, std::memory_order_release ); auto time_start = std::chrono::steady_clock::now(); - m_bRunning = true; - m_cvStart.notify_all(); + { + scoped_lock l( m_cvMutex ); + m_bRunning = true; + m_cvStart.notify_all(); + } + + if ( duration != std::chrono::seconds::zero() ) + std::this_thread::sleep_for( duration ); + m_bTimeElapsed.store( true, std::memory_order_release ); { scoped_lock l( m_cvMutex ); @@ -144,7 +163,7 @@ namespace cds_test { for ( auto t : m_threads ) t->join(); - return m_testDuration = std::chrono::duration_cast( time_end - time_start ); + return m_testDuration = std::chrono::duration_cast(time_end - time_start); } size_t size() const { return m_threads.size(); } @@ -180,6 +199,7 @@ namespace cds_test { // Wait for all thread created scoped_lock l( m_cvMutex ); + m_readyCount.fetch_add( 1 ); while ( !m_bRunning ) m_cvStart.wait( l ); } @@ -191,14 +211,11 @@ namespace cds_test { { scoped_lock l( m_cvMutex ); ++m_doneCount; - } - // Tell pool that the thread is done - m_cvDone.notify_all(); - - // Wait for all thread done - { - scoped_lock l( m_cvMutex ); + // Tell pool that the thread is done + m_cvDone.notify_all(); + + // Wait for all thread done while ( !m_bStopped ) m_cvStop.wait( l ); } @@ -219,6 +236,8 @@ namespace cds_test { volatile bool m_bRunning; volatile bool m_bStopped; volatile size_t m_doneCount; + std::atomic m_bTimeElapsed; + std::atomic m_readyCount; std::chrono::milliseconds m_testDuration; }; @@ -246,6 +265,11 @@ namespace cds_test { TearDown(); } + inline bool thread::time_elapsed() const + { + return m_pool.m_bTimeElapsed.load( std::memory_order_acquire ); + } + } // namespace cds_test #endif // CDSTEST_THREAD_H diff --git a/test/stress/data/test-debug.conf b/test/stress/data/test-debug.conf index 345d37f7..14c31ce4 100644 --- a/test/stress/data/test-debug.conf +++ b/test/stress/data/test-debug.conf @@ -300,14 +300,14 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDelFind] +[map_insdelfind] InitialMapSize=50000 ThreadCount=4 MaxLoadFactor=8 InsertPercentage=5 DeletePercentage=5 -Duration=7 -PrintGCStateFlag=1 +Duration=5 + # *** Cuckoo map properties CuckooInitialSize=256 CuckooProbesetSize=8 diff --git a/test/stress/data/test-express.conf b/test/stress/data/test-express.conf index ac933e92..b6d1adc3 100644 --- a/test/stress/data/test-express.conf +++ b/test/stress/data/test-express.conf @@ -294,14 +294,14 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=8 FeldmanMapArrayBits=4 -[Map_InsDelFind] +[map_insdelfind] InitialMapSize=500000 ThreadCount=8 MaxLoadFactor=4 InsertPercentage=5 DeletePercentage=5 -Duration=15 -PrintGCStateFlag=1 +Duration=5 + # *** Cuckoo map properties CuckooInitialSize=1024 CuckooProbesetSize=16 diff --git a/test/stress/data/test.conf b/test/stress/data/test.conf index 5bf63d4b..f01954e6 100644 --- a/test/stress/data/test.conf +++ b/test/stress/data/test.conf @@ -291,14 +291,14 @@ CuckooProbesetThreshold=0 FeldmanMapHeadBits=10 FeldmanMapArrayBits=4 -[Map_InsDelFind] +[map_insdelfind] InitialMapSize=500000 ThreadCount=8 MaxLoadFactor=4 InsertPercentage=20 DeletePercentage=20 Duration=15 -PrintGCStateFlag=1 + # *** Cuckoo map properties CuckooInitialSize=1024 CuckooProbesetSize=16 diff --git a/test/stress/set/CMakeLists.txt b/test/stress/set/CMakeLists.txt index d0a5d35e..16abe9f2 100644 --- a/test/stress/set/CMakeLists.txt +++ b/test/stress/set/CMakeLists.txt @@ -2,8 +2,10 @@ 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_custom_target( stress-set DEPENDS stress-set-delodd + stress-set-insdelfind ) diff --git a/test/stress/set/delodd/set_delodd.h b/test/stress/set/delodd/set_delodd.h index 1fb37720..e07090f7 100644 --- a/test/stress/set/delodd/set_delodd.h +++ b/test/stress/set/delodd/set_delodd.h @@ -96,7 +96,7 @@ namespace set { template <> struct hash { - typedef size_t result_type; + typedef size_t result_type; typedef set::key_thread argument_type; size_t operator()( set::key_thread const& k ) const diff --git a/test/stress/set/delodd/set_delodd_cuckoo.cpp b/test/stress/set/delodd/set_delodd_cuckoo.cpp index 75a67c4c..1303177c 100644 --- a/test/stress/set/delodd/set_delodd_cuckoo.cpp +++ b/test/stress/set/delodd/set_delodd_cuckoo.cpp @@ -31,37 +31,8 @@ #include "set_delodd.h" #include "set_type_cuckoo.h" -#define CDSSTRESS_CuckooSet( cuckoo_set_type ) \ - TEST_F( Set_DelOdd, cuckoo_set_type ) \ - { \ - typedef set::set_type< tag_CuckooSet, key_thread, size_t >::cuckoo_set_type set_type; \ - run_test(); \ - } - namespace set { - CDSSTRESS_CuckooSet( CuckooStripedSet_list_unord ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_list_unord ) - CDSSTRESS_CuckooSet( CuckooStripedSet_list_unord_stat ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_list_unord_stat ) - CDSSTRESS_CuckooSet( CuckooStripedSet_list_unord_storehash ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_list_unord_storehash ) - CDSSTRESS_CuckooSet( CuckooStripedSet_list_ord ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_list_ord ) - CDSSTRESS_CuckooSet( CuckooStripedSet_list_ord_stat ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_list_ord_stat ) - CDSSTRESS_CuckooSet( CuckooStripedSet_list_ord_storehash ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_list_ord_storehash ) - CDSSTRESS_CuckooSet( CuckooStripedSet_vector_unord ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_vector_unord ) - CDSSTRESS_CuckooSet( CuckooStripedSet_vector_unord_stat ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_vector_unord_stat ) - CDSSTRESS_CuckooSet( CuckooStripedSet_vector_unord_storehash ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_vector_unord_storehash ) - CDSSTRESS_CuckooSet( CuckooStripedSet_vector_ord ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_vector_ord ) - CDSSTRESS_CuckooSet( CuckooStripedSet_vector_ord_stat ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_vector_ord_stat ) - CDSSTRESS_CuckooSet( CuckooStripedSet_vector_ord_storehash ) - CDSSTRESS_CuckooSet( CuckooRefinableSet_vector_ord_storehash ) + CDSSTRESS_CuckooSet( Set_DelOdd, run_test, key_thread, size_t ) + } // namespace set diff --git a/test/stress/set/delodd/set_delodd_ellentree.cpp b/test/stress/set/delodd/set_delodd_ellentree.cpp index 85ded33d..fc2fa2b3 100644 --- a/test/stress/set/delodd/set_delodd_ellentree.cpp +++ b/test/stress/set/delodd/set_delodd_ellentree.cpp @@ -31,36 +31,8 @@ #include "set_delodd.h" #include "set_type_ellen_bintree.h" -#define CDSSTRESS_EllenBinTreeSet( ellen_set_type ) \ - TEST_F( Set_DelOdd, ellen_set_type ) \ - { \ - typedef set::set_type< tag_EllenBinTreeSet, key_thread, size_t >::ellen_set_type set_type; \ - run_test_extract(); \ - } - namespace set { - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_hp ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_dhp ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_gpi ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_gpb ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_gpt ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_shb ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_sht ) -#endif - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_yield_hp ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_yield_dhp ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_yield_rcu_gpb ) - - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_hp_stat ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_dhp_stat ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_gpi_stat ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_gpb_stat ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_gpt_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_shb_stat ) - CDSSTRESS_EllenBinTreeSet( EllenBinTreeSet_rcu_sht_stat ) -#endif + CDSSTRESS_EllenBinTreeSet( Set_DelOdd, run_test_extract, key_thread, size_t ) } // namespace set diff --git a/test/stress/set/delodd/set_delodd_feldman_hashset.cpp b/test/stress/set/delodd/set_delodd_feldman_hashset.cpp index 5c171086..64e9f81b 100644 --- a/test/stress/set/delodd/set_delodd_feldman_hashset.cpp +++ b/test/stress/set/delodd/set_delodd_feldman_hashset.cpp @@ -31,33 +31,8 @@ #include "set_delodd.h" #include "set_type_feldman_hashset.h" -#define CDSSTRESS_FeldmanHashSet( feldman_set_type ) \ - TEST_F( Set_DelOdd, feldman_set_type ) \ - { \ - typedef set::set_type< tag_FeldmanHashSet, key_thread, size_t >::feldman_set_type set_type; \ - run_test_extract(); \ - } - namespace set { - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_hp_fixed ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_dhp_fixed ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_gpi_fixed ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_gpb_fixed ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_gpt_fixed ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_shb_fixed ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_sht_fixed ) -#endif - - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_hp_fixed_stat ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_dhp_fixed_stat ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_gpi_fixed_stat ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_gpb_fixed_stat ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_gpt_fixed_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_shb_fixed_stat ) - CDSSTRESS_FeldmanHashSet( FeldmanHashSet_rcu_sht_fixed_stat ) -#endif + CDSSTRESS_FeldmanHashSet( Set_DelOdd, run_test_extract, key_thread, size_t ) } // namespace set diff --git a/test/stress/set/delodd/set_delodd_michael.cpp b/test/stress/set/delodd/set_delodd_michael.cpp index 5dd9a851..1e2ea55f 100644 --- a/test/stress/set/delodd/set_delodd_michael.cpp +++ b/test/stress/set/delodd/set_delodd_michael.cpp @@ -31,94 +31,8 @@ #include "set_delodd.h" #include "set_type_michael.h" -#define CDSSTRESS_MichaelSet( michael_set_type ) \ - TEST_P( Set_DelOdd_LF, michael_set_type ) \ - { \ - typedef set::set_type< tag_MichaelHashSet, key_thread, size_t >::michael_set_type set_type; \ - run_test_extract(); \ - } - namespace set { - CDSSTRESS_MichaelSet( MichaelSet_HP_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_DHP_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPI_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPB_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPT_cmp_stdAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHB_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHT_cmp_stdAlloc ) -#endif - - CDSSTRESS_MichaelSet( MichaelSet_HP_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_DHP_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPI_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPB_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPT_less_stdAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHB_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHT_less_stdAlloc ) -#endif - - - CDSSTRESS_MichaelSet( MichaelSet_HP_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_DHP_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPI_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPB_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPT_cmp_michaelAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHB_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHT_cmp_michaelAlloc ) -#endif - - CDSSTRESS_MichaelSet( MichaelSet_HP_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_DHP_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPI_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPB_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_GPT_less_michaelAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHB_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_RCU_SHT_less_michaelAlloc ) -#endif - - - CDSSTRESS_MichaelSet( MichaelSet_Lazy_HP_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_DHP_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPI_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPB_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPT_cmp_stdAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHB_cmp_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHT_cmp_stdAlloc ) -#endif - - CDSSTRESS_MichaelSet( MichaelSet_Lazy_HP_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_DHP_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPI_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPB_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPT_less_stdAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHB_less_stdAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHT_less_stdAlloc ) -#endif - - CDSSTRESS_MichaelSet( MichaelSet_Lazy_HP_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_DHP_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPI_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPB_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPT_cmp_michaelAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHB_cmp_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHT_cmp_michaelAlloc ) -#endif + CDSSTRESS_MichaelSet( Set_DelOdd_LF, run_test_extract, key_thread, size_t ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_HP_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_DHP_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPI_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPB_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_GPT_less_michaelAlloc ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHB_less_michaelAlloc ) - CDSSTRESS_MichaelSet( MichaelSet_Lazy_RCU_SHT_less_michaelAlloc ) -#endif } // namespace set diff --git a/test/stress/set/delodd/set_delodd_skip.cpp b/test/stress/set/delodd/set_delodd_skip.cpp index 8d4ed31e..45263da1 100644 --- a/test/stress/set/delodd/set_delodd_skip.cpp +++ b/test/stress/set/delodd/set_delodd_skip.cpp @@ -31,105 +31,8 @@ #include "set_delodd.h" #include "set_type_skip_list.h" -#define CDSSTRESS_SkipListSet( skiplist_set_type ) \ - TEST_F( Set_DelOdd, skiplist_set_type ) \ - { \ - typedef set::set_type< tag_SkipListSet, key_thread, size_t >::skiplist_set_type set_type; \ - run_test_extract(); \ - } - namespace set { - CDSSTRESS_SkipListSet( SkipListSet_hp_less_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_less_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_less_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_less_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_less_pascal ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_less_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_less_pascal ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_less_pascal_seqcst ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_less_pascal_seqcst ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_less_pascal_seqcst ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_less_pascal_seqcst ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_less_pascal_seqcst ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_less_pascal_seqcst ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_less_pascal_seqcst ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_less_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_less_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_less_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_less_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_less_pascal_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_less_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_less_pascal_stat ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_cmp_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_cmp_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_cmp_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_cmp_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_cmp_pascal ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_cmp_pascal ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_cmp_pascal ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_cmp_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_cmp_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_cmp_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_cmp_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_cmp_pascal_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_cmp_pascal_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_cmp_pascal_stat ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_less_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_less_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_less_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_less_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_less_xorshift ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_less_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_less_xorshift ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_less_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_less_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_less_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_less_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_less_xorshift_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_less_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_less_xorshift_stat ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_cmp_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_cmp_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_cmp_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_cmp_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_cmp_xorshift ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_cmp_xorshift ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_cmp_xorshift ) -#endif - - CDSSTRESS_SkipListSet( SkipListSet_hp_cmp_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_dhp_cmp_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpi_cmp_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpb_cmp_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_gpt_cmp_xorshift_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SkipListSet( SkipListSet_rcu_shb_cmp_xorshift_stat ) - CDSSTRESS_SkipListSet( SkipListSet_rcu_sht_cmp_xorshift_stat ) -#endif - - + CDSSTRESS_SkipListSet( Set_DelOdd, run_test_extract, key_thread, size_t ) } // namespace set diff --git a/test/stress/set/delodd/set_delodd_split.cpp b/test/stress/set/delodd/set_delodd_split.cpp index ac211452..576d6ae8 100644 --- a/test/stress/set/delodd/set_delodd_split.cpp +++ b/test/stress/set/delodd/set_delodd_split.cpp @@ -31,142 +31,8 @@ #include "set_delodd.h" #include "set_type_split_list.h" -#define CDSSTRESS_SplitListSet( splitlist_set_type ) \ - TEST_P( Set_DelOdd_LF, splitlist_set_type ) \ - { \ - typedef set::set_type< tag_SplitListSet, key_thread, size_t >::splitlist_set_type set_type; \ - run_test_extract(); \ - } - namespace set { - CDSSTRESS_SplitListSet( SplitList_Michael_HP_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_dyn_cmp ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_dyn_cmp ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Michael_HP_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_dyn_cmp_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_dyn_cmp_stat ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Michael_HP_dyn_cmp_seqcst ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_dyn_cmp_seqcst ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_dyn_cmp_seqcst ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_dyn_cmp_seqcst ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_dyn_cmp_seqcst ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_dyn_cmp_seqcst ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_dyn_cmp_seqcst ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Michael_HP_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_st_cmp ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_st_cmp ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Michael_HP_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_dyn_less ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_dyn_less ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Michael_HP_st_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_st_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_st_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_st_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_st_less ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_st_less ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_st_less ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Michael_HP_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_DHP_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPI_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPB_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_GPT_st_less_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHB_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Michael_RCU_SHT_st_less_stat ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Lazy_HP_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_DHP_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPI_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPB_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPT_dyn_cmp ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHB_dyn_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHT_dyn_cmp ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Lazy_HP_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_DHP_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPI_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPB_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPT_dyn_cmp_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHB_dyn_cmp_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHT_dyn_cmp_stat ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Lazy_HP_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_DHP_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPI_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPB_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPT_st_cmp ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHB_st_cmp ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHT_st_cmp ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Lazy_HP_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_DHP_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPI_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPB_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPT_dyn_less ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHB_dyn_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHT_dyn_less ) -#endif - - CDSSTRESS_SplitListSet( SplitList_Lazy_HP_st_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_DHP_st_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPI_st_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPB_st_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPT_st_less ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHB_st_less ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHT_st_less ) -#endif + CDSSTRESS_SplitListSet( Set_DelOdd_LF, run_test_extract, key_thread, size_t ) - CDSSTRESS_SplitListSet( SplitList_Lazy_HP_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_DHP_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPI_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPB_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_GPT_st_less_stat ) -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHB_st_less_stat ) - CDSSTRESS_SplitListSet( SplitList_Lazy_RCU_SHT_st_less_stat ) -#endif } // namespace set diff --git a/test/stress/set/insdel_find/CMakeLists.txt b/test/stress/set/insdel_find/CMakeLists.txt new file mode 100644 index 00000000..dd7f88eb --- /dev/null +++ b/test/stress/set/insdel_find/CMakeLists.txt @@ -0,0 +1,30 @@ +set(PACKAGE_NAME stress-set-insdelfind) + +set(CDSSTRESS_SET_DELODD_SOURCES + ../../main.cpp + set_insdelfind.cpp + set_insdelfind_cuckoo.cpp + set_insdelfind_ellentree.cpp + set_insdelfind_feldman_hashset.cpp + set_insdelfind_michael.cpp + set_insdelfind_skip.cpp + set_insdelfind_split.cpp + set_insdelfind_std.cpp + set_insdelfind_striped.cpp +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. +) + +add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_DELODD_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_find/set_insdelfind.cpp b/test/stress/set/insdel_find/set_insdelfind.cpp new file mode 100644 index 00000000..a66f5206 --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind.cpp @@ -0,0 +1,114 @@ +/* + 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_insdelfind.h" + +namespace set { + + size_t Set_InsDelFind::s_nSetSize = 500000; // initial set size + size_t Set_InsDelFind::s_nThreadCount = 8; // thread count + size_t Set_InsDelFind::s_nMaxLoadFactor = 8; // maximum load factor + unsigned int Set_InsDelFind::s_nInsertPercentage = 5; + unsigned int Set_InsDelFind::s_nDeletePercentage = 5; + unsigned int Set_InsDelFind::s_nDuration = 30; // test duration, seconds + + size_t Set_InsDelFind::s_nCuckooInitialSize = 1024;// initial size for CuckooSet + size_t Set_InsDelFind::s_nCuckooProbesetSize = 16; // CuckooSet probeset size (only for list-based probeset) + size_t Set_InsDelFind::s_nCuckooProbesetThreshold = 0; // CUckooSet probeset threshold (0 - use default) + + size_t Set_InsDelFind::s_nFeldmanSet_HeadBits = 10; + size_t Set_InsDelFind::s_nFeldmanSet_ArrayBits = 4; + + size_t Set_InsDelFind::s_nLoadFactor = 2; + + void Set_InsDelFind::SetUpTestCase() + { + cds_test::config const& cfg = get_config( "map_insdelfind" ); + + s_nSetSize = cfg.get_size_t( "InitialMapSize", s_nSetSize ); + if ( s_nSetSize < 1000 ) + s_nSetSize = 1000; + + s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); + if ( s_nThreadCount == 0 ) + s_nThreadCount = 2; + + s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor ); + if ( s_nMaxLoadFactor == 0 ) + s_nMaxLoadFactor = 1; + + s_nInsertPercentage = cfg.get_uint( "InsertPercentage", s_nInsertPercentage ); + if ( s_nInsertPercentage == 0 || s_nInsertPercentage > 90 ) + s_nInsertPercentage = 5; + + s_nDeletePercentage = cfg.get_uint( "DeletePercentage", s_nDeletePercentage ); + if ( s_nDeletePercentage == 0 || s_nDeletePercentage > 90 ) + s_nDeletePercentage = 5; + + s_nDuration = cfg.get_uint( "Duration", s_nDuration ); + if ( s_nDuration == 0 ) + s_nDuration = 5; + + 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; + } + + std::vector Set_InsDelFind_LF::get_load_factors() + { + cds_test::config const& cfg = get_config( "map_delodd" ); + + 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_InsDelFind_LF, ::testing::ValuesIn( Set_InsDelFind_LF::get_load_factors())); +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind.h b/test/stress/set/insdel_find/set_insdelfind.h new file mode 100644 index 00000000..d8fc0fed --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind.h @@ -0,0 +1,227 @@ +/* + 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 { + + class Set_InsDelFind: public cds_test::stress_fixture + { + public: + static size_t s_nSetSize; // initial set size + static size_t s_nThreadCount; // thread count + static size_t s_nMaxLoadFactor; // maximum load factor + static unsigned int s_nInsertPercentage; + static unsigned int s_nDeletePercentage; + static unsigned int s_nDuration; // test duration, seconds + + 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 void SetUpTestCase(); + //static void TearDownTestCase(); + + 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 Worker: public cds_test::thread + { + typedef cds_test::thread base_class; + Set& m_Set; + + public: + size_t m_nInsertSuccess = 0; + size_t m_nInsertFailed = 0; + size_t m_nDeleteSuccess = 0; + size_t m_nDeleteFailed = 0; + size_t m_nFindSuccess = 0; + size_t m_nFindFailed = 0; + + public: + Worker( cds_test::thread_pool& pool, Set& set ) + : base_class( pool ) + , m_Set( set ) + {} + + Worker( Worker& src ) + : base_class( src ) + , m_Set( src.m_Set ) + {} + + virtual thread * clone() + { + return new Worker( *this ); + } + + virtual void test() + { + Set& rSet = m_Set; + Set_InsDelFind& fixture = pool().template fixture(); + + actions * pAct = fixture.m_arrShuffle; + unsigned int i = 0; + size_t const nNormalize = size_t(-1) / ( fixture.s_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 ( rSet.contains( n )) + ++m_nFindSuccess; + else + ++m_nFindFailed; + break; + case do_insert: + if ( rSet.insert( n )) + ++m_nInsertSuccess; + else + ++m_nInsertFailed; + break; + case do_delete: + if ( rSet.erase( n )) + ++m_nDeleteSuccess; + else + ++m_nDeleteFailed; + break; + } + + if ( ++i >= c_nShuffleSize ) + i = 0; + } + } + }; + + protected: + template + void do_test( Set& testSet ) + { + typedef Worker work_thread; + + // fill map - only odd number + { + size_t * pInitArr = new size_t[ s_nSetSize ]; + size_t * pEnd = pInitArr + s_nSetSize; + for ( size_t i = 0; i < s_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_test::thread_pool& pool = get_pool(); + pool.add( new work_thread( pool, testSet ), s_nThreadCount ); + + propout() << std::make_pair( "thread_count", s_nThreadCount ) + << std::make_pair( "set_size", s_nSetSize ) + << std::make_pair( "insert_percentage", s_nInsertPercentage ) + << std::make_pair( "delete_percentage", s_nDeletePercentage ) + << std::make_pair( "total_duration", s_nDuration ); + + std::chrono::milliseconds duration = pool.run( std::chrono::seconds( s_nDuration )); + + propout() << std::make_pair( "duration", duration ); + + 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 ( size_t i = 0; i < pool.size(); ++i ) { + work_thread& thr = static_cast( pool.get( i )); + nInsertSuccess += thr.m_nInsertSuccess; + nInsertFailed += thr.m_nInsertFailed; + nDeleteSuccess += thr.m_nDeleteSuccess; + nDeleteFailed += thr.m_nDeleteFailed; + nFindSuccess += thr.m_nFindSuccess; + nFindFailed += thr.m_nFindFailed; + } + + propout() + << std::make_pair( "insert_success", nInsertSuccess ) + << std::make_pair( "insert_failed", nInsertFailed ) + << std::make_pair( "delete_success", nDeleteSuccess ) + << std::make_pair( "delete_failed", nDeleteFailed ) + << std::make_pair( "find_success", nFindSuccess ) + << std::make_pair( "find_failed", nFindFailed ); + + testSet.clear(); + EXPECT_TRUE( testSet.empty()) << "set size=" << testSet.size(); + + additional_check( testSet ); + print_stat( propout(), testSet ); + additional_cleanup( testSet ); + } + + template + void run_test() + { + Set s( *this ); + do_test( s ); + } + }; + + class Set_InsDelFind_LF: public Set_InsDelFind + , public ::testing::WithParamInterface + { + public: + template + void run_test() + { + s_nLoadFactor = GetParam(); + propout() << std::make_pair( "load_factor", s_nLoadFactor ); + Set_InsDelFind::run_test(); + } + + static std::vector get_load_factors(); + }; + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_cuckoo.cpp b/test/stress/set/insdel_find/set_insdelfind_cuckoo.cpp new file mode 100644 index 00000000..8e095d2d --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_cuckoo.cpp @@ -0,0 +1,38 @@ +/* + 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_insdelfind.h" +#include "set_type_cuckoo.h" + +namespace set { + + CDSSTRESS_CuckooSet( Set_InsDelFind, run_test, size_t, size_t ) + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_ellentree.cpp b/test/stress/set/insdel_find/set_insdelfind_ellentree.cpp new file mode 100644 index 00000000..6704d282 --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_ellentree.cpp @@ -0,0 +1,38 @@ +/* + 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_insdelfind.h" +#include "set_type_ellen_bintree.h" + +namespace set { + + CDSSTRESS_EllenBinTreeSet( Set_InsDelFind, run_test, size_t, size_t ) + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp b/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp new file mode 100644 index 00000000..37543c45 --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_feldman_hashset.cpp @@ -0,0 +1,38 @@ +/* + 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_insdelfind.h" +#include "set_type_feldman_hashset.h" + +namespace set { + + CDSSTRESS_FeldmanHashSet( Set_InsDelFind, run_test, size_t, size_t ) + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_michael.cpp b/test/stress/set/insdel_find/set_insdelfind_michael.cpp new file mode 100644 index 00000000..4be7e105 --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_michael.cpp @@ -0,0 +1,38 @@ +/* + 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_insdelfind.h" +#include "set_type_michael.h" + +namespace set { + + CDSSTRESS_MichaelSet( Set_InsDelFind_LF, run_test, size_t, size_t ) + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_skip.cpp b/test/stress/set/insdel_find/set_insdelfind_skip.cpp new file mode 100644 index 00000000..7d33f64c --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_skip.cpp @@ -0,0 +1,38 @@ +/* + 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_insdelfind.h" +#include "set_type_skip_list.h" + +namespace set { + + CDSSTRESS_SkipListSet( Set_InsDelFind, run_test, size_t, size_t ) + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_split.cpp b/test/stress/set/insdel_find/set_insdelfind_split.cpp new file mode 100644 index 00000000..150a2026 --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_split.cpp @@ -0,0 +1,38 @@ +/* + 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_insdelfind.h" +#include "set_type_split_list.h" + +namespace set { + + CDSSTRESS_SplitListSet( Set_InsDelFind_LF, run_test, size_t, size_t ) + +} // namespace set diff --git a/test/stress/set/insdel_find/set_insdelfind_std.cpp b/test/stress/set/insdel_find/set_insdelfind_std.cpp new file mode 100644 index 00000000..100724d8 --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_std.cpp @@ -0,0 +1,37 @@ +/* + 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_insdelfind.h" +#include "set_type_std.h" + +namespace set { + CDSSTRESS_StdSet( Set_InsDelFind, run_test, size_t, size_t ) +} // namespace set + diff --git a/test/stress/set/insdel_find/set_insdelfind_striped.cpp b/test/stress/set/insdel_find/set_insdelfind_striped.cpp new file mode 100644 index 00000000..ceb006ed --- /dev/null +++ b/test/stress/set/insdel_find/set_insdelfind_striped.cpp @@ -0,0 +1,39 @@ +/* + 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_insdelfind.h" +#include "set_type_striped.h" + +namespace set { + + CDSSTRESS_StripedSet( Set_InsDelFind_LF, run_test, size_t, size_t ) + +} // namespace set + diff --git a/test/stress/set/set_type.h b/test/stress/set/set_type.h index 3d84ff2f..2c524ed5 100644 --- a/test/stress/set/set_type.h +++ b/test/stress/set/set_type.h @@ -83,6 +83,17 @@ namespace set { CDSUNIT_INT_COMPARE(unsigned long long); #undef CDSUNIT_INT_COMPARE +#define CDSUNIT_INT_LESS(t) template <> struct less { bool operator()( t k1, t k2 ){ return k1 < k2; } } + CDSUNIT_INT_LESS( char ); + CDSUNIT_INT_LESS( unsigned char ); + CDSUNIT_INT_LESS( int ); + CDSUNIT_INT_LESS( unsigned int ); + CDSUNIT_INT_LESS( long ); + CDSUNIT_INT_LESS( unsigned long ); + CDSUNIT_INT_LESS( long long ); + CDSUNIT_INT_LESS( unsigned long long ); +#undef CDSUNIT_INT_LESS + template <> struct cmp { @@ -100,6 +111,36 @@ namespace set { } }; + template + struct hash + { + typedef size_t result_type; + typedef T argument_type; + + size_t operator()( T const& k ) const + { + return std::hash()(k.nKey); + } + + size_t operator()( size_t k ) const + { + return std::hash()(k); + } + }; + + template <> + struct hash + { + typedef size_t result_type; + typedef size_t argument_type; + + size_t operator()( size_t k ) const + { + return std::hash()(k); + } + }; + + // forward template struct set_type; diff --git a/test/stress/set/set_type_cuckoo.h b/test/stress/set/set_type_cuckoo.h index ae939f57..5062a77d 100644 --- a/test/stress/set/set_type_cuckoo.h +++ b/test/stress/set/set_type_cuckoo.h @@ -207,4 +207,38 @@ namespace set { } // namespace set +#define CDSSTRESS_CuckooSet_case( fixture, test_case, cuckoo_set_type, key_type, value_type ) \ + TEST_F( fixture, cuckoo_set_type ) \ + { \ + typedef set::set_type< tag_CuckooSet, key_type, value_type >::cuckoo_set_type set_type; \ + test_case(); \ + } + +#define CDSSTRESS_CuckooSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_list_unord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_list_unord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_list_unord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_list_unord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_list_unord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_list_unord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_list_ord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_list_ord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_list_ord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_list_ord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_list_ord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_list_ord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_vector_unord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_vector_unord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_vector_unord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_vector_unord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_vector_unord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_vector_unord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_vector_ord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_vector_ord, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_vector_ord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_vector_ord_stat, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooStripedSet_vector_ord_storehash, key_type, value_type ) \ + CDSSTRESS_CuckooSet_case( fixture, test_case, CuckooRefinableSet_vector_ord_storehash, key_type, value_type ) \ + + #endif // #ifndef CDSUNIT_SET_TYPE_CUCKOO_H diff --git a/test/stress/set/set_type_ellen_bintree.h b/test/stress/set/set_type_ellen_bintree.h index ebb39a4b..54afe0b2 100644 --- a/test/stress/set/set_type_ellen_bintree.h +++ b/test/stress/set/set_type_ellen_bintree.h @@ -322,8 +322,40 @@ namespace set { { EXPECT_TRUE( s.check_consistency() ); } +} // namespace set +#define CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, ellen_set_type, key_type, value_type ) \ + TEST_F( fixture, ellen_set_type ) \ + { \ + typedef set::set_type< tag_EllenBinTreeSet, key_type, value_type >::ellen_set_type set_type; \ + test_case(); \ + } -} // namespace set +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +# define CDSSTRESS_EllenBinTreeSet_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_shb, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_sht, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_shb_stat, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_sht_stat, key_type, value_type ) +#else +# define CDSSTRESS_EllenBinTreeSet_SHRCU( fixture, test_case, key_type, value_type ) +#endif + + +#define CDSSTRESS_EllenBinTreeSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_hp, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_dhp, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpi, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpb, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpt, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_yield_hp, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_yield_dhp, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_yield_rcu_gpb, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_hp_stat, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_dhp_stat, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpi_stat, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpb_stat, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpt_stat, key_type, value_type ) \ + CDSSTRESS_EllenBinTreeSet_SHRCU( fixture, test_case, key_type, value_type ) #endif // #ifndef CDSUNIT_SET_TYPE_ELLEN_BINTREE_H diff --git a/test/stress/set/set_type_feldman_hashset.h b/test/stress/set/set_type_feldman_hashset.h index 12513341..03c06869 100644 --- a/test/stress/set/set_type_feldman_hashset.h +++ b/test/stress/set/set_type_feldman_hashset.h @@ -316,7 +316,37 @@ namespace set { o << s.statistics() << level_stat; } - } // namespace set +#define CDSSTRESS_FeldmanHashSet_case( fixture, test_case, feldman_set_type, key_type, value_type ) \ + TEST_F( fixture, feldman_set_type ) \ + { \ + typedef set::set_type< tag_FeldmanHashSet, key_type, value_type >::feldman_set_type set_type; \ + test_case(); \ + } + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +# define CDSSTRESS_FeldmanHashSet_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 ) +#else +# define CDSSTRESS_FeldmanHashSet_SHRCU( fixture, test_case, key_type, value_type ) +#endif + + +#define CDSSTRESS_FeldmanHashSet( 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 ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpb_fixed, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_rcu_gpt_fixed, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_hp_fixed_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashSet_case( fixture, test_case, FeldmanHashSet_dhp_fixed_stat, key_type, value_type ) \ + 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 ) + #endif // #ifndef CDSUNIT_SET_TYPE_FELDMAN_HASHSET_H diff --git a/test/stress/set/set_type_michael.h b/test/stress/set/set_type_michael.h index 854a2f34..412dfe6c 100644 --- a/test/stress/set/set_type_michael.h +++ b/test/stress/set/set_type_michael.h @@ -194,4 +194,77 @@ namespace set { } // namespace set +#define CDSSTRESS_MichaelSet_case( fixture, test_case, michael_set_type, key_type, value_type ) \ + TEST_P( fixture, michael_set_type ) \ + { \ + typedef set::set_type< tag_MichaelHashSet, key_type, value_type >::michael_set_type set_type; \ + test_case(); \ + } + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +# define CDSSTRESS_MichaelSet_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHB_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHT_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHB_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHT_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHB_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHT_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHB_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_SHT_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHB_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHT_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHB_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHT_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHB_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHT_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHB_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_SHT_less_michaelAlloc, key_type, value_type ) +#else +# define CDSSTRESS_MichaelSet_SHRCU( fixture, test_case, key_type, value_type ) +#endif + + +#define CDSSTRESS_MichaelSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_HP_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_DHP_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPI_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPB_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPT_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_HP_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_DHP_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPI_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPB_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPT_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_HP_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_DHP_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPI_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPB_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPT_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_HP_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_DHP_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPI_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPB_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_RCU_GPT_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_HP_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_DHP_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPI_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPB_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPT_cmp_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_HP_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_DHP_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPI_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPB_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPT_less_stdAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_HP_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_DHP_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPI_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPB_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPT_cmp_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_HP_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_DHP_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPI_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPB_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_case( fixture, test_case, MichaelSet_Lazy_RCU_GPT_less_michaelAlloc, key_type, value_type ) \ + CDSSTRESS_MichaelSet_SHRCU( fixture, test_case, key_type, value_type ) + #endif // #ifndef CDSUNIT_SET_TYPE_MICHAEL_H diff --git a/test/stress/set/set_type_skip_list.h b/test/stress/set/set_type_skip_list.h index 05a474a2..c1bd325e 100644 --- a/test/stress/set/set_type_skip_list.h +++ b/test/stress/set/set_type_skip_list.h @@ -225,4 +225,83 @@ namespace set { } // namespace set +#define CDSSTRESS_SkipListSet_case( fixture, test_case, skiplist_set_type, key_type, value_type ) \ + TEST_F( fixture, skiplist_set_type ) \ + { \ + typedef set::set_type< tag_SkipListSet, key_type, value_type >::skiplist_set_type set_type; \ + test_case(); \ + } + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +# define CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_pascal, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_less_pascal, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_pascal_seqcst, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_less_pascal_seqcst, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_pascal_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_less_pascal_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_pascal, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_cmp_pascal, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_pascal_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_cmp_pascal_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_xorshift, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_less_xorshift, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_xorshift_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_less_xorshift_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_xorshift, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_cmp_xorshift, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_xorshift_stat, key_type, value_type) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_sht_cmp_xorshift_stat, key_type, value_type) +#else +# define CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type ) +#endif + +#define CDSSTRESS_SkipListSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_pascal_seqcst, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_pascal_seqcst, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_pascal_seqcst, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_pascal_seqcst, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_pascal_seqcst, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_pascal, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_pascal_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_xorshift, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_xorshift_stat, key_type, value_type ) \ + CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type ) + #endif // #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H diff --git a/test/stress/set/set_type_split_list.h b/test/stress/set/set_type_split_list.h index ad7e7c11..0a2c3288 100644 --- a/test/stress/set/set_type_split_list.h +++ b/test/stress/set/set_type_split_list.h @@ -523,4 +523,113 @@ namespace set { } // namespace set + +#define CDSSTRESS_SplitListSet_case( fixture, test_case, splitlist_set_type, key_type, value_type ) \ + TEST_P( fixture, splitlist_set_type ) \ + { \ + typedef set::set_type< tag_SplitListSet, key_type, value_type >::splitlist_set_type set_type; \ + test_case(); \ + } + + +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED +# define CDSSTRESS_SplitListSet_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHB_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_SHT_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHB_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHT_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHB_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHT_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHB_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHT_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHB_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHT_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHB_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHT_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHB_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_SHT_st_less_stat, key_type, value_type ) +#else +# define CDSSTRESS_SplitListSet_SHRCU( fixture, test_case, key_type, value_type ) +#endif + +#define CDSSTRESS_SplitListSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_dyn_cmp_seqcst, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_HP_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_DHP_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPI_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPB_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Michael_RCU_GPT_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_HP_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_DHP_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPI_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPB_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPT_dyn_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_HP_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_DHP_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPI_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPB_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPT_dyn_cmp_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_HP_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_DHP_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPI_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPB_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPT_st_cmp, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_HP_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_DHP_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPI_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPB_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPT_dyn_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_HP_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_DHP_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPI_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPB_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPT_st_less, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_HP_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_DHP_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPI_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPB_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_case( fixture, test_case, SplitList_Lazy_RCU_GPT_st_less_stat, key_type, value_type ) \ + CDSSTRESS_SplitListSet_SHRCU( fixture, test_case, key_type, value_type ) + #endif // #ifndef CDSUNIT_SET_TYPE_SPLIT_LIST_H diff --git a/test/stress/set/set_type_std.h b/test/stress/set/set_type_std.h index 565dea5e..1c24f98c 100644 --- a/test/stress/set/set_type_std.h +++ b/test/stress/set/set_type_std.h @@ -35,9 +35,9 @@ #include #include //unique_lock -#include "set2/set_type.h" +#include "set_type.h" -namespace set2 { +namespace set { struct tag_StdSet; @@ -233,13 +233,26 @@ namespace set2 { 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 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; + //typedef StdHashSet< key_val, hash, less, equal_to, lock::NoLock > StdHashSet_NoLock; }; -} // namespace set2 +} // namespace set + +#define CDSSTRESS_StdSet_case( fixture, test_case, std_set_type, key_type, value_type ) \ + TEST_F( fixture, std_set_type ) \ + { \ + typedef set::set_type< tag_StdSet, key_type, value_type >::std_set_type set_type; \ + test_case(); \ + } + +#define CDSSTRESS_StdSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_StdSet_case( fixture, test_case, StdSet_Spin, key_type, value_type ) \ + CDSSTRESS_StdSet_case( fixture, test_case, StdSet_Mutex, key_type, value_type ) \ + CDSSTRESS_StdSet_case( fixture, test_case, StdHashSet_Spin, key_type, value_type ) \ + CDSSTRESS_StdSet_case( fixture, test_case, StdHashSet_Mutex, key_type, value_type ) #endif // #ifndef CDSUNIT_SET_TYPE_STD_H diff --git a/test/stress/set/set_type_striped.h b/test/stress/set/set_type_striped.h index 797a4334..97a39557 100644 --- a/test/stress/set/set_type_striped.h +++ b/test/stress/set/set_type_striped.h @@ -31,7 +31,7 @@ #ifndef CDSUNIT_SET_TYPE_STRIPED_H #define CDSUNIT_SET_TYPE_STRIPED_H -#include "set2/set_type.h" +#include "set_type.h" #include #include @@ -50,7 +50,7 @@ #endif #include -namespace set2 { +namespace set { struct tag_StripedSet; @@ -89,7 +89,7 @@ namespace set2 { 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 )) ) + : base_class( cfg.s_nSetSize / cfg.s_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.s_nLoadFactor )) ) {} /* @@ -125,7 +125,7 @@ namespace set2 { 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 )) ) + : base_class( cfg.s_nSetSize / cfg.s_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( 1, cfg.s_nLoadFactor )) ) {} /* @@ -162,17 +162,9 @@ namespace set2 { public: template StripedHashSet_ord( Config const& cfg ) - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) ) + : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.s_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; @@ -198,17 +190,9 @@ namespace set2 { public: template StripedHashSet_ord_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.c_nLoadFactor ))) + : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.s_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; @@ -365,7 +349,7 @@ namespace set2 { 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 )) ) + : base_class( cfg.s_nSetSize / cfg.s_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.s_nLoadFactor )) ) {} /* @@ -400,17 +384,9 @@ namespace set2 { 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 ))) + : base_class( cfg.s_nSetSize / cfg.s_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( 1, cfg.s_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; @@ -436,17 +412,9 @@ namespace set2 { public: template RefinableHashSet_ord( Config const& cfg ) - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) ) + : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.s_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; @@ -471,17 +439,9 @@ namespace set2 { public: template RefinableHashSet_ord_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator - : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.c_nLoadFactor ))) + : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.s_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; @@ -614,6 +574,31 @@ namespace set2 { > RefinableSet_rational_boost_unordered_set; }; -} // namespace set2 +} // namespace set + +#define CDSSTRESS_StripedSet_case( fixture, test_case, striped_set_type, key_type, value_type ) \ + TEST_P( fixture, striped_set_type ) \ + { \ + typedef set::set_type< tag_StripedSet, key_type, value_type >::striped_set_type set_type; \ + test_case(); \ + } + +#define CDSSTRESS_StripedSet( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_list, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_rational_list, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_vector, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_rational_vector, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_set, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_rational_set, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_hashset, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, StripedSet_rational_hashset, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_list, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_rational_list, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_vector, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_rational_vector, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_set, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_rational_set, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_hashset, key_type, value_type ) \ + CDSSTRESS_StripedSet_case( fixture, test_case, RefinableSet_rational_hashset, key_type, value_type ) #endif // #ifndef CDSUNIT_SET_TYPE_STRIPED_H diff --git a/tests/unit/map2/map_insdelfind.h b/tests/unit/map2/map_insdelfind.h index f6ac4b08..208d8cbd 100644 --- a/tests/unit/map2/map_insdelfind.h +++ b/tests/unit/map2/map_insdelfind.h @@ -290,7 +290,7 @@ namespace map2 { CDSUNIT_DECLARE_CuckooMap CDSUNIT_DECLARE_StdMap - CPPUNIT_TEST_SUITE(Map_InsDelFind) + CPPUNIT_TEST_SUITE_(Map_InsDelFind, "map_insdelfind") CDSUNIT_TEST_MichaelMap CDSUNIT_TEST_SplitList CDSUNIT_TEST_SkipListMap diff --git a/tests/unit/set2/CMakeLists.txt b/tests/unit/set2/CMakeLists.txt index f61bce07..287feaeb 100644 --- a/tests/unit/set2/CMakeLists.txt +++ b/tests/unit/set2/CMakeLists.txt @@ -18,15 +18,6 @@ set(CDSUNIT_SET_SOURCES set_insdel_string_split.cpp set_insdel_string_striped.cpp set_insdel_string_std.cpp - set_insdelfind.cpp - set_insdelfind_cuckoo.cpp - set_insdelfind_ellentree.cpp - set_insdelfind_michael.cpp - set_insdelfind_feldmanhashset.cpp - set_insdelfind_skip.cpp - set_insdelfind_split.cpp - set_insdelfind_striped.cpp - set_insdelfind_std.cpp ) add_executable(${PACKAGE_NAME} ${CDSUNIT_SET_SOURCES} $) -- 2.34.1