8000 Lazy Skip List Set stress tests by Rextuz · Pull Request #2 · Rextuz/libcds · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Lazy Skip List Set stress tests #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: lazy_skip_list_integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cds/container/lazy_skip_list_set_dhp.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ namespace cds { namespace container {
}
}

int size() {
return 0;
}

void erase(std::string str) {

}

protected:
void destroy() {
node_type *p = m_Head; //->next(0).load(atomics::memory_order_relaxed).ptr();
Expand Down
1 change: 1 addition & 0 deletions test/stress/set/insdel_find/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(CDSSTRESS_SET_INSDELFIND_HP_SOURCES
set_insdelfind_michael_hp.cpp
set_insdelfind_skip_hp.cpp
set_insdelfind_split_hp.cpp
set_insdelfind_lazy_skip.cpp
)

set(CDSSTRESS_SET_INSDELFIND_RCU_SOURCES
Expand Down
38 changes: 38 additions & 0 deletions test/stress/set/insdel_find/set_insdelfind_lazy_skip.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
This file is a part of libcds - Concurrent Data Structures library

(C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017

Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "set_insdelfind.h"
#include "set_type_lazy_skip_list.h"

namespace set {

CDSSTRESS_SkipListSet_HP( Set_InsDelFind, run_test, size_t, size_t )

} // namespace set
1 change: 1 addition & 0 deletions test/stress/set/insdel_string/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(CDSSTRESS_SET_INSDEL_STRING_SOURCES
set_insdel_string_feldman_hashset.cpp
set_insdel_string_michael.cpp
set_insdel_string_skip.cpp
set_insdel_string_lazy_skip.cpp
set_insdel_string_split.cpp
set_insdel_string_std.cpp
set_insdel_string_striped.cpp
Expand Down
38 changes: 38 additions & 0 deletions test/stress/set/insdel_string/set_insdel_string_lazy_skip.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
This file is a part of libcds - Concurrent Data Structures library

(C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017

Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "set_insdel_string.h"
#include "set_type_lazy_skip_list.h"

namespace set {

CDSSTRESS_SkipListSet( Set_InsDel_string, run_test, std::string, size_t )

} // namespace set
96 changes: 96 additions & 0 deletions test/stress/set/set_type_lazy_skip_list.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
This file is a part of libcds - Concurrent Data Structures library

(C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017

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/lazy_skip_list_set_dhp.h>

#include <cds_test/stat_skiplist_out.h>
#include <cds/gc/dhp.h>

namespace set {

template <typename GC, typename T, typename Traits = cc::lazy_skip_list_set::traits >
class SkipListSet : public cc::LazySkipListSet<GC, T, Traits>
{
typedef cc::LazySkipListSet<GC, T, Traits> base_class;
public:
template <typename Config>
SkipListSet( Config const& /*cfg*/ )
{}

// for testing
static constexpr bool const c_bExtractSupported = false;
static constexpr bool const c_bLoadFactorDepended = false;
static 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_LazySkipListSet_turbo32: public cds::container::lazy_skip_list_set::traits
{};

typedef SkipListSet< cds::gc::DHP, key_val, traits_LazySkipListSet_turbo32 > LazySkipListSet_default_turbo32;
};

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

#define CDSSTRESS_SkipListSet_case( fixture, test_case, skiplist_set_type, key_type, value_type ) \
TEST_F( fixture, skiplist_set_type ) \
{ \
typedef set::set_type< tag_SkipListSet, key_type, value_type >::skiplist_set_type set_type; \
test_case<set_type>(); \
}

#define CDSSTRESS_SkipListSet_HP( fixture, test_case, key_type, value_type ) \
CDSSTRESS_SkipListSet_case( fixture, test_case, LazySkipListSet_default_turbo32, key_type, value_type ) \

#define CDSSTRESS_SkipListSet( fixture, test_case, key_type, value_type ) \
CDSSTRESS_SkipListSet_HP( fixture, test_case, key_type, value_type ) \

#endif // #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H
0