ProjectSection(SolutionItems) = preProject\r
..\..\..\test\include\cds_test\check_size.h = ..\..\..\test\include\cds_test\check_size.h\r
..\..\..\test\include\cds_test\fixture.h = ..\..\..\test\include\cds_test\fixture.h\r
+ ..\..\..\test\include\cds_test\hash_func.h = ..\..\..\test\include\cds_test\hash_func.h\r
+ ..\..\..\test\include\cds_test\stat_cuckoo_out.h = ..\..\..\test\include\cds_test\stat_cuckoo_out.h\r
..\..\..\test\include\cds_test\stat_ellenbintree_out.h = ..\..\..\test\include\cds_test\stat_ellenbintree_out.h\r
+ ..\..\..\test\include\cds_test\stat_feldman_hashset_out.h = ..\..\..\test\include\cds_test\stat_feldman_hashset_out.h\r
..\..\..\test\include\cds_test\stat_skiplist_out.h = ..\..\..\test\include\cds_test\stat_skiplist_out.h\r
+ ..\..\..\test\include\cds_test\stat_splitlist_out.h = ..\..\..\test\include\cds_test\stat_splitlist_out.h\r
..\..\..\test\include\cds_test\stress_test.h = ..\..\..\test\include\cds_test\stress_test.h\r
..\..\..\test\include\cds_test\thread.h = ..\..\..\test\include\cds_test\thread.h\r
EndProjectSection\r
{408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
EndProjectSection\r
EndProject\r
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "set", "set", "{0D83E8C7-97D1-4BA1-928A-6846E7089652}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-delodd", "stress-set-delodd.vcxproj", "{8202D428-1E08-4744-B372-6B2E83A9928E}"\r
+ ProjectSection(ProjectDependencies) = postProject\r
+ {A34CED07-A442-4FA1-81C4-F8B9CD3C832B} = {A34CED07-A442-4FA1-81C4-F8B9CD3C832B}\r
+ {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
+ EndProjectSection\r
+EndProject\r
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Header Files", "Header Files", "{D968B0F5-52BD-40C1-B230-28104567CE97}"\r
+ ProjectSection(SolutionItems) = preProject\r
+ ..\..\..\test\stress\set\set_type.h = ..\..\..\test\stress\set\set_type.h\r
+ ..\..\..\test\stress\set\set_type_cuckoo.h = ..\..\..\test\stress\set\set_type_cuckoo.h\r
+ ..\..\..\test\stress\set\set_type_ellen_bintree.h = ..\..\..\test\stress\set\set_type_ellen_bintree.h\r
+ ..\..\..\test\stress\set\set_type_feldman_hashset.h = ..\..\..\test\stress\set\set_type_feldman_hashset.h\r
+ ..\..\..\test\stress\set\set_type_lazy_list.h = ..\..\..\test\stress\set\set_type_lazy_list.h\r
+ ..\..\..\test\stress\set\set_type_michael.h = ..\..\..\test\stress\set\set_type_michael.h\r
+ ..\..\..\test\stress\set\set_type_michael_list.h = ..\..\..\test\stress\set\set_type_michael_list.h\r
+ ..\..\..\test\stress\set\set_type_skip_list.h = ..\..\..\test\stress\set\set_type_skip_list.h\r
+ ..\..\..\test\stress\set\set_type_split_list.h = ..\..\..\test\stress\set\set_type_split_list.h\r
+ ..\..\..\test\stress\set\set_type_std.h = ..\..\..\test\stress\set\set_type_std.h\r
+ ..\..\..\test\stress\set\set_type_striped.h = ..\..\..\test\stress\set\set_type_striped.h\r
+ EndProjectSection\r
+EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
Debug|Win32 = Debug|Win32\r
{FA22E700-1AE5-4D7B-B9F1-0A919FF7FF06}.Release|Win32.Build.0 = Release|Win32\r
{FA22E700-1AE5-4D7B-B9F1-0A919FF7FF06}.Release|x64.ActiveCfg = Release|x64\r
{FA22E700-1AE5-4D7B-B9F1-0A919FF7FF06}.Release|x64.Build.0 = Release|x64\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Debug|Win32.Build.0 = Debug|Win32\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Debug|x64.ActiveCfg = Debug|x64\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Debug|x64.Build.0 = Debug|x64\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|Win32.ActiveCfg = Release|Win32\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|Win32.Build.0 = Release|Win32\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|x64.ActiveCfg = Release|x64\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E}.Release|x64.Build.0 = Release|x64\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
{00FD5CB8-E1A4-40CA-B613-30A06A75622B} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
{2ABD6A2E-BEA7-4C8C-982B-A609F83D2DCB} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
{FA22E700-1AE5-4D7B-B9F1-0A919FF7FF06} = {810490B7-31E5-49AE-8455-CAF99A9658B6}\r
+ {0D83E8C7-97D1-4BA1-928A-6846E7089652} = {10E1FAF2-904D-405E-8AB5-6878A1B03346}\r
+ {8202D428-1E08-4744-B372-6B2E83A9928E} = {0D83E8C7-97D1-4BA1-928A-6846E7089652}\r
+ {D968B0F5-52BD-40C1-B230-28104567CE97} = {0D83E8C7-97D1-4BA1-928A-6846E7089652}\r
EndGlobalSection\r
GlobalSection(DPCodeReviewSolutionGUID) = preSolution\r
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\..\..\test\include\cds_test\stress_test.h" />\r
+ <ClInclude Include="..\..\..\test\stress\framework\ellen_bintree_update_desc_pool.h" />\r
<ClInclude Include="..\..\..\test\stress\framework\michael_alloc.h" />\r
</ItemGroup>\r
<ItemGroup>\r
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4267</DisableSpecificWarnings>\r
</ClCompile>\r
<ClCompile Include="..\..\..\test\stress\framework\config.cpp" />\r
+ <ClCompile Include="..\..\..\test\stress\framework\ellen_bintree_update_desc_pool.cpp" />\r
<ClCompile Include="..\..\..\test\stress\framework\michael_alloc.cpp" />\r
<ClCompile Include="..\..\..\test\stress\framework\stress_test.cpp" />\r
</ItemGroup>\r
<ClInclude Include="..\..\..\test\stress\framework\michael_alloc.h">\r
<Filter>Header Files</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\..\test\stress\framework\ellen_bintree_update_desc_pool.h">\r
+ <Filter>Header Files</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
<ClCompile Include="..\..\..\test\stress\framework\config.cpp">\r
<ClCompile Include="..\..\..\test\stress\framework\michael_alloc.cpp">\r
<Filter>Source Files</Filter>\r
</ClCompile>\r
+ <ClCompile Include="..\..\..\test\stress\framework\ellen_bintree_update_desc_pool.cpp">\r
+ <Filter>Source Files</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<CustomBuild Include="..\..\..\test\stress\data\text.txt" />\r
<OptimizeReferences>true</OptimizeReferences>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
- <AdditionalDependencies>gtest.lib;stres-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
<OptimizeReferences>true</OptimizeReferences>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
- <AdditionalDependencies>gtest.lib;stres-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<OptimizeReferences>true</OptimizeReferences>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
- <AdditionalDependencies>gtest.lib;stres-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
<OptimizeReferences>true</OptimizeReferences>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
- <AdditionalDependencies>gtest.lib;stres-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="DebugVLD|Win32">
+ <Configuration>DebugVLD</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="DebugVLD|x64">
+ <Configuration>DebugVLD</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\test\stress\main.cpp" />
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd.cpp" />
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_cuckoo.cpp">
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_ellentree.cpp">
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_feldman_hashset.cpp" />
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_michael.cpp" />
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_skip.cpp" />
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_split.cpp">
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\test\stress\set\delodd\set_delodd.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8202D428-1E08-4744-B372-6B2E83A9928E}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>stress_set_delodd</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>stress-set-delodd</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)_d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)_d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)_d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)_d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>
+ <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>
+ <IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>gtestd.lib;stress-framework_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;CDSUNIT_USE_URCU;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(SolutionDir)..\..\..\test\stress\set;$(SolutionDir)..\..\..\test\stress\;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\test\stress\main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_michael.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_split.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_skip.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_ellentree.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_feldman_hashset.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\test\stress\set\delodd\set_delodd_cuckoo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\test\stress\set\delodd\set_delodd.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
<OptimizeReferences>true</OptimizeReferences>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
- <AdditionalDependencies>gtest.lib;stres-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
<OptimizeReferences>true</OptimizeReferences>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>\r
- <AdditionalDependencies>gtest.lib;stres-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <AdditionalDependencies>gtest.lib;stress-framework.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
#include <cds/details/defs.h>
#if CDS_BUILD_BITS == 64
-# include "hashing/city.h"
+# include <cds_test/city.h>
#endif
-namespace hashing {
+namespace cds_test {
#if CDS_BUILD_BITS == 64
class city32 {
#endif // #if CDS_BUILD_BITS == 64
-} // namespace hashing
+} // namespace cds_test
#endif // #ifndef CDSUNIT_HASH_FUNC_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSTEST_STAT_CUCKOO_OUT_H
+#define CDSTEST_STAT_CUCKOO_OUT_H
+
+#include <cds/intrusive/cuckoo_set.h>
+
+namespace cds_test {
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::cuckoo::striping_stat const& s )
+ {
+ return o
+ << CDSSTRESS_STAT_OUT( s, m_nCellLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nCellLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nCellTryLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nFullLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeCount );
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::cuckoo::empty_striping_stat const& /*s*/ )
+ {
+ return o;
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::cuckoo::refinable_stat const& s )
+ {
+ return o
+ << CDSSTRESS_STAT_OUT( s, m_nCellLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nCellLockWaitResizing )
+ << CDSSTRESS_STAT_OUT( s, m_nCellLockArrayChanged )
+ << CDSSTRESS_STAT_OUT( s, m_nCellLockFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nSecondCellLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nSecondCellLockFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nFullLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nFullLockIter )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeLockCount )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeLockIter )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeLockArrayChanged )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeCount );
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::cuckoo::empty_refinable_stat const& /*s*/ )
+ {
+ return o;
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::cuckoo::stat const& s )
+ {
+ return o
+ << CDSSTRESS_STAT_OUT( s, m_nRelocateCallCount )
+ << CDSSTRESS_STAT_OUT( s, m_nRelocateRoundCount )
+ << CDSSTRESS_STAT_OUT( s, m_nFalseRelocateCount )
+ << CDSSTRESS_STAT_OUT( s, m_nSuccessRelocateCount )
+ << CDSSTRESS_STAT_OUT( s, m_nRelocateAboveThresholdCount )
+ << CDSSTRESS_STAT_OUT( s, m_nFailedRelocateCount )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeCallCount )
+ << CDSSTRESS_STAT_OUT( s, m_nFalseResizeCount )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeSuccessNodeMove )
+ << CDSSTRESS_STAT_OUT( s, m_nResizeRelocateCall )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertResizeCount )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertRelocateCount )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertRelocateFault )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateExistCount )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateSuccessCount )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateResizeCount )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateRelocateCount )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateRelocateFault )
+ << CDSSTRESS_STAT_OUT( s, m_nUnlinkSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nUnlinkFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nFindSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nFindFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nFindWithSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nFindWithFailed );
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::cuckoo::empty_stat const& /*s*/ )
+ {
+ return o;
+ }
+
+} // namespace cds_test
+
+#endif // #ifndef CDSTEST_STAT_CUCKOO_OUT_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSTEST_STAT_FELDMAN_HASHSET_OUT_H
+#define CDSTEST_STAT_FELDMAN_HASHSET_OUT_H
+
+#include <cds_test/stress_test.h>
+#include <cds/intrusive/details/feldman_hashset_base.h>
+
+namespace cds_test {
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::feldman_hashset::empty_stat const& /*s*/ )
+ {
+ return o;
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::feldman_hashset::stat<> const& s )
+ {
+ return o
+ << CDSSTRESS_STAT_OUT( s, m_nInsertSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertRetry )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateNew )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateExisting )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateRetry )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseRetry )
+ << CDSSTRESS_STAT_OUT( s, m_nFindSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nFindFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nExpandNodeSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nExpandNodeFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nSlotChanged )
+ << CDSSTRESS_STAT_OUT( s, m_nSlotConverting )
+ << CDSSTRESS_STAT_OUT( s, m_nArrayNodeCount )
+ << CDSSTRESS_STAT_OUT( s, m_nHeight );
+ }
+
+ static inline property_stream& operator<<( property_stream& o, std::vector< cds::intrusive::feldman_hashset::level_statistics > const& level_stat )
+ {
+# define CDSSTRESS_LEVELSTAT_OUT( level, field ) \
+ CDSSTRESS_STAT_OUT_( "level_stat." + std::to_string(level) + "." + #field, it->field )
+
+ o << CDSSTRESS_STAT_OUT_( "stat.level_count", level_stat.size() );
+ size_t i = 0;
+ for ( auto it = level_stat.begin(); it != level_stat.end(); ++it, ++i ) {
+ o << CDSSTRESS_LEVELSTAT_OUT( i, array_node_count )
+ << CDSSTRESS_LEVELSTAT_OUT( i, node_capacity )
+ << CDSSTRESS_LEVELSTAT_OUT( i, data_cell_count )
+ << CDSSTRESS_LEVELSTAT_OUT( i, array_cell_count )
+ << CDSSTRESS_LEVELSTAT_OUT( i, empty_cell_count );
+ }
+ return o;
+# undef CDSSTRESS_LEVELSTAT_OUT
+ }
+
+} // namespace std
+
+#endif // #ifndef CDSTEST_STAT_FELDMAN_HASHSET_OUT_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSTEST_STAT_SPLITLIST_OUT_H
+#define CDSTEST_STAT_SPLITLIST_OUT_H
+
+#include <cds/intrusive/details/split_list_base.h>
+
+namespace cds_test {
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::split_list::empty_stat const& /*s*/ )
+ {
+ return o;
+ }
+
+ static inline property_stream& operator <<( property_stream& o, cds::intrusive::split_list::stat<> const& s )
+ {
+ return o
+ << CDSSTRESS_STAT_OUT( s, m_nInsertSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nInsertFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateExist )
+ << CDSSTRESS_STAT_OUT( s, m_nUpdateNew )
+ << CDSSTRESS_STAT_OUT( s, m_nExtractSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nExtractFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nEraseFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nFindSuccess )
+ << CDSSTRESS_STAT_OUT( s, m_nFindFailed )
+ << CDSSTRESS_STAT_OUT( s, m_nHeadNodeAllocated )
+ << CDSSTRESS_STAT_OUT( s, m_nHeadNodeFreed )
+ << CDSSTRESS_STAT_OUT( s, m_nBucketCount )
+ << CDSSTRESS_STAT_OUT( s, m_nInitBucketRecursive )
+ << CDSSTRESS_STAT_OUT( s, m_nInitBucketContention )
+ << CDSSTRESS_STAT_OUT( s, m_nBusyWaitBucketInit );
+ }
+
+} // namespace cds_test
+
+#endif // #ifndef CDSTEST_STAT_SPLITLIST_OUT_H
return s;
}
+ template <typename T>
+ static inline property_stream& operator <<( property_stream& s, std::pair<std::string, T > prop )
+ {
+ std::stringstream ss;
+ ss << prop.second;
+ ::testing::Test::RecordProperty( prop.first.c_str(), ss.str().c_str() );
+ return s;
+ }
+
static inline property_stream& operator <<( property_stream& s, std::pair<char const *, std::chrono::milliseconds > prop )
{
std::stringstream ss;
set(CDSSTRESS_FRAMEWORK_SOURCES
framework/city.cpp
framework/config.cpp
+ framework/ellen_bintree_update_desc_pool.cpp
framework/michael_alloc.cpp
framework/stress_test.cpp
)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/pqueue)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/queue)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/set)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/stack)
add_custom_target( stress-all
stress-pqueue
stress-queue
stress-stack
+ stress-set
)
file(GLOB CONF_FILES ${PROJECT_SOURCE_DIR}/test/stress/data/*.conf)
dhp_init_guard_count=8\r
dhp_epoch_count=16\r
\r
+# cds::urcu::gc initialization parameters\r
+rcu_buffer_size=256\r
+\r
[Atomic_ST]\r
iterCount=10000\r
\r
FeldmanMapHeadBits=8\r
FeldmanMapArrayBits=4\r
\r
-[Map_DelOdd]\r
+[map_delodd]\r
MapSize=50000\r
InsThreadCount=2\r
DelThreadCount=2\r
ExtractThreadCount=2\r
MaxLoadFactor=4\r
-PrintGCStateFlag=1\r
+\r
#Cuckoo map properties\r
CuckooInitialSize=256\r
CuckooProbesetSize=8\r
dhp_init_guard_count=16\r
dhp_epoch_count=16\r
\r
+# cds::urcu::gc initialization parameters\r
+rcu_buffer_size=256\r
+\r
[Atomic_ST]\r
iterCount=1000000\r
\r
FeldmanMapHeadBits=8\r
FeldmanMapArrayBits=4\r
\r
-[Map_DelOdd]\r
+[map_delodd]\r
MapSize=500000\r
InsThreadCount=4\r
DelThreadCount=3\r
ExtractThreadCount=3\r
MaxLoadFactor=4\r
-PrintGCStateFlag=1\r
+\r
#Cuckoo map properties\r
CuckooInitialSize=1024\r
CuckooProbesetSize=16\r
dhp_init_guard_count=16\r
dhp_epoch_count=16\r
\r
+# cds::urcu::gc initialization parameters\r
+rcu_buffer_size=256\r
+\r
[Atomic_ST]\r
iterCount=1000000\r
\r
FeldmanMapArrayBits=4\r
\r
\r
-[Map_DelOdd]\r
+[map_delodd]\r
MapSize=1000000\r
InsThreadCount=4\r
DelThreadCount=3\r
ExtractThreadCount=3\r
MaxLoadFactor=4\r
-PrintGCStateFlag=1\r
+\r
#Cuckoo map properties\r
CuckooInitialSize=1024\r
CuckooProbesetSize=16\r
--- /dev/null
+/*
+ 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 "ellen_bintree_update_desc_pool.h"
+
+namespace ellen_bintree_pool {
+ update_desc_pool_type s_UpdateDescPool;
+
+ bounded_update_desc_pool_type s_BoundedUpdateDescPool;
+
+ cds::atomicity::event_counter internal_node_counter::m_nAlloc;
+ cds::atomicity::event_counter internal_node_counter::m_nFree;
+}
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_ELLEN_BINTREE_UPDATE_DESC_POOL_H
+#define CDSUNIT_ELLEN_BINTREE_UPDATE_DESC_POOL_H
+
+#include <cds/urcu/general_instant.h>
+#include <cds/container/details/ellen_bintree_base.h>
+#include <cds/memory/vyukov_queue_pool.h>
+#include <cds/memory/pool_allocator.h>
+
+namespace ellen_bintree_pool {
+ typedef cds::container::ellen_bintree::node_types< cds::urcu::gc< cds::urcu::general_instant<> >, int > node_types; // fake
+ typedef node_types::leaf_node_type leaf_node;
+ typedef node_types::internal_node_type internal_node;
+ typedef node_types::update_desc_type update_desc;
+
+ // Update descriptor pool based on Vyukov's queue
+ struct update_desc_pool_traits : public cds::memory::vyukov_queue_pool_traits
+ {
+ typedef cds::opt::v::static_buffer< cds::any_type, 4096 > buffer;
+ };
+
+ typedef cds::memory::vyukov_queue_pool< update_desc, update_desc_pool_traits > update_desc_pool_type;
+ extern update_desc_pool_type s_UpdateDescPool;
+
+ struct update_desc_pool_accessor {
+ typedef update_desc_pool_type::value_type value_type;
+
+ update_desc_pool_type& operator()() const
+ {
+ return s_UpdateDescPool;
+ }
+ };
+
+ // Update descriptor pool based on bounded Vyukov's queue
+ struct bounded_update_desc_pool_traits : public cds::memory::vyukov_queue_pool_traits
+ {
+ typedef cds::opt::v::static_buffer< cds::any_type, 4096 > buffer;
+ };
+ typedef cds::memory::bounded_vyukov_queue_pool< update_desc, bounded_update_desc_pool_traits > bounded_update_desc_pool_type;
+ extern bounded_update_desc_pool_type s_BoundedUpdateDescPool;
+
+ struct bounded_update_desc_pool_accessor {
+ typedef bounded_update_desc_pool_type::value_type value_type;
+
+ bounded_update_desc_pool_type& operator()() const
+ {
+ return s_BoundedUpdateDescPool;
+ }
+ };
+
+
+ // Internal node allocator
+ struct internal_node_counter
+ {
+ static cds::atomicity::event_counter m_nAlloc;
+ static cds::atomicity::event_counter m_nFree;
+
+ static void onAlloc()
+ {
+ ++m_nAlloc;
+ }
+ static void onFree()
+ {
+ ++m_nFree;
+ }
+
+ static void reset()
+ {
+ m_nAlloc.reset();
+ m_nFree.reset();
+ }
+ };
+
+ template <typename T, typename Alloc = CDS_DEFAULT_ALLOCATOR>
+ class internal_node_allocator
+ : public Alloc::template rebind< T >::other
+ , internal_node_counter
+ {
+ typedef typename Alloc::template rebind< T >::other base_class;
+ public:
+ template <typename Other>
+ struct rebind {
+ typedef internal_node_allocator< Other, Alloc > other;
+ };
+
+ T * allocate( size_t n, void const * pHint = nullptr )
+ {
+ internal_node_counter::onAlloc();
+ T * p = base_class::allocate( n, pHint );
+ return p;
+ }
+
+ void deallocate( T * p, size_t n )
+ {
+ internal_node_counter::onFree();
+ return base_class::deallocate( p, n );
+ }
+ };
+
+} // namespace ellen_bintree_pool
+
+#endif // #ifndef CDSUNIT_ELLEN_BINTREE_UPDATE_DESC_POOL_H
s_nProducerDone.fetch_add( 1 );
}
+
public:
Queue& m_Queue;
size_t m_nPushFailed;
--- /dev/null
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_USE_URCU")
+
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd)
+
+add_custom_target( stress-set
+ DEPENDS
+ stress-set-delodd
+)
--- /dev/null
+set(PACKAGE_NAME stress-set-delodd)
+
+set(CDSSTRESS_SET_DELODD_SOURCES
+ ../../main.cpp
+ set_delodd.cpp
+ set_delodd_cuckoo.cpp
+ set_delodd_ellentree.cpp
+ set_delodd_feldman_hashset.cpp
+ set_delodd_michael.cpp
+ set_delodd_skip.cpp
+ set_delodd_split.cpp
+)
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/..
+)
+
+add_executable(${PACKAGE_NAME} ${CDSSTRESS_SET_DELODD_SOURCES} $<TARGET_OBJECTS:${CDSSTRESS_FRAMEWORK_LIBRARY}>)
+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
--- /dev/null
+/*
+ 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_delodd.h"
+
+namespace set {
+
+ size_t Set_DelOdd::s_nSetSize = 1000000;
+ size_t Set_DelOdd::s_nInsThreadCount = 4;
+ size_t Set_DelOdd::s_nDelThreadCount = 4;
+ size_t Set_DelOdd::s_nExtractThreadCount = 4;
+ size_t Set_DelOdd::s_nMaxLoadFactor = 8;
+
+ size_t Set_DelOdd::s_nCuckooInitialSize = 1024;
+ size_t Set_DelOdd::s_nCuckooProbesetSize = 16;
+ size_t Set_DelOdd::s_nCuckooProbesetThreshold = 0;
+
+ size_t Set_DelOdd::s_nFeldmanSet_HeadBits = 10;
+ size_t Set_DelOdd::s_nFeldmanSet_ArrayBits = 4;
+
+
+ size_t Set_DelOdd::s_nLoadFactor = 1;
+ std::vector<size_t> Set_DelOdd::m_arrData;
+
+ void Set_DelOdd::SetUpTestCase()
+ {
+ cds_test::config const& cfg = get_config( "map_delodd" );
+
+ s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize );
+ if ( s_nSetSize < 1000 )
+ s_nSetSize = 1000;
+
+ s_nInsThreadCount = cfg.get_size_t( "InsThreadCount", s_nInsThreadCount );
+ if ( s_nInsThreadCount == 0 )
+ s_nInsThreadCount = 1;
+
+ s_nDelThreadCount = cfg.get_size_t( "DelThreadCount", s_nDelThreadCount );
+ s_nExtractThreadCount = cfg.get_size_t( "ExtractThreadCount", s_nExtractThreadCount );
+
+ s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
+ if ( s_nMaxLoadFactor == 0 )
+ s_nMaxLoadFactor = 1;
+
+ s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize );
+ if ( s_nCuckooInitialSize < 256 )
+ s_nCuckooInitialSize = 256;
+
+ s_nCuckooProbesetSize = cfg.get_size_t( "CuckooProbesetSize", s_nCuckooProbesetSize );
+ if ( s_nCuckooProbesetSize < 8 )
+ s_nCuckooProbesetSize = 8;
+
+ s_nCuckooProbesetThreshold = cfg.get_size_t( "CuckooProbesetThreshold", s_nCuckooProbesetThreshold );
+
+ s_nFeldmanSet_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanSet_HeadBits );
+ if ( s_nFeldmanSet_HeadBits == 0 )
+ s_nFeldmanSet_HeadBits = 2;
+
+ s_nFeldmanSet_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanSet_ArrayBits );
+ if ( s_nFeldmanSet_ArrayBits == 0 )
+ s_nFeldmanSet_ArrayBits = 2;
+
+ m_arrData.resize( s_nSetSize );
+ for ( size_t i = 0; i < s_nSetSize; ++i )
+ m_arrData[i] = i;
+ shuffle( m_arrData.begin(), m_arrData.end() );
+ }
+
+ void Set_DelOdd::TearDownTestCase()
+ {
+ m_arrData.clear();
+ }
+
+ std::vector<size_t> Set_DelOdd_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<size_t> lf;
+ for ( size_t n = 1; n <= s_nMaxLoadFactor; n *= 2 )
+ lf.push_back( n );
+
+ return lf;
+ }
+
+ INSTANTIATE_TEST_CASE_P( a, Set_DelOdd_LF, ::testing::ValuesIn( Set_DelOdd_LF::get_load_factors() ) );
+} // namespace set
--- /dev/null
+/*
+ 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 {
+
+ struct key_thread
+ {
+ uint32_t nKey;
+ uint16_t nThread;
+ uint16_t pad_;
+
+ key_thread( size_t key, size_t threadNo )
+ : nKey( static_cast<uint32_t>(key))
+ , nThread( static_cast<uint16_t>(threadNo))
+ , pad_(0)
+ {}
+
+ key_thread()
+ {}
+ };
+
+ typedef set_type_base<key_thread, size_t>::key_val key_value_pair;
+
+ template <>
+ struct cmp<key_thread> {
+ int operator ()(key_thread const& k1, key_thread const& k2) const
+ {
+ if ( k1.nKey < k2.nKey )
+ return -1;
+ if ( k1.nKey > k2.nKey )
+ return 1;
+ if ( k1.nThread < k2.nThread )
+ return -1;
+ if ( k1.nThread > k2.nThread )
+ return 1;
+ return 0;
+ }
+ int operator ()(key_thread const& k1, size_t k2) const
+ {
+ if ( k1.nKey < k2 )
+ return -1;
+ if ( k1.nKey > k2 )
+ return 1;
+ return 0;
+ }
+ int operator ()(size_t k1, key_thread const& k2) const
+ {
+ if ( k1 < k2.nKey )
+ return -1;
+ if ( k1 > k2.nKey )
+ return 1;
+ return 0;
+ }
+ };
+
+ template <>
+ struct less<set::key_thread>
+ {
+ bool operator()( set::key_thread const& k1, set::key_thread const& k2 ) const
+ {
+ if ( k1.nKey <= k2.nKey )
+ return k1.nKey < k2.nKey || k1.nThread < k2.nThread;
+ return false;
+ }
+ };
+
+ template <>
+ struct hash<set::key_thread>
+ {
+ typedef size_t result_type;
+ typedef set::key_thread argument_type;
+
+ size_t operator()( set::key_thread const& k ) const
+ {
+ return std::hash<size_t>()(k.nKey);
+ }
+ size_t operator()( size_t k ) const
+ {
+ return std::hash<size_t>()(k);
+ }
+ };
+
+
+ class Set_DelOdd: public cds_test::stress_fixture
+ {
+ public:
+ static size_t s_nSetSize; // max set size
+ static size_t s_nInsThreadCount; // insert thread count
+ static size_t s_nDelThreadCount; // delete thread count
+ static size_t s_nExtractThreadCount; // extract thread count
+ static size_t s_nMaxLoadFactor; // maximum load factor
+
+ static size_t s_nCuckooInitialSize; // initial size for CuckooSet
+ static size_t s_nCuckooProbesetSize; // CuckooSet probeset size (only for list-based probeset)
+ static size_t s_nCuckooProbesetThreshold; // CUckooSet probeset threshold (0 - use default)
+
+ static size_t s_nFeldmanSet_HeadBits;
+ static size_t s_nFeldmanSet_ArrayBits;
+
+ static size_t s_nLoadFactor;
+
+ static std::vector<size_t> m_arrData;
+
+ static void SetUpTestCase();
+ static void TearDownTestCase();
+
+ protected:
+ typedef key_thread key_type;
+ typedef size_t value_type;
+
+ atomics::atomic<size_t> m_nInsThreadCount;
+
+ enum {
+ inserter_thread,
+ deleter_thread,
+ extractor_thread,
+ };
+
+
+ // Inserts keys from [0..N)
+ template <class Set>
+ class Inserter: public cds_test::thread
+ {
+ typedef cds_test::thread base_class;
+ Set& m_Set;
+
+ struct update_functor
+ {
+ template <typename Q>
+ void operator()( bool /*bNew*/, key_value_pair const&, Q const& )
+ {}
+
+ void operator()(key_value_pair& /*cur*/, key_value_pair * /*prev*/)
+ {}
+ };
+ public:
+ size_t m_nInsertSuccess = 0;
+ size_t m_nInsertFailed = 0;
+
+ public:
+ Inserter( cds_test::thread_pool& pool, Set& set )
+ : base_class( pool, inserter_thread )
+ , m_Set( set )
+ {}
+
+ Inserter( Inserter& src )
+ : base_class( src )
+ , m_Set( src.m_Set )
+ {}
+
+ virtual thread * clone()
+ {
+ return new Inserter( *this );
+ }
+
+ virtual void test()
+ {
+ Set& rSet = m_Set;
+ Set_DelOdd& fixture = pool().template fixture<Set_DelOdd>();
+
+ std::vector<size_t>& arrData = fixture.m_arrData;
+ for ( size_t i = 0; i < arrData.size(); ++i ) {
+ if ( rSet.insert( key_type( arrData[i], id() )))
+ ++m_nInsertSuccess;
+ else
+ ++m_nInsertFailed;
+ }
+
+ update_functor f;
+ for ( size_t i = arrData.size() - 1; i > 0; --i ) {
+ if ( arrData[i] & 1 )
+ rSet.update( key_type( arrData[i], id() ), f, true );
+ }
+
+ fixture.m_nInsThreadCount.fetch_sub( 1, atomics::memory_order_release );
+ }
+ };
+
+ struct key_equal {
+ bool operator()( key_type const& k1, key_type const& k2 ) const
+ {
+ return k1.nKey == k2.nKey;
+ }
+ bool operator()( size_t k1, key_type const& k2 ) const
+ {
+ return k1 == k2.nKey;
+ }
+ bool operator()( key_type const& k1, size_t k2 ) const
+ {
+ return k1.nKey == k2;
+ }
+ bool operator ()( key_value_pair const& k1, key_value_pair const& k2 ) const
+ {
+ return operator()( k1.key, k2.key );
+ }
+ bool operator ()( key_value_pair const& k1, key_type const& k2 ) const
+ {
+ return operator()( k1.key, k2 );
+ }
+ bool operator ()( key_type const& k1, key_value_pair const& k2 ) const
+ {
+ return operator()( k1, k2.key );
+ }
+ bool operator ()( key_value_pair const& k1, size_t k2 ) const
+ {
+ return operator()( k1.key, k2 );
+ }
+ bool operator ()( size_t k1, key_value_pair const& k2 ) const
+ {
+ return operator()( k1, k2.key );
+ }
+ };
+
+ struct key_less {
+ bool operator()( key_type const& k1, key_type const& k2 ) const
+ {
+ return k1.nKey < k2.nKey;
+ }
+ bool operator()( size_t k1, key_type const& k2 ) const
+ {
+ return k1 < k2.nKey;
+ }
+ bool operator()( key_type const& k1, size_t k2 ) const
+ {
+ return k1.nKey < k2;
+ }
+ bool operator ()( key_value_pair const& k1, key_value_pair const& k2 ) const
+ {
+ return operator()( k1.key, k2.key );
+ }
+ bool operator ()( key_value_pair const& k1, key_type const& k2 ) const
+ {
+ return operator()( k1.key, k2 );
+ }
+ bool operator ()( key_type const& k1, key_value_pair const& k2 ) const
+ {
+ return operator()( k1, k2.key );
+ }
+ bool operator ()( key_value_pair const& k1, size_t k2 ) const
+ {
+ return operator()( k1.key, k2 );
+ }
+ bool operator ()( size_t k1, key_value_pair const& k2 ) const
+ {
+ return operator()( k1, k2.key );
+ }
+
+ typedef key_equal equal_to;
+ };
+
+ // Deletes odd keys from [0..N)
+ template <class Set>
+ class Deleter: public cds_test::thread
+ {
+ typedef cds_test::thread base_class;
+ Set& m_Set;
+
+ public:
+ size_t m_nDeleteSuccess = 0;
+ size_t m_nDeleteFailed = 0;
+
+ public:
+ Deleter( cds_test::thread_pool& pool, Set& set )
+ : base_class( pool, deleter_thread )
+ , m_Set( set )
+ {}
+ Deleter( Deleter& src )
+ : base_class( src )
+ , m_Set( src.m_Set )
+ {}
+
+ virtual thread * clone()
+ {
+ return new Deleter( *this );
+ }
+
+ template <typename SetType, bool>
+ struct eraser {
+ static bool erase( SetType& s, size_t key, size_t /*thread*/)
+ {
+ return s.erase_with( key, key_less() );
+ }
+ };
+
+ template <typename SetType>
+ struct eraser<SetType, true> {
+ static bool erase(SetType& s, size_t key, size_t thread)
+ {
+ return s.erase( key_type(key, thread));
+ }
+ };
+
+ virtual void test()
+ {
+ Set& rSet = m_Set;
+
+ size_t const nInsThreadCount = s_nInsThreadCount;
+ Set_DelOdd& fixture = pool().template fixture<Set_DelOdd>();
+ std::vector<size_t>& arrData = fixture.m_arrData;
+
+ if ( id() & 1 ) {
+ for (size_t i = 0; i < arrData.size(); ++i) {
+ if ( arrData[i] & 1 ) {
+ for ( size_t k = 0; k < nInsThreadCount; ++k ) {
+ if ( eraser<Set, Set::c_bEraseExactKey>::erase( rSet, arrData[i], k ))
+ ++m_nDeleteSuccess;
+ else
+ ++m_nDeleteFailed;
+ }
+ }
+ if ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
+ break;
+ }
+ }
+ else {
+ for ( size_t i = arrData.size() - 1; i > 0; --i ) {
+ if ( arrData[i] & 1 ) {
+ for ( size_t k = 0; k < nInsThreadCount; ++k ) {
+ if (eraser<Set, Set::c_bEraseExactKey>::erase(rSet, arrData[i], k))
+ ++m_nDeleteSuccess;
+ else
+ ++m_nDeleteFailed;
+ }
+ }
+ if ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
+ break;
+ }
+ }
+ }
+ };
+
+ // Extracts odd keys from [0..N)
+ template <typename GC, class Set>
+ class Extractor: public cds_test::thread
+ {
+ typedef cds_test::thread base_class;
+ Set& m_Set;
+
+ public:
+ size_t m_nExtractSuccess = 0;
+ size_t m_nExtractFailed = 0;
+
+ public:
+ Extractor( cds_test::thread_pool& pool, Set& set )
+ : base_class( pool, extractor_thread )
+ , m_Set( set )
+ {}
+
+ Extractor( Extractor& src )
+ : base_class( src )
+ , m_Set( src.m_Set )
+ {}
+
+ virtual thread * clone()
+ {
+ return new Extractor( *this );
+ }
+
+ template <typename SetType, bool>
+ struct extractor {
+ static typename SetType::guarded_ptr extract(SetType& s, size_t key, size_t /*thread*/)
+ {
+ return s.extract_with( key, key_less());
+ }
+ };
+
+ template <typename SetType>
+ struct extractor<SetType, true> {
+ static typename SetType::guarded_ptr extract(SetType& s, size_t key, size_t thread)
+ {
+ return s.extract( key_type(key, thread));
+ }
+ };
+
+ virtual void test()
+ {
+ Set& rSet = m_Set;
+
+ typename Set::guarded_ptr gp;
+
+ Set_DelOdd& fixture = pool().template fixture<Set_DelOdd>();
+ std::vector<size_t>& arrData = fixture.m_arrData;
+ size_t const nInsThreadCount = s_nInsThreadCount;
+
+ if ( id() & 1 ) {
+ for ( size_t i = 0; i < arrData.size(); ++i ) {
+ if ( arrData[i] & 1 ) {
+ for ( size_t k = 0; k < nInsThreadCount; ++k ) {
+ gp = extractor<Set, Set::c_bEraseExactKey>::extract( rSet, arrData[i], k );
+ if ( gp )
+ ++m_nExtractSuccess;
+ else
+ ++m_nExtractFailed;
+ gp.release();
+ }
+ }
+ if ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
+ break;
+ }
+ }
+ else {
+ for ( size_t i = arrData.size() - 1; i > 0; --i ) {
+ if ( arrData[i] & 1 ) {
+ for ( size_t k = 0; k < nInsThreadCount; ++k ) {
+ gp = extractor<Set, Set::c_bEraseExactKey>::extract( rSet, arrData[i], k);
+ if ( gp )
+ ++m_nExtractSuccess;
+ else
+ ++m_nExtractFailed;
+ gp.release();
+ }
+ }
+ if ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
+ break;
+ }
+ }
+ }
+ };
+
+ template <typename RCU, class Set>
+ class Extractor< cds::urcu::gc<RCU>, Set >: public cds_test::thread
+ {
+ typedef cds_test::thread base_class;
+ Set& m_Set;
+
+ public:
+ size_t m_nExtractSuccess = 0;
+ size_t m_nExtractFailed = 0;
+
+ public:
+ Extractor( cds_test::thread_pool& pool, Set& set )
+ : base_class( pool, extractor_thread )
+ , m_Set( set )
+ {}
+
+ Extractor( Extractor& src )
+ : base_class( src )
+ , m_Set( src.m_Set )
+ {}
+
+ virtual thread * clone()
+ {
+ return new Extractor( *this );
+ }
+
+ template <typename SetType, bool>
+ struct extractor {
+ static typename SetType::exempt_ptr extract(SetType& s, size_t key, size_t /*thread*/)
+ {
+ return s.extract_with(key, key_less());
+ }
+ };
+
+ template <typename SetType>
+ struct extractor<SetType, true> {
+ static typename SetType::exempt_ptr extract(SetType& s, size_t key, size_t thread)
+ {
+ return s.extract(key_type(key, thread));
+ }
+ };
+
+ virtual void test()
+ {
+ Set& rSet = m_Set;
+
+ typename Set::exempt_ptr xp;
+
+ Set_DelOdd& fixture = pool().template fixture<Set_DelOdd>();
+ std::vector<size_t>& arrData = fixture.m_arrData;
+ size_t const nInsThreadCount = fixture.s_nInsThreadCount;
+
+ if ( id() & 1 ) {
+ for ( size_t i = 0; i < arrData.size(); ++i ) {
+ if ( arrData[i] & 1 ) {
+ for ( size_t k = 0; k < nInsThreadCount; ++k ) {
+ if ( Set::c_bExtractLockExternal ) {
+ typename Set::rcu_lock l;
+ xp = extractor<Set, Set::c_bEraseExactKey>::extract( rSet, arrData[i], k);
+ if ( xp )
+ ++m_nExtractSuccess;
+ else
+ ++m_nExtractFailed;
+ }
+ else {
+ xp = extractor<Set, Set::c_bEraseExactKey>::extract(rSet, arrData[i], k);
+ if ( xp )
+ ++m_nExtractSuccess;
+ else
+ ++m_nExtractFailed;
+ }
+ xp.release();
+ }
+ }
+ if ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
+ break;
+ }
+ }
+ else {
+ for ( size_t i = arrData.size() - 1; i > 0; --i ) {
+ if ( arrData[i] & 1 ) {
+ for ( size_t k = 0; k < nInsThreadCount; ++k ) {
+ if ( Set::c_bExtractLockExternal ) {
+ typename Set::rcu_lock l;
+ xp = extractor<Set, Set::c_bEraseExactKey>::extract(rSet, arrData[i], k);
+ if ( xp )
+ ++m_nExtractSuccess;
+ else
+ ++m_nExtractFailed;
+ }
+ else {
+ xp = extractor<Set, Set::c_bEraseExactKey>::extract(rSet, arrData[i], k);
+ if ( xp )
+ ++m_nExtractSuccess;
+ else
+ ++m_nExtractFailed;
+ }
+ xp.release();
+ }
+ }
+ if ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) == 0 )
+ break;
+ }
+ }
+ }
+ };
+
+ protected:
+ template <class Set>
+ void do_test_with( Set& testSet )
+ {
+ typedef Inserter<Set> insert_thread;
+ typedef Deleter<Set> delete_thread;
+
+ m_nInsThreadCount.store( s_nInsThreadCount, atomics::memory_order_release );
+
+ cds_test::thread_pool& pool = get_pool();
+ pool.add( new insert_thread( pool, testSet ), s_nInsThreadCount );
+ pool.add( new delete_thread( pool, testSet ), s_nDelThreadCount ? s_nDelThreadCount : cds::OS::topology::processor_count());
+
+ propout() << std::make_pair( "insert_thread_count", s_nInsThreadCount )
+ << std::make_pair( "delete_thread_count", s_nDelThreadCount )
+ << std::make_pair( "set_size", s_nSetSize );
+
+ std::chrono::milliseconds duration = pool.run();
+
+ propout() << std::make_pair( "duration", duration );
+
+ size_t nInsertSuccess = 0;
+ size_t nInsertFailed = 0;
+ size_t nDeleteSuccess = 0;
+ size_t nDeleteFailed = 0;
+
+ for ( size_t i = 0; i < pool.size(); ++i ) {
+ cds_test::thread& thr = pool.get( i );
+ if ( thr.type() == inserter_thread ) {
+ insert_thread& inserter = static_cast<insert_thread&>(thr);
+ nInsertSuccess += inserter.m_nInsertSuccess;
+ nInsertFailed += inserter.m_nInsertFailed;
+ }
+ else {
+ assert( thr.type() == deleter_thread );
+ delete_thread& deleter = static_cast<delete_thread&>(thr);
+ nDeleteSuccess += deleter.m_nDeleteSuccess;
+ nDeleteFailed += deleter.m_nDeleteFailed;
+ }
+ }
+
+ EXPECT_EQ( nInsertSuccess, s_nSetSize * s_nInsThreadCount );
+ EXPECT_EQ( nInsertFailed, 0 );
+
+ 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 );
+ }
+
+ template <class Set>
+ void do_test_extract_with( Set& testSet )
+ {
+ typedef Inserter<Set> insert_thread;
+ typedef Deleter<Set> delete_thread;
+ typedef Extractor< typename Set::gc, Set > extract_thread;
+
+ m_nInsThreadCount.store( s_nInsThreadCount, atomics::memory_order_release );
+
+ cds_test::thread_pool& pool = get_pool();
+ pool.add( new insert_thread( pool, testSet ), s_nInsThreadCount );
+ if ( s_nDelThreadCount )
+ pool.add( new delete_thread( pool, testSet ), s_nDelThreadCount );
+ if ( s_nExtractThreadCount )
+ pool.add( new extract_thread( pool, testSet ), s_nExtractThreadCount );
+
+ propout() << std::make_pair( "insert_thread_count", s_nInsThreadCount )
+ << std::make_pair( "delete_thread_count", s_nDelThreadCount )
+ << std::make_pair( "extract_thread_count", s_nExtractThreadCount )
+ << std::make_pair( "set_size", s_nSetSize );
+
+ std::chrono::milliseconds duration = pool.run();
+
+ propout() << std::make_pair( "duration", duration );
+
+ size_t nInsertSuccess = 0;
+ size_t nInsertFailed = 0;
+ size_t nDeleteSuccess = 0;
+ size_t nDeleteFailed = 0;
+ size_t nExtractSuccess = 0;
+ size_t nExtractFailed = 0;
+ for ( size_t i = 0; i < pool.size(); ++i ) {
+ cds_test::thread& thr = pool.get( i );
+ switch ( thr.type() ) {
+ case inserter_thread:
+ {
+ insert_thread& inserter = static_cast<insert_thread&>( thr );
+ nInsertSuccess += inserter.m_nInsertSuccess;
+ nInsertFailed += inserter.m_nInsertFailed;
+ }
+ break;
+ case deleter_thread:
+ {
+ delete_thread& deleter = static_cast<delete_thread&>(thr);
+ nDeleteSuccess += deleter.m_nDeleteSuccess;
+ nDeleteFailed += deleter.m_nDeleteFailed;
+ }
+ break;
+ case extractor_thread:
+ {
+ extract_thread& extractor = static_cast<extract_thread&>(thr);
+ nExtractSuccess += extractor.m_nExtractSuccess;
+ nExtractFailed += extractor.m_nExtractFailed;
+ }
+ break;
+ default:
+ assert( false );
+ }
+ }
+
+ EXPECT_EQ( nInsertSuccess, s_nSetSize * s_nInsThreadCount );
+ EXPECT_EQ( nInsertFailed, 0 );
+
+ 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( "extract_success", nExtractSuccess )
+ << std::make_pair( "extract_failed", nExtractFailed );
+ }
+
+ template <typename Set>
+ void analyze( Set& testSet )
+ {
+ // All even keys must be in the set
+ {
+ for ( size_t n = 0; n < s_nSetSize; n +=2 ) {
+ for ( size_t i = 0; i < s_nInsThreadCount; ++i ) {
+ EXPECT_TRUE( testSet.contains( key_type( n, i ))) << "key=" << n << "/" << i;
+ }
+ }
+ }
+
+ check_before_clear( testSet );
+
+ testSet.clear();
+ EXPECT_TRUE( testSet.empty() ) << "set.size=" << testSet.size();
+
+ additional_check( testSet );
+ print_stat( propout(), testSet );
+ additional_cleanup( testSet );
+ }
+
+ template <class Set>
+ void run_test()
+ {
+ static_assert( !Set::c_bExtractSupported, "Set class must not support extract() method" );
+
+ Set testSet( *this );
+ do_test_with( testSet );
+ analyze( testSet );
+ }
+
+ template <class Set>
+ void run_test_extract()
+ {
+ static_assert( Set::c_bExtractSupported, "Set class must support extract() method" );
+
+ Set testSet( *this );
+ do_test_extract_with( testSet );
+ analyze( testSet );
+ }
+ };
+
+ class Set_DelOdd_LF: public Set_DelOdd
+ , public ::testing::WithParamInterface<size_t>
+ {
+ public:
+ template <class Set>
+ void run_test()
+ {
+ s_nLoadFactor = GetParam();
+ propout() << std::make_pair( "load_factor", s_nLoadFactor );
+ Set_DelOdd::run_test<Set>();
+ }
+
+ template <class Set>
+ void run_test_extract()
+ {
+ s_nLoadFactor = GetParam();
+ propout() << std::make_pair( "load_factor", s_nLoadFactor );
+ Set_DelOdd::run_test_extract<Set>();
+ }
+
+ static std::vector<size_t> get_load_factors();
+ };
+
+} // namespace set
--- /dev/null
+/*
+ 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_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<set_type>(); \
+ }
+
+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 )
+} // namespace set
--- /dev/null
+/*
+ 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_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<set_type>(); \
+ }
+
+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
+
+} // namespace set
--- /dev/null
+/*
+ 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_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<set_type>(); \
+ }
+
+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
+
+} // namespace set
--- /dev/null
+/*
+ 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_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<set_type>(); \
+ }
+
+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( 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
--- /dev/null
+/*
+ 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_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<set_type>(); \
+ }
+
+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
+
+
+
+} // namespace set
--- /dev/null
+/*
+ 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_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<set_type>(); \
+ }
+
+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( 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
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_H
+#define CDSUNIT_SET_TYPE_H
+
+#include <cds/urcu/general_instant.h>
+#include <cds/urcu/general_buffered.h>
+#include <cds/urcu/general_threaded.h>
+#include <cds/urcu/signal_buffered.h>
+#include <cds/urcu/signal_threaded.h>
+
+#include <cds/opt/hash.h>
+#include <cds/sync/spinlock.h>
+
+#include <cds_test/stress_test.h>
+#include "framework/michael_alloc.h"
+
+namespace set {
+ namespace cc = cds::container;
+ namespace co = cds::opt;
+
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_gpi;
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_gpb;
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_gpt;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_shb;
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_sht;
+#endif
+
+ template <typename Key>
+ struct less;
+
+ template <typename Key>
+ struct cmp
+ {
+ int operator ()(Key const& k1, Key const& k2) const
+ {
+ if ( less<Key>( k1, k2 ) )
+ return -1;
+ return less<Key>( k2, k1 ) ? 1 : 0;
+ }
+ };
+
+ template <typename Key>
+ struct hash;
+
+#define CDSUNIT_INT_COMPARE(t) template <> struct cmp<t> { int operator()( t k1, t k2 ){ return (int)(k1 - k2); } }
+ CDSUNIT_INT_COMPARE(char);
+ CDSUNIT_INT_COMPARE(unsigned char);
+ CDSUNIT_INT_COMPARE(int);
+ CDSUNIT_INT_COMPARE(unsigned int);
+ CDSUNIT_INT_COMPARE(long);
+ CDSUNIT_INT_COMPARE(unsigned long);
+ CDSUNIT_INT_COMPARE(long long);
+ CDSUNIT_INT_COMPARE(unsigned long long);
+#undef CDSUNIT_INT_COMPARE
+
+ template <>
+ struct cmp<std::string>
+ {
+ int operator()(std::string const& s1, std::string const& s2)
+ {
+ return s1.compare( s2 );
+ }
+ int operator()(std::string const& s1, char const * s2)
+ {
+ return s1.compare( s2 );
+ }
+ int operator()(char const * s1, std::string const& s2)
+ {
+ return -s2.compare( s1 );
+ }
+ };
+
+ // forward
+ template <typename ImplSelector, typename Key, typename Value>
+ struct set_type;
+
+ template <typename Key, typename Value>
+ struct set_type_base
+ {
+ typedef Key key_type;
+ typedef Value value_type;
+
+ struct key_val {
+ key_type key;
+ value_type val;
+
+ /*explicit*/ key_val( key_type const& k ): key(k), val() {}
+ key_val( key_type const& k, value_type const& v ): key(k), val(v) {}
+
+ template <typename K>
+ explicit key_val( K const& k ): key(k) {}
+
+ template <typename K, typename T>
+ key_val( K const& k, T const& v ): key(k), val(v) {}
+ };
+
+ typedef set::hash<key_type> key_hash;
+ typedef set::less<key_type> key_less;
+ typedef set::cmp<key_type> key_compare;
+
+ struct less {
+ bool operator()( key_val const& k1, key_val const& k2 ) const
+ {
+ return key_less()( k1.key, k2.key );
+ }
+ bool operator()( key_type const& k1, key_val const& k2 ) const
+ {
+ return key_less()( k1, k2.key );
+ }
+ bool operator()( key_val const& k1, key_type const& k2 ) const
+ {
+ return key_less()( k1.key, k2 );
+ }
+ };
+
+ struct compare {
+ int operator()( key_val const& k1, key_val const& k2 ) const
+ {
+ return key_compare()( k1.key, k2.key );
+ }
+ int operator()( key_type const& k1, key_val const& k2 ) const
+ {
+ return key_compare()( k1, k2.key );
+ }
+ int operator()( key_val const& k1, key_type const& k2 ) const
+ {
+ return key_compare()( k1.key, k2 );
+ }
+ };
+
+ struct equal_to {
+ bool operator()( key_val const& k1, key_val const& k2 ) const
+ {
+ return key_compare()( k1.key, k2.key ) == 0;
+ }
+ bool operator()( key_type const& k1, key_val const& k2 ) const
+ {
+ return key_compare()( k1, k2.key ) == 0;
+ }
+ bool operator()( key_val const& k1, key_type const& k2 ) const
+ {
+ return key_compare()( k1.key, k2 ) == 0;
+ }
+ };
+
+
+ struct hash: public key_hash
+ {
+ size_t operator()( key_val const& v ) const
+ {
+ return key_hash::operator()( v.key );
+ }
+ size_t operator()( key_type const& key ) const
+ {
+ return key_hash::operator()( key );
+ }
+ template <typename Q>
+ size_t operator()( Q const& k ) const
+ {
+ return key_hash::operator()( k );
+ }
+ };
+
+ struct hash2: public hash
+ {
+ size_t operator()( key_val const& k ) const
+ {
+ size_t h = hash::operator ()( k.key );
+ size_t seed = ~h;
+ seed ^= h + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ return seed;
+ }
+ size_t operator()( key_type const& k ) const
+ {
+ size_t h = hash::operator ()( k );
+ size_t seed = ~h;
+ seed ^= h + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ return seed;
+ }
+ template <typename Q>
+ size_t operator()( Q const& k ) const
+ {
+ return key_hash::operator()( k );
+ }
+ };
+ };
+
+
+ // *************************************************
+ // print_stat
+ // *************************************************
+
+ template <typename Set>
+ static inline void print_stat( cds_test::property_stream&, Set const& /*s*/ )
+ {}
+
+
+ //*******************************************************
+ // additional_check
+ //*******************************************************
+
+ template <typename Set>
+ static inline void additional_check( Set& /*set*/ )
+ {}
+
+ template <typename Set>
+ static inline void additional_cleanup( Set& /*set*/ )
+ {}
+
+ //*******************************************************
+ // check_before_clear
+ //*******************************************************
+
+ template <typename Set>
+ static inline void check_before_clear( Set& /*s*/ )
+ {}
+
+} // namespace set
+
+
+#endif // ifndef CDSUNIT_SET_TYPE_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_CUCKOO_H
+#define CDSUNIT_SET_TYPE_CUCKOO_H
+
+#include "set/set_type.h"
+
+#include <cds/container/cuckoo_set.h>
+#include <cds_test/stat_cuckoo_out.h>
+
+namespace set {
+
+ template <typename V, typename Traits>
+ class CuckooSet : public cc::CuckooSet< V, Traits >
+ {
+ public:
+ typedef cc::CuckooSet< V, Traits > cuckoo_base_class;
+
+ public:
+ template <typename Config>
+ CuckooSet( Config const& cfg )
+ : cuckoo_base_class(
+ cfg.s_nCuckooInitialSize,
+ static_cast<unsigned int>( cfg.s_nCuckooProbesetSize ),
+ static_cast<unsigned int>( cfg.s_nCuckooProbesetThreshold )
+ )
+ {}
+
+ template <typename Q, typename Pred>
+ bool erase_with( Q const& key, Pred /*pred*/ )
+ {
+ return cuckoo_base_class::erase_with( key, typename std::conditional< cuckoo_base_class::c_isSorted, Pred, typename Pred::equal_to>::type() );
+ }
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ struct tag_CuckooSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_CuckooSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::equal_to equal_to;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+ typedef typename base_class::hash2 hash2;
+
+ // ***************************************************************************
+ // CuckooSet
+
+ template <typename Traits>
+ struct traits_CuckooStripedSet : public Traits
+ {
+ typedef cc::cuckoo::striping<> mutex_policy;
+ };
+ template <typename Traits>
+ struct traits_CuckooRefinableSet : public Traits
+ {
+ typedef cc::cuckoo::refinable<> mutex_policy;
+ };
+
+ struct traits_CuckooSet_list_unord :
+ public cc::cuckoo::make_traits <
+ cc::cuckoo::probeset_type< cc::cuckoo::list >
+ , co::equal_to< equal_to >
+ , co::hash< std::tuple< hash, hash2 > >
+ > ::type
+ {};
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_list_unord>> CuckooStripedSet_list_unord;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_list_unord>> CuckooRefinableSet_list_unord;
+
+ struct traits_CuckooSet_list_unord_stat : public traits_CuckooSet_list_unord
+ {
+ typedef cc::cuckoo::stat stat;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_list_unord_stat>> CuckooStripedSet_list_unord_stat;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_list_unord_stat>> CuckooRefinableSet_list_unord_stat;
+
+ struct traits_CuckooSet_list_unord_storehash : public traits_CuckooSet_list_unord
+ {
+ static CDS_CONSTEXPR const bool store_hash = true;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_list_unord_storehash>> CuckooStripedSet_list_unord_storehash;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_list_unord_storehash>> CuckooRefinableSet_list_unord_storehash;
+
+ struct traits_CuckooSet_list_ord :
+ public cc::cuckoo::make_traits <
+ cc::cuckoo::probeset_type< cc::cuckoo::list >
+ , co::compare< compare >
+ , co::hash< std::tuple< hash, hash2 > >
+ > ::type
+ {};
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_list_ord>> CuckooStripedSet_list_ord;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_list_ord>> CuckooRefinableSet_list_ord;
+
+ struct traits_CuckooSet_list_ord_stat : public traits_CuckooSet_list_ord
+ {
+ typedef cc::cuckoo::stat stat;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_list_ord_stat>> CuckooStripedSet_list_ord_stat;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_list_ord_stat>> CuckooRefinableSet_list_ord_stat;
+
+ struct traits_CuckooSet_list_ord_storehash : public traits_CuckooSet_list_ord
+ {
+ static CDS_CONSTEXPR const bool store_hash = true;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_list_ord_storehash>> CuckooStripedSet_list_ord_storehash;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_list_ord_storehash>> CuckooRefinableSet_list_ord_storehash;
+
+
+ struct traits_CuckooSet_vector_unord :
+ public cc::cuckoo::make_traits <
+ cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
+ , co::equal_to< equal_to >
+ , co::hash< std::tuple< hash, hash2 > >
+ > ::type
+ {};
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_vector_unord>> CuckooStripedSet_vector_unord;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_vector_unord>> CuckooRefinableSet_vector_unord;
+
+ struct traits_CuckooSet_vector_unord_stat : public traits_CuckooSet_vector_unord
+ {
+ typedef cc::cuckoo::stat stat;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_vector_unord_stat>> CuckooStripedSet_vector_unord_stat;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_vector_unord_stat>> CuckooRefinableSet_vector_unord_stat;
+
+ struct traits_CuckooSet_vector_unord_storehash : public traits_CuckooSet_vector_unord
+ {
+ static CDS_CONSTEXPR const bool store_hash = true;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_vector_unord_storehash>> CuckooStripedSet_vector_unord_storehash;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_vector_unord_storehash>> CuckooRefinableSet_vector_unord_storehash;
+
+ struct traits_CuckooSet_vector_ord :
+ public cc::cuckoo::make_traits <
+ cc::cuckoo::probeset_type< cc::cuckoo::vector<4> >
+ , co::compare< compare >
+ , co::hash< std::tuple< hash, hash2 > >
+ > ::type
+ {};
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_vector_ord>> CuckooStripedSet_vector_ord;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_vector_ord>> CuckooRefinableSet_vector_ord;
+
+ struct traits_CuckooSet_vector_ord_stat : public traits_CuckooSet_vector_ord
+ {
+ typedef cc::cuckoo::stat stat;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_vector_ord_stat>> CuckooStripedSet_vector_ord_stat;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_vector_ord_stat>> CuckooRefinableSet_vector_ord_stat;
+
+ struct traits_CuckooSet_vector_ord_storehash : public traits_CuckooSet_vector_ord
+ {
+ static CDS_CONSTEXPR const bool store_hash = true;
+ };
+ typedef CuckooSet< key_val, traits_CuckooStripedSet<traits_CuckooSet_vector_ord_storehash>> CuckooStripedSet_vector_ord_storehash;
+ typedef CuckooSet< key_val, traits_CuckooRefinableSet<traits_CuckooSet_vector_ord_storehash>> CuckooRefinableSet_vector_ord_storehash;
+
+ };
+
+ template <typename T, typename Traits >
+ static inline void print_stat( cds_test::property_stream& o, cc::CuckooSet< T, Traits > const& s )
+ {
+ o << s.statistics() << s.mutex_policy_statistics();
+ }
+
+ template <typename V, typename Traits>
+ static inline void print_stat( cds_test::property_stream& o, CuckooSet< V, Traits > const& s )
+ {
+ typedef CuckooSet< V, Traits > set_type;
+ print_stat( o, static_cast<typename set_type::cuckoo_base_class const&>(s) );
+ }
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_CUCKOO_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_ELLEN_BINTREE_H
+#define CDSUNIT_SET_TYPE_ELLEN_BINTREE_H
+
+#include "set_type.h"
+
+#include <cds/container/ellen_bintree_set_rcu.h>
+#include <cds/container/ellen_bintree_set_hp.h>
+#include <cds/container/ellen_bintree_set_dhp.h>
+
+#include <cds_test/stat_ellenbintree_out.h>
+#include "framework/ellen_bintree_update_desc_pool.h"
+
+namespace set {
+
+ template <class GC, typename Key, typename T, typename Traits = cc::ellen_bintree::traits >
+ class EllenBinTreeSet : public cc::EllenBinTreeSet< GC, Key, T, Traits >
+ {
+ typedef cc::EllenBinTreeSet< GC, Key, T, Traits > base_class;
+ public:
+ template <typename Config>
+ EllenBinTreeSet( Config const& /*cfg*/ )
+ {}
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = true;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ struct tag_EllenBinTreeSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_EllenBinTreeSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_type key_type;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::less less;
+ typedef typename base_class::key_less key_less;
+
+ struct ellen_bintree_props {
+ struct key_extractor {
+ void operator()( key_type& dest, key_val const& src ) const
+ {
+ dest = src.key;
+ }
+ };
+
+ struct less {
+ bool operator()( key_val const& v1, key_val const& v2 ) const
+ {
+ return key_less()( v1.key, v2.key );
+ }
+ bool operator()( key_type const& k, key_val const& v ) const
+ {
+ return key_less()( k, v.key );
+ }
+ bool operator()( key_val const& v, key_type const& k ) const
+ {
+ return key_less()( v.key, k );
+ }
+ bool operator()( key_type const& k1, key_type const& k2 ) const
+ {
+ return key_less()( k1, k2 );
+ }
+ };
+
+ struct hp_gc {
+ typedef cc::ellen_bintree::node<cds::gc::HP, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+
+ struct dhp_gc {
+ typedef cc::ellen_bintree::node<cds::gc::DHP, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+
+ struct gpi {
+ typedef cc::ellen_bintree::node<rcu_gpi, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+ struct gpb {
+ typedef cc::ellen_bintree::node<rcu_gpb, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+ struct gpt {
+ typedef cc::ellen_bintree::node<rcu_gpt, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ struct shb {
+ typedef cc::ellen_bintree::node<rcu_shb, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+ struct sht {
+ typedef cc::ellen_bintree::node<rcu_sht, key_val> leaf_node;
+ typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node;
+ typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
+ };
+#endif
+ };
+
+ struct traits_EllenBinTreeSet: public cc::ellen_bintree::make_set_traits<
+ cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor >
+ ,co::less< typename ellen_bintree_props::less >
+ ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > >
+ >::type
+ {};
+
+ struct traits_EllenBinTreeSet_hp : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_hp > EllenBinTreeSet_hp;
+
+ struct traits_EllenBinTreeSet_dhp : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_dhp > EllenBinTreeSet_dhp;
+
+ struct traits_EllenBinTreeSet_gpi : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_gpi > EllenBinTreeSet_rcu_gpi;
+
+ struct traits_EllenBinTreeSet_gpb : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_gpb > EllenBinTreeSet_rcu_gpb;
+
+ struct traits_EllenBinTreeSet_gpt : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_gpt > EllenBinTreeSet_rcu_gpt;
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ struct traits_EllenBinTreeSet_shb : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_shb > EllenBinTreeSet_rcu_shb;
+
+ struct traits_EllenBinTreeSet_sht : public traits_EllenBinTreeSet
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_sht > EllenBinTreeSet_rcu_sht;
+#endif
+
+ //
+ struct traits_EllenBinTreeSet_yield : public traits_EllenBinTreeSet
+ {
+ typedef cds::backoff::yield back_off;
+ };
+
+ struct traits_EllenBinTreeSet_yield_hp : public traits_EllenBinTreeSet_yield
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_yield_hp > EllenBinTreeSet_yield_hp;
+
+ struct traits_EllenBinTreeSet_yield_dhp : public traits_EllenBinTreeSet_yield
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_yield_dhp > EllenBinTreeSet_yield_dhp;
+
+
+ struct traits_EllenBinTreeSet_yield_gpb : public traits_EllenBinTreeSet_yield
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_yield_gpb > EllenBinTreeSet_yield_rcu_gpb;
+
+
+ struct traits_EllenBinTreeSet_stat: public cc::ellen_bintree::make_set_traits<
+ cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor >
+ ,co::less< typename ellen_bintree_props::less >
+ ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > >
+ ,co::stat< cc::ellen_bintree::stat<> >
+ >::type
+ {};
+
+ struct traits_EllenBinTreeSet_stat_hp : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_stat_hp > EllenBinTreeSet_hp_stat;
+
+ struct traits_EllenBinTreeSet_stat_dhp : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_stat_dhp > EllenBinTreeSet_dhp_stat;
+
+ struct traits_EllenBinTreeSet_stat_gpi : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_stat_gpi > EllenBinTreeSet_rcu_gpi_stat;
+
+ struct traits_EllenBinTreeSet_stat_gpb : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_stat_gpb > EllenBinTreeSet_rcu_gpb_stat;
+
+ struct traits_EllenBinTreeSet_stat_gpt : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_stat_gpt > EllenBinTreeSet_rcu_gpt_stat;
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ struct traits_EllenBinTreeSet_stat_shb : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_stat_shb > EllenBinTreeSet_rcu_shb_stat;
+
+ struct traits_EllenBinTreeSet_stat_sht : public traits_EllenBinTreeSet_stat
+ {
+ typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator;
+ };
+ typedef EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_stat_sht > EllenBinTreeSet_rcu_sht_stat;
+#endif
+
+ };
+
+ template <typename GC, typename Key, typename T, typename Traits>
+ static inline void print_stat( cds_test::property_stream& o, EllenBinTreeSet<GC, Key, T, Traits> const& s )
+ {
+ o << s.statistics();
+ }
+
+ namespace ellen_bintree_check {
+ static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& /*s*/ )
+ {
+ // Not true for threaded RCU
+ /*
+ EXPECT_EQ( ellen_bintree_pool::internal_node_counter::m_nAlloc.get(), ellen_bintree_pool::internal_node_counter::m_nFree.get());
+ */
+ }
+ static inline void check_stat( cds::intrusive::ellen_bintree::stat<> const& stat )
+ {
+ EXPECT_EQ( stat.m_nInternalNodeCreated, stat.m_nInternalNodeDeleted );
+ EXPECT_EQ( stat.m_nUpdateDescCreated, stat.m_nUpdateDescDeleted );
+ //EXPECT_EQ( ellen_bintree_pool::internal_node_counter::m_nAlloc.get(), ellen_bintree_pool::internal_node_counter::m_nFree.get() );
+ EXPECT_EQ( ellen_bintree_pool::internal_node_counter::m_nAlloc.get(), stat.m_nInternalNodeCreated );
+ // true if RCU is not threaded
+ //EXPECT_EQ( stat.m_nInternalNodeDeleted, ellen_bintree_pool::internal_node_counter::m_nFree.get() );
+ }
+ } // namespace ellen_bintree_check
+
+ template <typename GC, typename Key, typename T, typename Traits>
+ static inline void additional_check( EllenBinTreeSet<GC, Key, T, Traits>& s )
+ {
+ typedef EllenBinTreeSet<GC, Key, T, Traits> set_type;
+ GC::force_dispose();
+ ellen_bintree_check::check_stat( s.statistics());
+/*
+ bool const threaded_rcu = std::is_same<typename set_type::rcu_tag, cds::urcu::general_threaded_tag >::value
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ || std::is_same<typename set_type::rcu_tag, signal_threaded_tag >::value
+#endif
+ ;
+ if ( !threaded_rcu ) {
+ EXPECT_EQ( ellen_bintree_pool::internal_node_counter::m_nAlloc.get(), ellen_bintree_pool::internal_node_counter::m_nFree.get());
+ }
+*/
+ }
+
+ template <typename GC, typename Key, typename T, typename Traits>
+ static inline void additional_cleanup( EllenBinTreeSet<GC, Key, T, Traits>& /*s*/ )
+ {
+ ellen_bintree_pool::internal_node_counter::reset();
+ }
+
+ template <typename GC, typename Key, typename T, typename Traits>
+ static inline void check_before_clear( cds::container::EllenBinTreeSet<GC, Key, T, Traits>& s )
+ {
+ EXPECT_TRUE( s.check_consistency() );
+ }
+
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_ELLEN_BINTREE_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_FELDMAN_HASHSET_H
+#define CDSUNIT_SET_TYPE_FELDMAN_HASHSET_H
+
+#include "set/set_type.h"
+
+#include <cds/container/feldman_hashset_hp.h>
+#include <cds/container/feldman_hashset_dhp.h>
+#include <cds/container/feldman_hashset_rcu.h>
+
+#include <cds_test/stat_feldman_hashset_out.h>
+#include <cds_test/hash_func.h>
+
+namespace set {
+
+ template <class GC, typename T, typename Traits = cc::feldman_hashset::traits>
+ class FeldmanHashSet : public cc::FeldmanHashSet< GC, T, Traits >
+ {
+ typedef cc::FeldmanHashSet< GC, T, Traits > base_class;
+
+ template <typename G>
+ struct get_extracted_ptr
+ {
+ typedef typename base_class::guarded_ptr extracted_ptr;
+ };
+
+ template <typename RCU>
+ struct get_extracted_ptr<cds::urcu::gc<RCU>>
+ {
+ typedef typename base_class::exempt_ptr extracted_ptr;
+ };
+
+ public:
+ typedef typename T::hasher hasher;
+ typedef typename get_extracted_ptr<GC>::extracted_ptr extracted_ptr;
+
+ template <class Config>
+ FeldmanHashSet( Config const& cfg )
+ : base_class( cfg.s_nFeldmanSet_HeadBits, cfg.s_nFeldmanSet_ArrayBits )
+ {}
+
+ template <typename Q>
+ bool erase( Q const& key )
+ {
+ return base_class::erase( hasher()( key ));
+ }
+
+ template <typename Q, typename Func>
+ bool erase( Q const& key, Func f )
+ {
+ return base_class::erase( hasher()( key ), f );
+ }
+
+ template <typename Q>
+ extracted_ptr extract(Q const& key)
+ {
+ return base_class::extract( hasher()(key) );
+ }
+
+ template <typename Q>
+ bool contains( Q const& key )
+ {
+ return base_class::contains( hasher()(key) );
+ }
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = true;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = true;
+ };
+
+ struct tag_FeldmanHashSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_FeldmanHashSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+ typedef typename base_class::key_type key_type;
+ typedef typename base_class::value_type value_type;
+
+ template <typename Hasher>
+ struct hash_type
+ {
+ typedef Hasher hasher;
+ typedef typename hasher::hash_type type;
+ };
+
+ template <typename TH>
+ struct hash_type<std::hash<TH>>
+ {
+ typedef std::hash<TH> hasher;
+ typedef size_t type;
+ };
+
+ template <typename Hasher>
+ struct key_val: base_class::key_val
+ {
+ typedef typename base_class::key_val base;
+ typedef Hasher hasher;
+ typedef typename hash_type<hasher>::type hash_type;
+
+ hash_type hash;
+
+ /*explicit*/ key_val( key_type const& k ): base(k), hash( hasher()( k )) {}
+ key_val( key_type const& k, value_type const& v ): base(k, v), hash( hasher()( k )) {}
+
+ template <typename K>
+ /*explicit*/ key_val( K const& k ): base(k), hash( hasher()( k )) {}
+
+ template <typename K, typename T>
+ key_val( K const& k, T const& v ): base(k, v), hash( hasher()( k )) {}
+ };
+
+ struct default_traits : public cc::feldman_hashset::traits
+ {
+ struct hash_accessor {
+ template <typename Hasher>
+ typename key_val<Hasher>::hash_type const& operator()( key_val<Hasher> const& kv )
+ {
+ return kv.hash;
+ }
+ };
+ };
+
+ typedef FeldmanHashSet< cds::gc::HP, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_hp_stdhash;
+ typedef FeldmanHashSet< cds::gc::DHP, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_dhp_stdhash;
+ typedef FeldmanHashSet< rcu_gpi, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_rcu_gpi_stdhash;
+ typedef FeldmanHashSet< rcu_gpb, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_rcu_gpb_stdhash;
+ typedef FeldmanHashSet< rcu_gpt, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_rcu_gpt_stdhash;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_rcu_shb_stdhash;
+ typedef FeldmanHashSet< rcu_sht, key_val<std::hash<key_type>>, default_traits > FeldmanHashSet_rcu_sht_stdhash;
+#endif
+
+ struct traits_FeldmanHashSet_stat: public cc::feldman_hashset::make_traits<
+ co::type_traits< default_traits >,
+ co::stat< cc::feldman_hashset::stat<>>
+ >::type
+ {};
+
+ typedef FeldmanHashSet< cds::gc::HP, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_hp_stdhash_stat;
+ typedef FeldmanHashSet< cds::gc::DHP, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_dhp_stdhash_stat;
+ typedef FeldmanHashSet< rcu_gpi, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_gpi_stdhash_stat;
+ typedef FeldmanHashSet< rcu_gpb, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_gpb_stdhash_stat;
+ typedef FeldmanHashSet< rcu_gpt, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_gpt_stdhash_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_shb_stdhash_stat;
+ typedef FeldmanHashSet< rcu_sht, key_val<std::hash<key_type>>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_sht_stdhash_stat;
+#endif
+
+ // CityHash
+#if CDS_BUILD_BITS == 64
+ struct traits_FeldmanHashSet_city64 : public default_traits
+ {
+ typedef ::cds_test::city64::less less;
+ };
+ typedef FeldmanHashSet< cds::gc::HP, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_hp_city64;
+ typedef FeldmanHashSet< cds::gc::DHP, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_dhp_city64;
+ typedef FeldmanHashSet< rcu_gpi, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_gpi_city64;
+ typedef FeldmanHashSet< rcu_gpb, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_gpb_city64;
+ typedef FeldmanHashSet< rcu_gpt, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_gpt_city64;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_shb_city64;
+ typedef FeldmanHashSet< rcu_sht, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64 > FeldmanHashSet_rcu_sht_city64;
+#endif
+
+ struct traits_FeldmanHashSet_city64_stat : public traits_FeldmanHashSet_city64
+ {
+ typedef cc::feldman_hashset::stat<> stat;
+ };
+ typedef FeldmanHashSet< cds::gc::HP, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_hp_city64_stat;
+ typedef FeldmanHashSet< cds::gc::DHP, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_dhp_city64_stat;
+ typedef FeldmanHashSet< rcu_gpi, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_gpi_city64_stat;
+ typedef FeldmanHashSet< rcu_gpb, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_gpb_city64_stat;
+ typedef FeldmanHashSet< rcu_gpt, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_gpt_city64_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_shb_city64_stat;
+ typedef FeldmanHashSet< rcu_sht, key_val<::cds_test::city64>, traits_FeldmanHashSet_city64_stat > FeldmanHashSet_rcu_sht_city64_stat;
+#endif
+
+ struct traits_FeldmanHashSet_city128 : public default_traits
+ {
+ typedef ::cds_test::city128::less less;
+ };
+ typedef FeldmanHashSet< cds::gc::HP, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_hp_city128;
+ typedef FeldmanHashSet< cds::gc::DHP, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_dhp_city128;
+ typedef FeldmanHashSet< rcu_gpi, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_gpi_city128;
+ typedef FeldmanHashSet< rcu_gpb, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_gpb_city128;
+ typedef FeldmanHashSet< rcu_gpt, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_gpt_city128;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_shb_city128;
+ typedef FeldmanHashSet< rcu_sht, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128 > FeldmanHashSet_rcu_sht_city128;
+#endif
+
+ struct traits_FeldmanHashSet_city128_stat : public traits_FeldmanHashSet_city128
+ {
+ typedef cc::feldman_hashset::stat<> stat;
+ };
+ typedef FeldmanHashSet< cds::gc::HP, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_hp_city128_stat;
+ typedef FeldmanHashSet< cds::gc::DHP, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_dhp_city128_stat;
+ typedef FeldmanHashSet< rcu_gpi, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_gpi_city128_stat;
+ typedef FeldmanHashSet< rcu_gpb, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_gpb_city128_stat;
+ typedef FeldmanHashSet< rcu_gpt, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_gpt_city128_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_shb_city128_stat;
+ typedef FeldmanHashSet< rcu_sht, key_val<::cds_test::city128>, traits_FeldmanHashSet_city128_stat > FeldmanHashSet_rcu_sht_city128_stat;
+#endif
+
+#endif // #if CDS_BUILD_BITS == 64
+
+
+ // for fixed-sized key
+ // No hash function is necessary
+
+ struct fixed_sized_key
+ {
+ typedef typename set_type_base< Key, Val >::key_type key_type;
+ struct key_val : public set_type_base< Key, Val >::key_val
+ {
+ typedef typename set_type_base< Key, Val >::key_val base_class;
+
+ /*explicit*/ key_val(key_type const& k) : base_class(k) {}
+ key_val(key_type const& k, value_type const& v) : base_class(k, v) {}
+
+ template <typename K>
+ /*explicit*/ key_val(K const& k) : base_class(k) {}
+
+ template <typename K, typename T>
+ key_val(K const& k, T const& v) : base_class(k, v) {}
+
+ // mock hasher
+ struct hasher {
+ template <typename Q>
+ key_type operator()( Q const& k ) const
+ {
+ return key_type( k );
+ }
+ };
+ };
+
+ struct traits : public cc::feldman_hashset::traits
+ {
+ struct hash_accessor {
+ key_type operator()(key_val const& kv)
+ {
+ return kv.key;
+ }
+ };
+ };
+
+ struct traits_stat : public traits
+ {
+ typedef cc::feldman_hashset::stat<> stat;
+ };
+ };
+
+ typedef FeldmanHashSet< cds::gc::HP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_hp_fixed;
+ typedef FeldmanHashSet< cds::gc::DHP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_dhp_fixed;
+ typedef FeldmanHashSet< rcu_gpi, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_gpi_fixed;
+ typedef FeldmanHashSet< rcu_gpb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_gpb_fixed;
+ typedef FeldmanHashSet< rcu_gpt, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_gpt_fixed;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_shb_fixed;
+ typedef FeldmanHashSet< rcu_sht, typename fixed_sized_key::key_val, typename fixed_sized_key::traits > FeldmanHashSet_rcu_sht_fixed;
+#endif
+
+ typedef FeldmanHashSet< cds::gc::HP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_hp_fixed_stat;
+ typedef FeldmanHashSet< cds::gc::DHP, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_dhp_fixed_stat;
+ typedef FeldmanHashSet< rcu_gpi, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_gpi_fixed_stat;
+ typedef FeldmanHashSet< rcu_gpb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_gpb_fixed_stat;
+ typedef FeldmanHashSet< rcu_gpt, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_gpt_fixed_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef FeldmanHashSet< rcu_shb, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_shb_fixed_stat;
+ typedef FeldmanHashSet< rcu_sht, typename fixed_sized_key::key_val, typename fixed_sized_key::traits_stat > FeldmanHashSet_rcu_sht_fixed_stat;
+#endif
+
+ };
+
+ template <typename GC, typename T, typename Traits >
+ static inline void print_stat( cds_test::property_stream& o, FeldmanHashSet< GC, T, Traits > const& s )
+ {
+ std::vector< cds::intrusive::feldman_hashset::level_statistics > level_stat;
+ s.get_level_statistics( level_stat );
+
+ o << s.statistics() << level_stat;
+ }
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_FELDMAN_HASHSET_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_LAZY_LIST_H
+#define CDSUNIT_SET_TYPE_LAZY_LIST_H
+
+#include "set_type.h"
+
+#include <cds/container/lazy_list_hp.h>
+#include <cds/container/lazy_list_dhp.h>
+#include <cds/container/lazy_list_rcu.h>
+
+namespace set {
+
+ template <typename Key, typename Val>
+ struct lazy_list_type
+ {
+ typedef typename set_type_base< Key, Val >::key_val key_val;
+ typedef typename set_type_base< Key, Val >::compare compare;
+ typedef typename set_type_base< Key, Val >::less less;
+
+ struct traits_LazyList_cmp_stdAlloc :
+ public cc::lazy_list::make_traits<
+ co::compare< compare >
+ >::type
+ {};
+ typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_cmp_stdAlloc > LazyList_HP_cmp_stdAlloc;
+ typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_cmp_stdAlloc > LazyList_DHP_cmp_stdAlloc;
+ typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPI_cmp_stdAlloc;
+ typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPB_cmp_stdAlloc;
+ typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_GPT_cmp_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_SHB_cmp_stdAlloc;
+ typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_cmp_stdAlloc > LazyList_RCU_SHT_cmp_stdAlloc;
+#endif
+ struct traits_LazyList_cmp_stdAlloc_seqcst :
+ public cc::lazy_list::make_traits<
+ co::compare< compare >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ {};
+ typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_HP_cmp_stdAlloc_seqcst;
+ typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_DHP_cmp_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPI_cmp_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPB_cmp_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_GPT_cmp_stdAlloc_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_SHB_cmp_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_cmp_stdAlloc_seqcst > LazyList_RCU_SHT_cmp_stdAlloc_seqcst;
+#endif
+ struct traits_LazyList_cmp_michaelAlloc :
+ public cc::lazy_list::make_traits<
+ co::compare< compare >,
+ co::allocator< memory::MichaelAllocator<int> >
+ >::type
+ {};
+ typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_HP_cmp_michaelAlloc;
+ typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_DHP_cmp_michaelAlloc;
+ typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPI_cmp_michaelAlloc;
+ typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPB_cmp_michaelAlloc;
+ typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_GPT_cmp_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_SHB_cmp_michaelAlloc;
+ typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_cmp_michaelAlloc > LazyList_RCU_SHT_cmp_michaelAlloc;
+#endif
+
+ struct traits_LazyList_less_stdAlloc:
+ public cc::lazy_list::make_traits<
+ co::less< less >
+ >::type
+ {};
+ typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_less_stdAlloc > LazyList_HP_less_stdAlloc;
+ typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_less_stdAlloc > LazyList_DHP_less_stdAlloc;
+ typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_GPI_less_stdAlloc;
+ typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_GPB_less_stdAlloc;
+ typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_GPT_less_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_SHB_less_stdAlloc;
+ typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_less_stdAlloc > LazyList_RCU_SHT_less_stdAlloc;
+#endif
+
+ struct traits_LazyList_less_stdAlloc_seqcst :
+ public cc::lazy_list::make_traits<
+ co::less< less >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ {};
+ typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_HP_less_stdAlloc_seqcst;
+ typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_DHP_less_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPI_less_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPB_less_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_GPT_less_stdAlloc_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_SHB_less_stdAlloc_seqcst;
+ typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_less_stdAlloc_seqcst > LazyList_RCU_SHT_less_stdAlloc_seqcst;
+#endif
+
+ struct traits_LazyList_less_michaelAlloc :
+ public cc::lazy_list::make_traits<
+ co::less< less >,
+ co::allocator< memory::MichaelAllocator<int> >
+ >::type
+ {};
+ typedef cc::LazyList< cds::gc::HP, key_val, traits_LazyList_less_michaelAlloc > LazyList_HP_less_michaelAlloc;
+ typedef cc::LazyList< cds::gc::DHP, key_val, traits_LazyList_less_michaelAlloc > LazyList_DHP_less_michaelAlloc;
+ typedef cc::LazyList< rcu_gpi, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPI_less_michaelAlloc;
+ typedef cc::LazyList< rcu_gpb, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPB_less_michaelAlloc;
+ typedef cc::LazyList< rcu_gpt, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_GPT_less_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::LazyList< rcu_shb, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_SHB_less_michaelAlloc;
+ typedef cc::LazyList< rcu_sht, key_val, traits_LazyList_less_michaelAlloc > LazyList_RCU_SHT_less_michaelAlloc;
+#endif
+ };
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_LAZY_LIST_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_MICHAEL_H
+#define CDSUNIT_SET_TYPE_MICHAEL_H
+
+#include "set_type_michael_list.h"
+#include "set_type_lazy_list.h"
+
+#include <cds/container/michael_set.h>
+#include <cds/container/michael_set_rcu.h>
+
+#include <framework/michael_alloc.h>
+
+namespace set {
+
+ template <class GC, typename List, typename Traits = cc::michael_set::traits>
+ class MichaelHashSet : public cc::MichaelHashSet< GC, List, Traits >
+ {
+ typedef cc::MichaelHashSet< GC, List, Traits > base_class;
+ public:
+ template <class Config>
+ MichaelHashSet( Config const& cfg )
+ : base_class( cfg.s_nSetSize, cfg.s_nLoadFactor )
+ {}
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = true;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ struct tag_MichaelHashSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_MichaelHashSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+
+ // ***************************************************************************
+ // MichaelHashSet based on MichaelList
+
+ typedef michael_list_type< Key, Val > ml;
+
+ struct traits_MichaelSet_stdAlloc :
+ public cc::michael_set::make_traits<
+ co::hash< hash >
+ >::type
+ {};
+ typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_HP_cmp_stdAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_DHP_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPI_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPB_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPT_cmp_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHB_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHT_cmp_stdAlloc;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_HP_less_stdAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_DHP_less_stdAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPI_less_stdAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPB_less_stdAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPT_less_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHB_less_stdAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHT_less_stdAlloc;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_HP_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_DHP_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPI_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPB_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_GPT_less_stdAlloc_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHB_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_RCU_SHT_less_stdAlloc_seqcst;
+#endif
+
+ struct traits_MichaelSet_michaelAlloc :
+ public cc::michael_set::make_traits<
+ co::hash< hash >,
+ co::allocator< memory::MichaelAllocator<int> >
+ >::type
+ {};
+ typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_HP_cmp_michaelAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_DHP_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPI_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPB_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPT_cmp_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHB_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHT_cmp_michaelAlloc;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ml::MichaelList_HP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_HP_less_michaelAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ml::MichaelList_DHP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_DHP_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ml::MichaelList_RCU_GPI_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPI_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ml::MichaelList_RCU_GPB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPB_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ml::MichaelList_RCU_GPT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_GPT_less_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ml::MichaelList_RCU_SHB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHB_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ml::MichaelList_RCU_SHT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_RCU_SHT_less_michaelAlloc;
+#endif
+
+
+ // ***************************************************************************
+ // MichaelHashSet based on LazyList
+
+ typedef lazy_list_type< Key, Val > ll;
+
+ typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_HP_cmp_stdAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_DHP_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPI_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPB_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPT_cmp_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHB_cmp_stdAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHT_cmp_stdAlloc;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_HP_less_stdAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_DHP_less_stdAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPI_less_stdAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPB_less_stdAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPT_less_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHB_less_stdAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_less_stdAlloc, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHT_less_stdAlloc;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_HP_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_DHP_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPI_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPB_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_GPT_less_stdAlloc_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHB_less_stdAlloc_seqcst;
+ typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_less_stdAlloc_seqcst, traits_MichaelSet_stdAlloc > MichaelSet_Lazy_RCU_SHT_less_stdAlloc_seqcst;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_HP_cmp_michaelAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_DHP_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPI_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPB_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPT_cmp_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHB_cmp_michaelAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_cmp_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHT_cmp_michaelAlloc;
+#endif
+
+ typedef MichaelHashSet< cds::gc::HP, typename ll::LazyList_HP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_HP_less_michaelAlloc;
+ typedef MichaelHashSet< cds::gc::DHP, typename ll::LazyList_DHP_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_DHP_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpi, typename ll::LazyList_RCU_GPI_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPI_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpb, typename ll::LazyList_RCU_GPB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPB_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_gpt, typename ll::LazyList_RCU_GPT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_GPT_less_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef MichaelHashSet< rcu_shb, typename ll::LazyList_RCU_SHB_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHB_less_michaelAlloc;
+ typedef MichaelHashSet< rcu_sht, typename ll::LazyList_RCU_SHT_less_michaelAlloc, traits_MichaelSet_michaelAlloc > MichaelSet_Lazy_RCU_SHT_less_michaelAlloc;
+#endif
+ };
+
+} // namespace set
+
+
+#endif // #ifndef CDSUNIT_SET_TYPE_MICHAEL_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_MICHAEL_LIST_H
+#define CDSUNIT_SET_TYPE_MICHAEL_LIST_H
+
+#include "set_type.h"
+
+#include <cds/container/michael_list_hp.h>
+#include <cds/container/michael_list_dhp.h>
+#include <cds/container/michael_list_rcu.h>
+
+namespace set {
+
+ template <typename Key, typename Val>
+ struct michael_list_type
+ {
+ typedef typename set_type_base< Key, Val >::key_val key_val;
+ typedef typename set_type_base< Key, Val >::compare compare;
+ typedef typename set_type_base< Key, Val >::less less;
+
+ struct traits_MichaelList_cmp_stdAlloc:
+ public cc::michael_list::make_traits<
+ co::compare< compare >
+ >::type
+ {};
+ typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_HP_cmp_stdAlloc;
+ typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_DHP_cmp_stdAlloc;
+ typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPI_cmp_stdAlloc;
+ typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPB_cmp_stdAlloc;
+ typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_GPT_cmp_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_SHB_cmp_stdAlloc;
+ typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_cmp_stdAlloc > MichaelList_RCU_SHT_cmp_stdAlloc;
+#endif
+
+ struct traits_MichaelList_cmp_stdAlloc_seqcst : public traits_MichaelList_cmp_stdAlloc
+ {
+ typedef co::v::sequential_consistent memory_model;
+ };
+ typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_HP_cmp_stdAlloc_seqcst;
+ typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_DHP_cmp_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPI_cmp_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPB_cmp_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_GPT_cmp_stdAlloc_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_SHB_cmp_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_cmp_stdAlloc_seqcst > MichaelList_RCU_SHT_cmp_stdAlloc_seqcst;
+#endif
+
+ struct traits_MichaelList_less_stdAlloc :
+ public cc::michael_list::make_traits<
+ co::less< less >
+ >::type
+ {};
+ typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_less_stdAlloc > MichaelList_HP_less_stdAlloc;
+ typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_less_stdAlloc > MichaelList_DHP_less_stdAlloc;
+ typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPI_less_stdAlloc;
+ typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPB_less_stdAlloc;
+ typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_GPT_less_stdAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_SHB_less_stdAlloc;
+ typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_less_stdAlloc > MichaelList_RCU_SHT_less_stdAlloc;
+#endif
+
+ struct traits_MichaelList_less_stdAlloc_seqcst :
+ public cc::michael_list::make_traits<
+ co::less< less >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ {};
+ typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_HP_less_stdAlloc_seqcst;
+ typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_DHP_less_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPI_less_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPB_less_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_GPT_less_stdAlloc_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_SHB_less_stdAlloc_seqcst;
+ typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_less_stdAlloc_seqcst > MichaelList_RCU_SHT_less_stdAlloc_seqcst;
+#endif
+
+ struct traits_MichaelList_cmp_michaelAlloc :
+ public cc::michael_list::make_traits<
+ co::compare< compare >,
+ co::allocator< memory::MichaelAllocator<int> >
+ >::type
+ {};
+ typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_HP_cmp_michaelAlloc;
+ typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_DHP_cmp_michaelAlloc;
+ typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPI_cmp_michaelAlloc;
+ typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPB_cmp_michaelAlloc;
+ typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_GPT_cmp_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_SHB_cmp_michaelAlloc;
+ typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_cmp_michaelAlloc > MichaelList_RCU_SHT_cmp_michaelAlloc;
+#endif
+
+ struct traits_MichaelList_less_michaelAlloc :
+ public cc::michael_list::make_traits<
+ co::less< less >,
+ co::allocator< memory::MichaelAllocator<int> >
+ >::type
+ {};
+ typedef cc::MichaelList< cds::gc::HP, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_HP_less_michaelAlloc;
+ typedef cc::MichaelList< cds::gc::DHP, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_DHP_less_michaelAlloc;
+ typedef cc::MichaelList< rcu_gpi, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPI_less_michaelAlloc;
+ typedef cc::MichaelList< rcu_gpb, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPB_less_michaelAlloc;
+ typedef cc::MichaelList< rcu_gpt, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_GPT_less_michaelAlloc;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef cc::MichaelList< rcu_shb, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_SHB_less_michaelAlloc;
+ typedef cc::MichaelList< rcu_sht, key_val, traits_MichaelList_less_michaelAlloc > MichaelList_RCU_SHT_less_michaelAlloc;
+#endif
+ };
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_MICHAEL_LIST_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H
+#define CDSUNIT_SET_TYPE_SKIP_LIST_H
+
+#include "set_type.h"
+
+#include <cds/container/skip_list_set_hp.h>
+#include <cds/container/skip_list_set_dhp.h>
+#include <cds/container/skip_list_set_rcu.h>
+
+#include <cds_test/stat_skiplist_out.h>
+
+namespace set {
+
+ template <typename GC, typename T, typename Traits = cc::skip_list::traits >
+ class SkipListSet : public cc::SkipListSet<GC, T, Traits>
+ {
+ typedef cc::SkipListSet<GC, T, Traits> base_class;
+ public:
+ template <typename Config>
+ SkipListSet( Config const& /*cfg*/ )
+ {}
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = true;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ struct tag_SkipListSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_SkipListSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+
+ class traits_SkipListSet_less_pascal: public cc::skip_list::make_traits <
+ co::less< less >
+ ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_pascal > SkipListSet_hp_less_pascal;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_pascal > SkipListSet_dhp_less_pascal;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_gpi_less_pascal;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_gpb_less_pascal;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_gpt_less_pascal;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_shb_less_pascal;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_pascal > SkipListSet_rcu_sht_less_pascal;
+#endif
+
+ class traits_SkipListSet_less_pascal_seqcst: public cc::skip_list::make_traits <
+ co::less< less >
+ ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_hp_less_pascal_seqcst;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_dhp_less_pascal_seqcst;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_gpi_less_pascal_seqcst;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_gpb_less_pascal_seqcst;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_gpt_less_pascal_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_shb_less_pascal_seqcst;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_pascal_seqcst > SkipListSet_rcu_sht_less_pascal_seqcst;
+#endif
+
+ class traits_SkipListSet_less_pascal_stat: public cc::skip_list::make_traits <
+ co::less< less >
+ ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
+ ,co::stat< cc::skip_list::stat<> >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_hp_less_pascal_stat;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_dhp_less_pascal_stat;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_gpi_less_pascal_stat;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_gpb_less_pascal_stat;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_gpt_less_pascal_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_shb_less_pascal_stat;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_pascal_stat > SkipListSet_rcu_sht_less_pascal_stat;
+#endif
+
+ class traits_SkipListSet_cmp_pascal: public cc::skip_list::make_traits <
+ co::compare< compare >
+ ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_hp_cmp_pascal;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_dhp_cmp_pascal;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_gpi_cmp_pascal;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_gpb_cmp_pascal;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_gpt_cmp_pascal;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_shb_cmp_pascal;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_pascal > SkipListSet_rcu_sht_cmp_pascal;
+#endif
+
+ class traits_SkipListSet_cmp_pascal_stat: public cc::skip_list::make_traits <
+ co::compare< compare >
+ ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
+ ,co::stat< cc::skip_list::stat<> >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_hp_cmp_pascal_stat;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_dhp_cmp_pascal_stat;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_gpi_cmp_pascal_stat;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_gpb_cmp_pascal_stat;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_gpt_cmp_pascal_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_shb_cmp_pascal_stat;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_pascal_stat > SkipListSet_rcu_sht_cmp_pascal_stat;
+#endif
+
+ class traits_SkipListSet_less_xorshift: public cc::skip_list::make_traits <
+ co::less< less >
+ ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift > SkipListSet_hp_less_xorshift;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift > SkipListSet_dhp_less_xorshift;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_gpi_less_xorshift;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_gpb_less_xorshift;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_gpt_less_xorshift;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_shb_less_xorshift;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_xorshift > SkipListSet_rcu_sht_less_xorshift;
+#endif
+
+ class traits_SkipListSet_less_xorshift_stat: public cc::skip_list::make_traits <
+ co::less< less >
+ ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
+ ,co::stat< cc::skip_list::stat<> >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_hp_less_xorshift_stat;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_dhp_less_xorshift_stat;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_gpi_less_xorshift_stat;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_gpb_less_xorshift_stat;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_gpt_less_xorshift_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_shb_less_xorshift_stat;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_less_xorshift_stat > SkipListSet_rcu_sht_less_xorshift_stat;
+#endif
+
+ class traits_SkipListSet_cmp_xorshift: public cc::skip_list::make_traits <
+ co::compare< compare >
+ ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_hp_cmp_xorshift;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_dhp_cmp_xorshift;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_gpi_cmp_xorshift;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_gpb_cmp_xorshift;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_gpt_cmp_xorshift;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_shb_cmp_xorshift;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_xorshift > SkipListSet_rcu_sht_cmp_xorshift;
+#endif
+
+ class traits_SkipListSet_cmp_xorshift_stat: public cc::skip_list::make_traits <
+ co::compare< compare >
+ ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
+ ,co::stat< cc::skip_list::stat<> >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_hp_cmp_xorshift_stat;
+ typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_dhp_cmp_xorshift_stat;
+ typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_gpi_cmp_xorshift_stat;
+ typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_gpb_cmp_xorshift_stat;
+ typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_gpt_cmp_xorshift_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_shb_cmp_xorshift_stat;
+ typedef SkipListSet< rcu_sht, key_val, traits_SkipListSet_cmp_xorshift_stat > SkipListSet_rcu_sht_cmp_xorshift_stat;
+#endif
+ };
+
+ template <typename GC, typename T, typename Traits>
+ static inline void print_stat( cds_test::property_stream& o, SkipListSet<GC, T, Traits> const& s )
+ {
+ o << s.statistics();
+ }
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_SPLIT_LIST_H
+#define CDSUNIT_SET_TYPE_SPLIT_LIST_H
+
+#include "set_type.h"
+
+#include <cds/container/michael_list_hp.h>
+#include <cds/container/michael_list_dhp.h>
+#include <cds/container/michael_list_rcu.h>
+#include <cds/container/lazy_list_hp.h>
+#include <cds/container/lazy_list_dhp.h>
+#include <cds/container/lazy_list_rcu.h>
+
+#include <cds/container/split_list_set.h>
+#include <cds/container/split_list_set_rcu.h>
+
+#include <cds_test/stat_splitlist_out.h>
+
+namespace set {
+
+ template <typename GC, typename T, typename Traits = cc::split_list::traits>
+ class SplitListSet : public cc::SplitListSet< GC, T, Traits >
+ {
+ typedef cc::SplitListSet< GC, T, Traits > base_class;
+ public:
+ template <typename Config>
+ SplitListSet( Config const& cfg )
+ : base_class( cfg.s_nSetSize, cfg.s_nLoadFactor )
+ {}
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = true;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ struct tag_SplitListSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_SplitListSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+
+ // ***************************************************************************
+ // SplitListSet based on MichaelList
+
+ struct traits_SplitList_Michael_dyn_cmp :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::compare< compare >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_HP_dyn_cmp;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_DHP_dyn_cmp;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPI_dyn_cmp;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPB_dyn_cmp;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_GPT_dyn_cmp;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_SHB_dyn_cmp;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_cmp > SplitList_Michael_RCU_SHT_dyn_cmp;
+#endif
+
+ struct traits_SplitList_Michael_dyn_cmp_stat :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,co::stat< cc::split_list::stat<> >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::compare< compare >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_HP_dyn_cmp_stat;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_DHP_dyn_cmp_stat;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPI_dyn_cmp_stat;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPB_dyn_cmp_stat;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_GPT_dyn_cmp_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_SHB_dyn_cmp_stat;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_cmp_stat > SplitList_Michael_RCU_SHT_dyn_cmp_stat;
+#endif
+
+ struct traits_SplitList_Michael_dyn_cmp_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::compare< compare >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_HP_dyn_cmp_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_DHP_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPI_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPB_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_GPT_dyn_cmp_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_SHB_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_cmp_seqcst > SplitList_Michael_RCU_SHT_dyn_cmp_seqcst;
+#endif
+
+ struct traits_SplitList_Michael_st_cmp :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::compare< compare >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_HP_st_cmp;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_DHP_st_cmp;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPI_st_cmp;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPB_st_cmp;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_GPT_st_cmp;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_SHB_st_cmp;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_cmp > SplitList_Michael_RCU_SHT_st_cmp;
+#endif
+
+ struct traits_SplitList_Michael_st_cmp_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::compare< compare >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_HP_st_cmp_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_DHP_st_cmp_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_GPI_st_cmp_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_GPB_st_cmp_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_GPT_st_cmp_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_SHB_st_cmp_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_cmp_seqcst> SplitList_Michael_RCU_SHT_st_cmp_seqcst;
+#endif
+
+ //HP + less
+ struct traits_SplitList_Michael_dyn_less :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::less< less >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_HP_dyn_less;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_DHP_dyn_less;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPI_dyn_less;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPB_dyn_less;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_GPT_dyn_less;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_SHB_dyn_less;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_less > SplitList_Michael_RCU_SHT_dyn_less;
+#endif
+
+ struct traits_SplitList_Michael_dyn_less_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::less< less >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_HP_dyn_less_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_DHP_dyn_less_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPI_dyn_less_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPB_dyn_less_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_GPT_dyn_less_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_SHB_dyn_less_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_dyn_less_seqcst > SplitList_Michael_RCU_SHT_dyn_less_seqcst;
+#endif
+
+ struct traits_SplitList_Michael_st_less :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::less< less >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_HP_st_less;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_DHP_st_less;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPI_st_less;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPB_st_less;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_GPT_st_less;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_SHB_st_less;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_less > SplitList_Michael_RCU_SHT_st_less;
+#endif
+
+ struct traits_SplitList_Michael_st_less_stat :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::hash< hash >
+ ,co::stat< cc::split_list::stat<>>
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::less< less >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_HP_st_less_stat;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_DHP_st_less_stat;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPI_st_less_stat;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPB_st_less_stat;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_GPT_st_less_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_SHB_st_less_stat;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_less_stat > SplitList_Michael_RCU_SHT_st_less_stat;
+#endif
+
+ struct traits_SplitList_Michael_st_less_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::michael_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::michael_list::make_traits<
+ co::less< less >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_HP_st_less_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_DHP_st_less_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPI_st_less_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPB_st_less_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_GPT_st_less_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_SHB_st_less_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Michael_st_less_seqcst > SplitList_Michael_RCU_SHT_st_less_seqcst;
+#endif
+
+ // ***************************************************************************
+ // SplitListSet based on LazyList
+
+ struct traits_SplitList_Lazy_dyn_cmp :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::compare< compare >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_HP_dyn_cmp;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_DHP_dyn_cmp;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPI_dyn_cmp;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPB_dyn_cmp;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_GPT_dyn_cmp;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHB_dyn_cmp;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHT_dyn_cmp;
+#endif
+
+ struct traits_SplitList_Lazy_dyn_cmp_stat : public traits_SplitList_Lazy_dyn_cmp
+ {
+ typedef cc::split_list::stat<> stat;
+ };
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_HP_dyn_cmp_stat;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_DHP_dyn_cmp_stat;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPI_dyn_cmp_stat;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPB_dyn_cmp_stat;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_cmp_stat > SplitList_Lazy_RCU_GPT_dyn_cmp_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHB_dyn_cmp_stat;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_cmp > SplitList_Lazy_RCU_SHT_dyn_cmp_stat;
+#endif
+
+ struct traits_SplitList_Lazy_dyn_cmp_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,co::hash< hash >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::compare< compare >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_HP_dyn_cmp_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_DHP_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPI_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPB_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_GPT_dyn_cmp_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_SHB_dyn_cmp_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_cmp_seqcst > SplitList_Lazy_RCU_SHT_dyn_cmp_seqcst;
+#endif
+
+ struct traits_SplitList_Lazy_st_cmp :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::compare< compare >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_HP_st_cmp;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_DHP_st_cmp;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPI_st_cmp;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPB_st_cmp;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_GPT_st_cmp;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_SHB_st_cmp;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_cmp > SplitList_Lazy_RCU_SHT_st_cmp;
+#endif
+
+ struct traits_SplitList_Lazy_st_cmp_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::compare< compare >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_HP_st_cmp_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_DHP_st_cmp_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_GPI_st_cmp_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_GPB_st_cmp_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_GPT_st_cmp_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_SHB_st_cmp_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_cmp_seqcst > SplitList_Lazy_RCU_SHT_st_cmp_seqcst;
+#endif
+
+ struct traits_SplitList_Lazy_dyn_less :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::less< less >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_HP_dyn_less;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_DHP_dyn_less;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPI_dyn_less;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPB_dyn_less;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_GPT_dyn_less;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_SHB_dyn_less;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_less > SplitList_Lazy_RCU_SHT_dyn_less;
+#endif
+
+ struct traits_SplitList_Lazy_dyn_less_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,co::hash< hash >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::less< less >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_HP_dyn_less_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_DHP_dyn_less_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPI_dyn_less_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPB_dyn_less_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_GPT_dyn_less_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_SHB_dyn_less_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_dyn_less_seqcst > SplitList_Lazy_RCU_SHT_dyn_less_seqcst;
+#endif
+
+ struct traits_SplitList_Lazy_st_less :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::hash< hash >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::less< less >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_HP_st_less;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_DHP_st_less;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPI_st_less;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPB_st_less;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_GPT_st_less;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_SHB_st_less;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_less > SplitList_Lazy_RCU_SHT_st_less;
+#endif
+
+ struct traits_SplitList_Lazy_st_less_seqcst :
+ public cc::split_list::make_traits<
+ cc::split_list::ordered_list<cc::lazy_list_tag>
+ ,co::hash< hash >
+ ,cc::split_list::dynamic_bucket_table< false >
+ ,co::memory_model< co::v::sequential_consistent >
+ ,cc::split_list::ordered_list_traits<
+ typename cc::lazy_list::make_traits<
+ co::less< less >
+ ,co::memory_model< co::v::sequential_consistent >
+ >::type
+ >
+ >::type
+ {};
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_HP_st_less_seqcst;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_DHP_st_less_seqcst;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPI_st_less_seqcst;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPB_st_less_seqcst;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_GPT_st_less_seqcst;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_SHB_st_less_seqcst;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_less_seqcst > SplitList_Lazy_RCU_SHT_st_less_seqcst;
+#endif
+
+ struct traits_SplitList_Lazy_st_less_stat : public traits_SplitList_Lazy_st_less
+ {
+ typedef cc::split_list::stat<> stat;
+ };
+ typedef SplitListSet< cds::gc::HP, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_HP_st_less_stat;
+ typedef SplitListSet< cds::gc::DHP, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_DHP_st_less_stat;
+ typedef SplitListSet< rcu_gpi, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPI_st_less_stat;
+ typedef SplitListSet< rcu_gpb, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPB_st_less_stat;
+ typedef SplitListSet< rcu_gpt, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_GPT_st_less_stat;
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef SplitListSet< rcu_shb, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_SHB_st_less_stat;
+ typedef SplitListSet< rcu_sht, key_val, traits_SplitList_Lazy_st_less_stat > SplitList_Lazy_RCU_SHT_st_less_stat;
+#endif
+ };
+
+ template <typename GC, typename T, typename Traits>
+ static inline void print_stat( cds_test::property_stream& o, SplitListSet<GC, T, Traits> const& s )
+ {
+ o << s.statistics();
+ }
+
+} // namespace set
+
+#endif // #ifndef CDSUNIT_SET_TYPE_SPLIT_LIST_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_STD_H
+#define CDSUNIT_SET_TYPE_STD_H
+
+#include <unordered_set>
+#include <set>
+#include <mutex> //unique_lock
+
+#include "set2/set_type.h"
+
+namespace set2 {
+
+ struct tag_StdSet;
+
+ template <typename Value, typename Hash, typename Less, typename EqualTo, typename Lock,
+ class Alloc = typename CDS_DEFAULT_ALLOCATOR::template rebind<Value>::other
+ >
+ class StdHashSet
+ : public std::unordered_set<
+ Value
+ , Hash
+ , EqualTo
+ , Alloc
+ >
+ {
+ public:
+ Lock m_lock;
+ typedef std::unique_lock<Lock> scoped_lock;
+ typedef std::unordered_set<
+ Value
+ , Hash
+ , EqualTo
+ , Alloc
+ > base_class;
+
+ public:
+ typedef typename base_class::value_type value_type;
+
+ template <class Config>
+ StdHashSet( Config const& )
+ {}
+
+ template <typename Key>
+ bool contains( const Key& key )
+ {
+ scoped_lock al( m_lock );
+ return base_class::find( value_type(key) ) != base_class::end();
+ }
+
+ template <typename Key>
+ bool insert( Key const& key )
+ {
+ scoped_lock al( m_lock );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
+ return pRet.second;
+ }
+
+ template <typename Key, typename Func>
+ bool insert( Key const& key, Func func )
+ {
+ scoped_lock al( m_lock );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
+ if ( pRet.second ) {
+ func( *pRet.first );
+ return true;
+ }
+ return false;
+ }
+
+ template <typename T, typename Func>
+ std::pair<bool, bool> ensure( const T& key, Func func )
+ {
+ scoped_lock al( m_lock );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
+ if ( pRet.second ) {
+ func( true, *pRet.first, key );
+ return std::make_pair( true, true );
+ }
+ else {
+ func( false, *pRet.first, key );
+ return std::make_pair( true, false );
+ }
+ }
+
+ template <typename Key>
+ bool erase( const Key& key )
+ {
+ scoped_lock al( m_lock );
+ return base_class::erase( value_type(key) ) != 0;
+ }
+
+ template <typename T, typename Func>
+ bool erase( const T& key, Func func )
+ {
+ scoped_lock al( m_lock );
+ typename base_class::iterator it = base_class::find( value_type(key) );
+ if ( it != base_class::end() ) {
+ func( *it );
+ return base_class::erase( it ) != base_class::end();
+ }
+ return false;
+ }
+
+ std::ostream& dump( std::ostream& stm ) { return stm; }
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = true;
+ };
+
+ template <typename Value, typename Less, typename Lock,
+ class Alloc = typename CDS_DEFAULT_ALLOCATOR::template rebind<Value>::other
+ >
+ class StdSet: public std::set<Value, Less, Alloc>
+ {
+ Lock m_lock;
+ typedef std::unique_lock<Lock> scoped_lock;
+ typedef std::set<Value, Less, Alloc> base_class;
+ public:
+ typedef typename base_class::key_type value_type;
+
+ template <class Config>
+ StdSet( Config const& )
+ {}
+
+ template <typename Key>
+ bool contains( const Key& key )
+ {
+ value_type v( key );
+ scoped_lock al( m_lock );
+ return base_class::find( v ) != base_class::end();
+ }
+
+ bool insert( value_type const& v )
+ {
+ scoped_lock al( m_lock );
+ return base_class::insert( v ).second;
+ }
+
+ template <typename Key, typename Func>
+ bool insert( Key const& key, Func func )
+ {
+ scoped_lock al( m_lock );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
+ if ( pRet.second ) {
+ func( *pRet.first );
+ return true;
+ }
+ return false;
+ }
+
+ template <typename T, typename Func>
+ std::pair<bool, bool> ensure( const T& key, Func func )
+ {
+ scoped_lock al( m_lock );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
+ if ( pRet.second ) {
+ func( true, *pRet.first, key );
+ return std::make_pair( true, true );
+ }
+ else {
+ func( false, *pRet.first, key );
+ return std::make_pair( true, false );
+ }
+ }
+
+ template <typename Key>
+ bool erase( const Key& key )
+ {
+ scoped_lock al( m_lock );
+ return base_class::erase( value_type(key) ) != 0;
+ }
+
+ template <typename T, typename Func>
+ bool erase( const T& key, Func func )
+ {
+ scoped_lock al( m_lock );
+ typename base_class::iterator it = base_class::find( value_type(key) );
+ if ( it != base_class::end() ) {
+ func( *it );
+
+ base_class::erase( it );
+ return true;
+ }
+ return false;
+ }
+
+ std::ostream& dump( std::ostream& stm ) { return stm; }
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ };
+
+ template <typename Key, typename Val>
+ struct set_type< tag_StdSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+ typedef typename base_class::equal_to equal_to;
+
+ typedef StdSet< key_val, less, cds::sync::spin > StdSet_Spin;
+ typedef StdSet< key_val, less, std::mutex > StdSet_Mutex;
+ typedef StdSet< key_val, less, lock::NoLock> StdSet_NoLock;
+
+ typedef StdHashSet< key_val, hash, less, equal_to, cds::sync::spin > StdHashSet_Spin;
+ typedef StdHashSet< key_val, hash, less, equal_to, std::mutex > StdHashSet_Mutex;
+ typedef StdHashSet< key_val, hash, less, equal_to, lock::NoLock > StdHashSet_NoLock;
+ };
+
+} // namespace set2
+
+#endif // #ifndef CDSUNIT_SET_TYPE_STD_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSUNIT_SET_TYPE_STRIPED_H
+#define CDSUNIT_SET_TYPE_STRIPED_H
+
+#include "set2/set_type.h"
+
+#include <cds/container/striped_set/std_list.h>
+#include <cds/container/striped_set/std_vector.h>
+#include <cds/container/striped_set/std_set.h>
+#include <cds/container/striped_set/std_hash_set.h>
+#include <cds/container/striped_set/boost_unordered_set.h>
+
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 104800
+# include <cds/container/striped_set/boost_slist.h>
+# include <cds/container/striped_set/boost_list.h>
+# include <cds/container/striped_set/boost_vector.h>
+# include <cds/container/striped_set/boost_stable_vector.h>
+# include <cds/container/striped_set/boost_set.h>
+# include <cds/container/striped_set/boost_flat_set.h>
+#endif
+#include <cds/container/striped_set.h>
+
+namespace set2 {
+
+ struct tag_StripedSet;
+
+ template <typename Key, typename Val>
+ struct set_type< tag_StripedSet, Key, Val >: public set_type_base< Key, Val >
+ {
+ typedef set_type_base< Key, Val > base_class;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::compare compare;
+ typedef typename base_class::less less;
+ typedef typename base_class::equal_to equal_to;
+ typedef typename base_class::hash hash;
+ typedef typename base_class::hash2 hash2;
+
+
+ // ***************************************************************************
+ // StripedSet
+
+ // for sequential containers
+ template <class BucketEntry, typename... Options>
+ class StripedHashSet_seq:
+ public cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::striping<> >
+ ,co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::striping<> >
+ ,co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ StripedHashSet_seq( Config const& cfg )
+ : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nLoadFactor )) )
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ template <class BucketEntry, typename... Options>
+ class StripedHashSet_seq_rational:
+ public cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::striping<> >
+ ,co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::striping<> >
+ ,co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ StripedHashSet_seq_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator
+ : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( 1, cfg.c_nLoadFactor )) )
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ // for non-sequential ordered containers
+ template <class BucketEntry, typename... Options>
+ class StripedHashSet_ord:
+ public cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::striping<> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::striping<> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ StripedHashSet_ord( Config const& cfg )
+ : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) )
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ template <class BucketEntry, typename... Options>
+ class StripedHashSet_ord_rational:
+ public cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::striping<> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::striping<> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ StripedHashSet_ord_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator
+ : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.c_nLoadFactor )))
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
+ };
+
+ typedef StripedHashSet_seq<
+ std::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_list;
+
+ typedef StripedHashSet_seq_rational<
+ std::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_rational_list;
+
+ typedef StripedHashSet_seq<
+ std::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_vector;
+
+ typedef StripedHashSet_seq_rational<
+ std::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_rational_vector;
+
+#if BOOST_VERSION >= 104800
+ typedef StripedHashSet_seq<
+ boost::container::slist< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_boost_slist;
+
+ typedef StripedHashSet_seq_rational<
+ boost::container::slist< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_rational_boost_slist;
+
+ typedef StripedHashSet_seq<
+ boost::container::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_boost_list;
+
+ typedef StripedHashSet_seq_rational<
+ boost::container::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_rational_boost_list;
+
+ typedef StripedHashSet_seq<
+ boost::container::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_boost_vector;
+
+ typedef StripedHashSet_seq_rational<
+ boost::container::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_rational_boost_vector;
+
+ typedef StripedHashSet_seq<
+ boost::container::stable_vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_boost_stable_vector;
+
+ typedef StripedHashSet_seq_rational<
+ boost::container::stable_vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > StripedSet_rational_boost_stable_vector;
+#endif
+
+ typedef StripedHashSet_ord<
+ std::set< key_val, less >
+ , co::hash< hash2 >
+ > StripedSet_set;
+
+ typedef StripedHashSet_ord_rational<
+ std::set< key_val, less >
+ , co::hash< hash2 >
+ > StripedSet_rational_set;
+
+ typedef StripedHashSet_ord<
+ std::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > StripedSet_hashset;
+
+ typedef StripedHashSet_ord_rational<
+ std::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > StripedSet_rational_hashset;
+
+#if BOOST_VERSION >= 104800
+ typedef StripedHashSet_ord<
+ boost::container::set< key_val, less >
+ , co::hash< hash2 >
+ > StripedSet_boost_set;
+
+ typedef StripedHashSet_ord_rational<
+ boost::container::set< key_val, less >
+ , co::hash< hash2 >
+ > StripedSet_rational_boost_set;
+
+ typedef StripedHashSet_ord<
+ boost::container::flat_set< key_val, less >
+ , co::hash< hash2 >
+ > StripedSet_boost_flat_set;
+
+ typedef StripedHashSet_ord_rational<
+ boost::container::flat_set< key_val, less >
+ , co::hash< hash2 >
+ > StripedSet_rational_boost_flat_set;
+#endif
+
+ typedef StripedHashSet_ord<
+ boost::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > StripedSet_boost_unordered_set;
+
+ typedef StripedHashSet_ord_rational<
+ boost::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > StripedSet_rational_boost_unordered_set;
+
+
+ // ***************************************************************************
+ // RefinableSet
+
+ // for sequential containers
+ template <class BucketEntry, typename... Options>
+ class RefinableHashSet_seq:
+ public cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::refinable<> >
+ ,co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::refinable<> >
+ ,co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ RefinableHashSet_seq( Config const& cfg )
+ : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nLoadFactor )) )
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ };
+
+ template <class BucketEntry, typename... Options>
+ class RefinableHashSet_seq_rational:
+ public cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::refinable<> >
+ ,co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::mutex_policy< cc::striped_set::refinable<> >
+ ,co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ RefinableHashSet_seq_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator
+ : base_class( cfg.c_nSetSize / cfg.c_nLoadFactor / 16, *(new(&m_placeHolder) resizing_policy_t( 1, cfg.c_nLoadFactor )))
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ };
+
+ // for non-sequential ordered containers
+ template <class BucketEntry, typename... Options>
+ class RefinableHashSet_ord:
+ public cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::refinable<> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::refinable<> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ RefinableHashSet_ord( Config const& cfg )
+ : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( cfg.c_nMaxLoadFactor * 1024 )) )
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ };
+
+ template <class BucketEntry, typename... Options>
+ class RefinableHashSet_ord_rational:
+ public cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::refinable<> >
+ , Options...
+ >
+ {
+ typedef cc::StripedSet< BucketEntry,
+ co::resizing_policy<cc::striped_set::rational_load_factor_resizing<0> >
+ ,co::mutex_policy< cc::striped_set::refinable<> >
+ , Options...
+ > base_class;
+ typedef typename base_class::resizing_policy resizing_policy_t;
+
+ resizing_policy_t m_placeHolder;
+ public:
+ template <class Config>
+ RefinableHashSet_ord_rational( Config const& cfg ) // LoadFactor = 1 / nDenominator
+ : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( 1024, cfg.c_nLoadFactor )))
+ {}
+
+ /*
+ template <typename Q, typename Less>
+ bool erase_with( Q const& v, Less pred )
+ {
+ return base_class::erase( v );
+ }
+ */
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
+ };
+
+ typedef RefinableHashSet_seq<
+ std::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_list;
+
+ typedef RefinableHashSet_seq_rational<
+ std::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_rational_list;
+
+ typedef RefinableHashSet_seq<
+ std::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_vector;
+
+ typedef RefinableHashSet_seq_rational<
+ std::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_rational_vector;
+
+#if BOOST_VERSION >= 104800
+ typedef RefinableHashSet_seq<
+ boost::container::slist< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_boost_slist;
+
+ typedef RefinableHashSet_seq_rational<
+ boost::container::slist< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_rational_boost_slist;
+
+ typedef RefinableHashSet_seq<
+ boost::container::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_boost_list;
+
+ typedef RefinableHashSet_seq_rational<
+ boost::container::list< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_rational_boost_list;
+
+ typedef RefinableHashSet_seq<
+ boost::container::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_boost_vector;
+
+ typedef RefinableHashSet_seq_rational<
+ boost::container::vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_rational_boost_vector;
+
+ typedef RefinableHashSet_seq<
+ boost::container::stable_vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_boost_stable_vector;
+
+ typedef RefinableHashSet_seq_rational<
+ boost::container::stable_vector< key_val >
+ , co::hash< hash2 >
+ , co::less< less >
+ > RefinableSet_rational_boost_stable_vector;
+#endif
+
+ typedef RefinableHashSet_ord<
+ std::set< key_val, less >
+ , co::hash< hash2 >
+ > RefinableSet_set;
+
+ typedef RefinableHashSet_ord_rational<
+ std::set< key_val, less >
+ , co::hash< hash2 >
+ > RefinableSet_rational_set;
+
+ typedef RefinableHashSet_ord<
+ std::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > RefinableSet_hashset;
+
+ typedef RefinableHashSet_ord_rational<
+ std::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > RefinableSet_rational_hashset;
+
+#if BOOST_VERSION >= 104800
+ typedef RefinableHashSet_ord<
+ boost::container::set< key_val, less >
+ , co::hash< hash2 >
+ > RefinableSet_boost_set;
+
+ typedef RefinableHashSet_ord_rational<
+ boost::container::set< key_val, less >
+ , co::hash< hash2 >
+ > RefinableSet_rational_boost_set;
+
+ typedef RefinableHashSet_ord<
+ boost::container::flat_set< key_val, less >
+ , co::hash< hash2 >
+ > RefinableSet_boost_flat_set;
+
+ typedef RefinableHashSet_ord_rational<
+ boost::container::flat_set< key_val, less >
+ , co::hash< hash2 >
+ > RefinableSet_rational_boost_flat_set;
+#endif
+
+ typedef RefinableHashSet_ord<
+ boost::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > RefinableSet_boost_unordered_set;
+
+ typedef RefinableHashSet_ord_rational<
+ boost::unordered_set< key_val, hash, equal_to >
+ , co::hash< hash2 >
+ > RefinableSet_rational_boost_unordered_set;
+ };
+
+} // namespace set2
+
+#endif // #ifndef CDSUNIT_SET_TYPE_STRIPED_H