├── DBx1000 ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README ├── README.md ├── benchmarks │ ├── TEST_schema.txt │ ├── TPCC_full_schema.txt │ ├── TPCC_short_schema.txt │ ├── YCSB_schema.txt │ ├── test.h │ ├── test_txn.cpp │ ├── test_wl.cpp │ ├── tpcc.h │ ├── tpcc_const.h │ ├── tpcc_helper.cpp │ ├── tpcc_helper.h │ ├── tpcc_query.cpp │ ├── tpcc_query.h │ ├── tpcc_txn.cpp │ ├── tpcc_wl.cpp │ ├── ycsb.h │ ├── ycsb_query.cpp │ ├── ycsb_query.h │ ├── ycsb_txn.cpp │ └── ycsb_wl.cpp ├── concurrency_control │ ├── 2plsf.cpp │ ├── 2plsf.h │ ├── dl_detect.cpp │ ├── dl_detect.h │ ├── hekaton.cpp │ ├── occ.cpp │ ├── occ.h │ ├── plock.cpp │ ├── plock.h │ ├── row_2plsf.cpp │ ├── row_2plsf.h │ ├── row_hekaton.cpp │ ├── row_hekaton.h │ ├── row_lock.cpp │ ├── row_lock.h │ ├── row_mvcc.cpp │ ├── row_mvcc.h │ ├── row_occ.cpp │ ├── row_occ.h │ ├── row_silo.cpp │ ├── row_silo.h │ ├── row_tictoc.cpp │ ├── row_tictoc.h │ ├── row_ts.cpp │ ├── row_ts.h │ ├── row_vll.cpp │ ├── row_vll.h │ ├── silo.cpp │ ├── tictoc.cpp │ ├── vll.cpp │ └── vll.h ├── config-std.h ├── config.cpp ├── config.h ├── logo │ └── dbx1000.svg ├── run-dbx1000.py ├── storage │ ├── catalog.cpp │ ├── catalog.h │ ├── index_base.h │ ├── index_btree.cpp │ ├── index_btree.h │ ├── index_hash.cpp │ ├── index_hash.h │ ├── row.cpp │ ├── row.h │ ├── table.cpp │ └── table.h ├── system │ ├── global.cpp │ ├── global.h │ ├── helper.cpp │ ├── helper.h │ ├── main.cpp │ ├── manager.cpp │ ├── manager.h │ ├── mem_alloc.cpp │ ├── mem_alloc.h │ ├── parser.cpp │ ├── query.cpp │ ├── query.h │ ├── stats.cpp │ ├── stats.h │ ├── thread.cpp │ ├── thread.h │ ├── txn.cpp │ ├── txn.h │ ├── wl.cpp │ └── wl.h └── test.py ├── LICENSE ├── README.md ├── common ├── CmdLineConfig.hpp ├── LatencyHistogram.hpp ├── ThreadRegistry.cpp └── ThreadRegistry.hpp ├── graphs ├── BenchmarkMaps.hpp ├── BenchmarkPartDisjoint.hpp ├── BenchmarkSPS.hpp ├── BenchmarkSets.hpp ├── Makefile ├── README.md ├── bin │ └── .gitignore ├── data │ ├── .gitignore │ └── cervino │ │ ├── latency-2plsf.txt │ │ ├── latency-ofwf.txt │ │ ├── latency-oreceager.txt │ │ ├── latency-tiny.txt │ │ ├── latency-tl2orig.txt │ │ ├── latency.log │ │ ├── map-ravl-100k-2plsf.txt │ │ ├── map-ravl-100k-oreceager.txt │ │ ├── map-ravl-100k-tiny.txt │ │ ├── map-ravl-100k-tl2orig.txt │ │ ├── map-ravl-100u-100k-2plsf.txt │ │ ├── map-ravl-100u-100k-oreceager.txt │ │ ├── map-ravl-100u-100k-tiny.txt │ │ ├── map-ravl-100u-100k-tl2orig.txt │ │ ├── map-ravl-98u-100k-2plsf.txt │ │ ├── map-ravl-98u-100k-ofwf.txt │ │ ├── map-ravl-98u-100k-oreceager.txt │ │ ├── map-ravl-98u-100k-tiny.txt │ │ ├── map-ravl-98u-100k-tl2orig.txt │ │ ├── map-ravl-98u-100k-tlrweager.txt │ │ ├── map-skiplist-100k-2plsf.txt │ │ ├── map-skiplist-100k-oreceager.txt │ │ ├── map-skiplist-100k-tiny.txt │ │ ├── map-skiplist-100k-tl2orig.txt │ │ ├── map-skiplist-100u-100k-2plsf.txt │ │ ├── map-skiplist-100u-100k-oreceager.txt │ │ ├── map-skiplist-100u-100k-tiny.txt │ │ ├── map-skiplist-100u-100k-tl2orig.txt │ │ ├── map-skiplist-98u-100k-2plsf.txt │ │ ├── map-skiplist-98u-100k-ofwf.txt │ │ ├── map-skiplist-98u-100k-oreceager.txt │ │ ├── map-skiplist-98u-100k-tiny.txt │ │ ├── map-skiplist-98u-100k-tl2orig.txt │ │ ├── map-skiplist-98u-100k-tlrweager.txt │ │ ├── map-ziptree-100k-2plsf.txt │ │ ├── map-ziptree-100k-oreceager.txt │ │ ├── map-ziptree-100k-tiny.txt │ │ ├── map-ziptree-100k-tl2orig.txt │ │ ├── map-ziptree-100u-100k-2plsf.txt │ │ ├── map-ziptree-100u-100k-oreceager.txt │ │ ├── map-ziptree-100u-100k-tiny.txt │ │ ├── map-ziptree-100u-100k-tl2orig.txt │ │ ├── map-ziptree-98u-100k-2plsf.txt │ │ ├── map-ziptree-98u-100k-ofwf.txt │ │ ├── map-ziptree-98u-100k-oreceager.txt │ │ ├── map-ziptree-98u-100k-tiny.txt │ │ ├── map-ziptree-98u-100k-tl2orig.txt │ │ ├── map-ziptree-98u-100k-tlrweager.txt │ │ ├── part-disjoint-2plsf.txt │ │ ├── part-disjoint-ofwf.txt │ │ ├── part-disjoint-oreceager.txt │ │ ├── part-disjoint-tiny.txt │ │ ├── part-disjoint-tl2orig.txt │ │ ├── set-btree-1m-2plsf.txt │ │ ├── set-btree-1m-2plundo.txt │ │ ├── set-btree-1m-ofwf.txt │ │ ├── set-btree-1m-tiny.txt │ │ ├── set-hash-10k-2plsf.txt │ │ ├── set-hash-10k-2plundodist.txt │ │ ├── set-hash-10k-ofwf.txt │ │ ├── set-hash-10k-oreceager.txt │ │ ├── set-hash-10k-tiny.txt │ │ ├── set-hash-10k-tl2orig.txt │ │ ├── set-hash-10k-tlrweager.txt │ │ ├── set-ll-1k-2plsf.txt │ │ ├── set-ll-1k-2plundodist.txt │ │ ├── set-ll-1k-ofwf.txt │ │ ├── set-ll-1k-oreceager.txt │ │ ├── set-ll-1k-tiny.txt │ │ ├── set-ll-1k-tl2orig.txt │ │ ├── set-ll-1k-tlrweager.txt │ │ ├── set-ravl-1m-2plsf.txt │ │ ├── set-ravl-1m-2plundo.txt │ │ ├── set-ravl-1m-2plundodist.txt │ │ ├── set-ravl-1m-ofwf.txt │ │ ├── set-ravl-1m-oreceager.txt │ │ ├── set-ravl-1m-oreclazy.txt │ │ ├── set-ravl-1m-tiny.txt │ │ ├── set-ravl-1m-tl2.txt │ │ ├── set-ravl-1m-tl2orig.txt │ │ ├── set-ravl-1m-tlrweager.txt │ │ ├── set-skiplist-1m-2plsf.txt │ │ ├── set-skiplist-1m-2plundodist.txt │ │ ├── set-skiplist-1m-ofwf.txt │ │ ├── set-skiplist-1m-oreceager.txt │ │ ├── set-skiplist-1m-tiny.txt │ │ ├── set-skiplist-1m-tl2orig.txt │ │ ├── set-skiplist-1m-tlrweager.txt │ │ ├── set-tree-1m-2plsf.txt │ │ ├── set-tree-1m-2plundodist.txt │ │ ├── set-tree-1m-ofwf.txt │ │ ├── set-tree-1m-tiny.txt │ │ ├── set-tree-1m-tl2orig.txt │ │ ├── set-tree-1m-tlrweager.txt │ │ ├── set-ziptree-1m-2plsf.txt │ │ ├── set-ziptree-1m-2plundodist.txt │ │ ├── set-ziptree-1m-ofwf.txt │ │ ├── set-ziptree-1m-oreceager.txt │ │ ├── set-ziptree-1m-tiny.txt │ │ ├── set-ziptree-1m-tl2orig.txt │ │ ├── set-ziptree-1m-tlrweager.txt │ │ ├── sps-integer-2plsf.txt │ │ ├── sps-integer-2plundodist.txt │ │ ├── sps-integer-ofwf.txt │ │ ├── sps-integer-oreceager.txt │ │ ├── sps-integer-tiny.txt │ │ ├── sps-integer-tl2orig.txt │ │ ├── ycsb-high-2plsf.txt │ │ ├── ycsb-high-dl_detect.txt │ │ ├── ycsb-high-no_wait.txt │ │ ├── ycsb-high-tictoc.txt │ │ ├── ycsb-high-wait_die.txt │ │ ├── ycsb-low-2plsf.txt │ │ ├── ycsb-low-dl_detect.txt │ │ ├── ycsb-low-no_wait.txt │ │ ├── ycsb-low-tictoc.txt │ │ ├── ycsb-low-wait_die.txt │ │ ├── ycsb-med-2plsf.txt │ │ ├── ycsb-med-dl_detect.txt │ │ ├── ycsb-med-no_wait.txt │ │ ├── ycsb-med-tictoc.txt │ │ └── ycsb-med-wait_die.txt ├── map-ravl.cpp ├── map-skiplist.cpp ├── map-ziptree.cpp ├── part-disjoint.cpp ├── plots │ ├── .gitignore │ ├── caption.gp │ ├── caption.pdf │ ├── latency-cervino.gp │ ├── latency-cervino.pdf │ ├── maps-98u-100k.gp │ ├── maps-98u-100k.pdf │ ├── part-disjoint-cervino.gp │ ├── part-disjoint-cervino.pdf │ ├── plot-all.sh │ ├── plot.sh │ ├── set-btree-1m-cervino.gp │ ├── set-btree-1m-cervino.pdf │ ├── set-hash-10k-cervino.gp │ ├── set-hash-10k-cervino.pdf │ ├── set-ll-1k-cervino.gp │ ├── set-ll-1k-cervino.pdf │ ├── set-ravl-1m-2pl.gp │ ├── set-ravl-1m-2pl.pdf │ ├── set-ravl-1m-cervino.gp │ ├── set-ravl-1m-cervino.pdf │ ├── set-skiplist-1m-cervino.gp │ ├── set-skiplist-1m-cervino.pdf │ ├── set-tree-1m-cervino.gp │ ├── set-tree-1m-cervino.pdf │ ├── set-ziptree-1m-cervino.gp │ ├── set-ziptree-1m-cervino.pdf │ ├── sps-integer-cervino.gp │ ├── sps-integer-cervino.pdf │ ├── styles.inc │ ├── ycsb-cervino.gp │ └── ycsb-cervino.pdf ├── run-all.py ├── set-btree-1m.cpp ├── set-hash-10k.cpp ├── set-ll-1k.cpp ├── set-ravl-1m.cpp ├── set-skiplist-1m.cpp ├── set-tree-1m.cpp ├── set-ziptree-1m.cpp └── sps-integer.cpp ├── pdatastructures ├── BTree.hpp ├── PRWLockLinkedListSet.hpp ├── PRWLockRAVLSet.hpp ├── README.md ├── TMBTree.hpp ├── TMBTreeByRef.hpp ├── TMHashMap.hpp ├── TMHashMapByRef.hpp ├── TMHashMapFixedSize.hpp ├── TMHashMapFixedSizeByRef.hpp ├── TMHashRAVLSetByRef.hpp ├── TMLinkedListQueue.hpp ├── TMLinkedListQueueByRef.hpp ├── TMLinkedListSet.hpp ├── TMLinkedListSetByRef.hpp ├── TMLinkedListSetNDP.hpp ├── TMRAVLSet.hpp ├── TMRAVLSetByRef.hpp ├── TMRedBlackTree.hpp ├── TMRedBlackTreeByRef.hpp ├── TMSkipList.hpp ├── TMSkipListByRef.hpp ├── TMZipTreeSet.hpp ├── TMZipTreeSetByRef.hpp └── maps │ ├── TMRAVLMap.hpp │ ├── TMRAVLMapByRef.hpp │ ├── TMSkipListMap.hpp │ ├── TMSkipListMapByRef.hpp │ ├── TMZipTreeMap.hpp │ └── TMZipTreeMapByRef.hpp └── stms ├── 2PLSF.hpp ├── 2PLUndo.hpp ├── 2PLUndoDist.hpp ├── OneFileWF.hpp ├── TL2Orig.hpp ├── TinySTM.hpp ├── tinystm ├── ChangeLog ├── Doxyfile ├── GNU-LICENSE.txt ├── MIT-LICENSE.txt ├── Makefile ├── Makefile.clang ├── Makefile.common ├── Makefile.gcc ├── Makefile.icc ├── Makefile.suncc ├── README.md ├── abi │ ├── Makefile │ ├── Makefile.common │ ├── abi.c │ ├── arch_x86.S │ ├── dtmc │ │ ├── Makefile │ │ ├── arch.S │ │ ├── libitm.h │ │ ├── libtanger-stm.public-symbols │ │ ├── libtanger-stm.support │ │ ├── tanger-stm-internal.h │ │ ├── tanger.c │ │ ├── tanger.h │ │ └── tm_macros.h │ ├── gcc │ │ ├── Makefile │ │ ├── alloc_cpp.c │ │ ├── arch.S │ │ ├── clone.c │ │ ├── eh.c │ │ ├── libitm.h │ │ └── tm_macros.h │ ├── intel │ │ ├── Makefile │ │ ├── alloc.c │ │ ├── arch.S │ │ ├── libitm.h │ │ └── tm_macros.h │ ├── lib.map │ ├── libitm.h.tpl.cpp │ ├── libitm.h.tpl.footer │ ├── libitm.h.tpl.header │ ├── libitm.h.tpl.unifdef │ ├── oracle │ │ ├── Makefile │ │ ├── arch.S │ │ └── otm.c │ ├── pthread_wrapper.h │ ├── test │ │ └── Makefile │ └── tm_macros.h ├── include │ ├── mod_ab.h │ ├── mod_cb.h │ ├── mod_log.h │ ├── mod_mem.h │ ├── mod_order.h │ ├── mod_print.h │ ├── mod_stats.h │ ├── stm.h │ └── wrappers.h ├── lib │ └── .gitignore ├── src │ ├── .gitignore │ ├── atomic.h │ ├── atomic_ops │ │ ├── AUTHORS │ │ ├── COPYING │ │ ├── README │ │ ├── aligned_atomic_load_store.h │ │ ├── all_acquire_release_volatile.h │ │ ├── ao_t_is_int.h │ │ ├── atomic_ops.h │ │ ├── generalize-small.h │ │ ├── generalize.h │ │ ├── ia64.h │ │ ├── ordered_except_wr.h │ │ ├── powerpc.h │ │ ├── read_ordered.h │ │ ├── sparc.h │ │ ├── standard_ao_double_t.h │ │ ├── test_and_set_t_is_ao_t.h │ │ ├── test_and_set_t_is_char.h │ │ ├── x86.h │ │ └── x86_64.h │ ├── gc.c │ ├── gc.h │ ├── mod_ab.c │ ├── mod_cb_mem.c │ ├── mod_log.c │ ├── mod_order.c │ ├── mod_print.c │ ├── mod_stats.c │ ├── stm.c │ ├── stm_internal.h │ ├── stm_wbctl.h │ ├── stm_wbetl.h │ ├── stm_wt.h │ ├── tls.h │ ├── utils.h │ └── wrappers.c └── test │ ├── Makefile │ ├── bank │ ├── .gitignore │ ├── Makefile │ └── bank.c │ ├── intset │ ├── .gitignore │ ├── Makefile │ ├── README.rbtree │ ├── intset.c │ ├── rbtree.c │ ├── rbtree.h │ ├── tm.h │ └── types.h │ └── regression │ ├── .gitignore │ ├── Makefile │ ├── irrevocability.c │ ├── perf.c │ └── types.c ├── tl2-x86 ├── LEGALNOTICE ├── LICENSE ├── Makefile ├── README ├── RELEASENOTES ├── VERSIONS ├── common.h ├── libtl2.a ├── platform.h ├── platform_sparc.h ├── platform_x86.h ├── stm.h ├── tl2.c ├── tl2.h ├── tl2.o ├── tmalloc.c ├── tmalloc.h ├── tmalloc.o └── util.h └── zardoshti ├── api └── constants.h ├── common ├── alloc.h ├── bytelock_t.h ├── cm.h ├── deferred.h ├── epochs.h ├── minivector.h ├── orec_t.h ├── pad_word.h ├── platform.h ├── redolog_atomic.h ├── stackframe.h ├── timesource.h ├── undolog_atomic.h └── undolog_nonatomic.h ├── orec_eager_wrap.hpp ├── orec_lazy_wrap.hpp ├── stm_algs ├── orec_eager.h ├── orec_lazy.h ├── tl2.h └── tlrw_eager.h ├── tl2_wrap.hpp └── tlrw_eager_wrap.hpp /DBx1000/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(Dbx1000) 3 | 4 | SET (CMAKE_C_COMPILER "gcc") 5 | SET (CMAKE_CXX_COMPILER "g++") 6 | SET (CMAKE_CXX_FLAGS "-std=c++11 -Wno-deprecated-declarations" CACHE INTERNAL "compiler options" FORCE) 7 | SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE INTERNAL "compiler options" FORCE) 8 | SET (CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE INTERNAL "compiler options" FORCE) 9 | 10 | add_definitions(-DNOGRAPHITE=1) 11 | 12 | # include header files 13 | INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/benchmarks/ ${PROJECT_SOURCE_DIR}/concurrency_control/ ${PROJECT_SOURCE_DIR}/storage/ ${PROJECT_SOURCE_DIR}/system/) 14 | # lib files 15 | #LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/libs) 16 | file(GLOB_RECURSE SRC_FILES benchmarks/*.cpp concurrency_control/*.cpp storage/*.cpp system/*.cpp config.cpp) 17 | add_executable(rundb ${SRC_FILES}) 18 | target_link_libraries(rundb libpthread.so libjemalloc.so) 19 | -------------------------------------------------------------------------------- /DBx1000/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2014, Xiangyao Yu 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /DBx1000/Makefile: -------------------------------------------------------------------------------- 1 | CC=g++-10 2 | CFLAGS= -g -std=c++0x #-fsanitize=address #-fPIE 3 | 4 | .SUFFIXES: .o .cpp .h 5 | 6 | SRC_DIRS = ./ ./benchmarks/ ./concurrency_control/ ./storage/ ./system/ 7 | INCLUDE = -I. -I./benchmarks -I./concurrency_control -I./storage -I./system 8 | 9 | CFLAGS += $(INCLUDE) -D NOGRAPHITE=1 -O2 -Werror 10 | LDFLAGS = -Wall -L. -L./libs -pthread -g -lrt -std=c++0x -O2 #-ljemalloc 11 | LDFLAGS += $(CFLAGS) 12 | 13 | CPPS = $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)*.cpp)) 14 | OBJS = $(CPPS:.cpp=.o) 15 | DEPS = $(CPPS:.cpp=.d) 16 | 17 | all:rundb 18 | 19 | rundb : $(OBJS) 20 | $(CC) -o $@ $^ $(LDFLAGS) 21 | 22 | -include $(OBJS:%.o=%.d) 23 | 24 | %.d: %.cpp 25 | $(CC) -MM -MT $*.o -MF $@ $(CFLAGS) $< 26 | 27 | %.o: %.cpp 28 | $(CC) -c $(CFLAGS) -o $@ $< 29 | 30 | .PHONY: clean 31 | clean: 32 | rm -f rundb $(OBJS) $(DEPS) 33 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/TEST_schema.txt: -------------------------------------------------------------------------------- 1 | //size, type, name 2 | TABLE=MAIN_TABLE 3 | 4,int,F0 4 | 8,double,F1 5 | 8,uint64,F2 6 | 100,string,F3 7 | 8 | INDEX=MAIN_INDEX 9 | MAIN_TABLE,0 10 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/TPCC_short_schema.txt: -------------------------------------------------------------------------------- 1 | //size,type,name 2 | TABLE=WAREHOUSE 3 | 8,int64_t,W_ID 4 | 10,string,W_NAME 5 | 20,string,W_STREET_1 6 | 20,string,W_STREET_2 7 | 20,string,W_CITY 8 | 2,string,W_STATE 9 | 9,string,W_ZIP 10 | 8,double,W_TAX 11 | 8,double,W_YTD 12 | 13 | TABLE=DISTRICT 14 | 8,int64_t,D_ID 15 | 8,int64_t,D_W_ID 16 | 10,string,D_NAME 17 | 20,string,D_STREET_1 18 | 20,string,D_STREET_2 19 | 20,string,D_CITY 20 | 2,string,D_STATE 21 | 9,string,D_ZIP 22 | 8,double,D_TAX 23 | 8,double,D_YTD 24 | 8,int64_t,D_NEXT_O_ID 25 | 26 | TABLE=CUSTOMER 27 | 8,int64_t,C_ID 28 | 8,int64_t,C_D_ID 29 | 8,int64_t,C_W_ID 30 | 2,string,C_MIDDLE 31 | 16,string,C_LAST 32 | 2,string,C_STATE 33 | 2,string,C_CREDIT 34 | 8,int64_t,C_DISCOUNT 35 | 8,double,C_BALANCE 36 | 8,double,C_YTD_PAYMENT 37 | 8,uint64_t,C_PAYMENT_CNT 38 | 39 | TABLE=HISTORY 40 | 8,int64_t,H_C_ID 41 | 8,int64_t,H_C_D_ID 42 | 8,int64_t,H_C_W_ID 43 | 8,int64_t,H_D_ID 44 | 8,int64_t,H_W_ID 45 | 8,int64_t,H_DATE 46 | 8,double,H_AMOUNT 47 | 48 | TABLE=NEW-ORDER 49 | 8,int64_t,NO_O_ID 50 | 8,int64_t,NO_D_ID 51 | 8,int64_t,NO_W_ID 52 | 53 | TABLE=ORDER 54 | 8,int64_t,O_ID 55 | 8,int64_t,O_C_ID 56 | 8,int64_t,O_D_ID 57 | 8,int64_t,O_W_ID 58 | 8,int64_t,O_ENTRY_D 59 | 8,int64_t,O_CARRIER_ID 60 | 8,int64_t,O_OL_CNT 61 | 8,int64_t,O_ALL_LOCAL 62 | 63 | TABLE=ORDER-LINE 64 | 8,int64_t,OL_O_ID 65 | 8,int64_t,OL_D_ID 66 | 8,int64_t,OL_W_ID 67 | 8,int64_t,OL_NUMBER 68 | 8,int64_t,OL_I_ID 69 | 70 | TABLE=ITEM 71 | 8,int64_t,I_ID 72 | 8,int64_t,I_IM_ID 73 | 24,string,I_NAME 74 | 8,int64_t,I_PRICE 75 | 50,string,I_DATA 76 | 77 | TABLE=STOCK 78 | 8,int64_t,S_I_ID 79 | 8,int64_t,S_W_ID 80 | 8,int64_t,S_QUANTITY 81 | 8,int64_t,S_REMOTE_CNT 82 | 83 | INDEX=ITEM_IDX 84 | ITEM,10000 85 | 86 | INDEX=WAREHOUSE_IDX 87 | WAREHOUSE,1 88 | 89 | INDEX=DISTRICT_IDX 90 | DISTRICT,10 91 | 92 | INDEX=CUSTOMER_ID_IDX 93 | CUSTOMER,40000 94 | 95 | INDEX=CUSTOMER_LAST_IDX 96 | CUSTOMER,40000 97 | 98 | INDEX=STOCK_IDX 99 | STOCK,10000 100 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/YCSB_schema.txt: -------------------------------------------------------------------------------- 1 | //size, type, name 2 | TABLE=MAIN_TABLE 3 | 10,string,F0 4 | 10,string,F1 5 | 10,string,F2 6 | 10,string,F3 7 | 10,string,F4 8 | 10,string,F5 9 | 10,string,F6 10 | 10,string,F7 11 | 10,string,F8 12 | 10,string,F9 13 | 14 | INDEX=MAIN_INDEX 15 | MAIN_TABLE,0 16 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/test.h: -------------------------------------------------------------------------------- 1 | #ifndef _TEST_H_ 2 | #define _TEST_H_ 3 | 4 | #include "global.h" 5 | #include "txn.h" 6 | #include "wl.h" 7 | 8 | class TestWorkload : public workload 9 | { 10 | public: 11 | RC init(); 12 | RC init_table(); 13 | RC init_schema(const char * schema_file); 14 | RC get_txn_man(txn_man *& txn_manager, thread_t * h_thd); 15 | void summarize(); 16 | void tick() { time = get_sys_clock(); }; 17 | INDEX * the_index; 18 | table_t * the_table; 19 | private: 20 | uint64_t time; 21 | }; 22 | 23 | class TestTxnMan : public txn_man 24 | { 25 | public: 26 | void init(thread_t * h_thd, workload * h_wl, uint64_t part_id); 27 | RC run_txn(int type, int access_num); 28 | RC run_txn(base_query * m_query) { assert(false); }; 29 | private: 30 | RC testReadwrite(int access_num); 31 | RC testConflict(int access_num); 32 | 33 | TestWorkload * _wl; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/test_txn.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | #include "row.h" 3 | 4 | void TestTxnMan::init(thread_t * h_thd, workload * h_wl, uint64_t thd_id) { 5 | txn_man::init(h_thd, h_wl, thd_id); 6 | _wl = (TestWorkload *) h_wl; 7 | } 8 | 9 | RC TestTxnMan::run_txn(int type, int access_num) { 10 | switch(type) { 11 | case READ_WRITE : 12 | return testReadwrite(access_num); 13 | case CONFLICT: 14 | return testConflict(access_num); 15 | default: 16 | assert(false); 17 | } 18 | } 19 | 20 | RC TestTxnMan::testReadwrite(int access_num) { 21 | RC rc = RCOK; 22 | itemid_t * m_item; 23 | 24 | m_item = index_read(_wl->the_index, 0, 0); 25 | row_t * row = ((row_t *)m_item->location); 26 | row_t * row_local = get_row(row, WR); 27 | if (access_num == 0) { 28 | char str[] = "hello"; 29 | row_local->set_value(0, 1234); 30 | row_local->set_value(1, 1234.5); 31 | row_local->set_value(2, 8589934592UL); 32 | row_local->set_value(3, str); 33 | } else { 34 | int v1; 35 | double v2; 36 | uint64_t v3; 37 | char * v4; 38 | 39 | row_local->get_value(0, v1); 40 | row_local->get_value(1, v2); 41 | row_local->get_value(2, v3); 42 | v4 = row_local->get_value(3); 43 | 44 | assert(v1 == 1234); 45 | assert(v2 == 1234.5); 46 | assert(v3 == 8589934592UL); 47 | assert(strcmp(v4, "hello") == 0); 48 | } 49 | rc = finish(rc); 50 | if (access_num == 0) 51 | return RCOK; 52 | else 53 | return FINISH; 54 | } 55 | 56 | RC 57 | TestTxnMan::testConflict(int access_num) 58 | { 59 | RC rc = RCOK; 60 | itemid_t * m_item; 61 | 62 | idx_key_t key; 63 | for (key = 0; key < 1; key ++) { 64 | m_item = index_read(_wl->the_index, key, 0); 65 | row_t * row = ((row_t *)m_item->location); 66 | row_t * row_local; 67 | row_local = get_row(row, WR); 68 | if (row_local) { 69 | char str[] = "hello"; 70 | row_local->set_value(0, 1234); 71 | row_local->set_value(1, 1234.5); 72 | row_local->set_value(2, 8589934592UL); 73 | row_local->set_value(3, str); 74 | sleep(1); 75 | } else { 76 | rc = Abort; 77 | break; 78 | } 79 | } 80 | rc = finish(rc); 81 | return rc; 82 | } 83 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/test_wl.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | #include "table.h" 3 | #include "row.h" 4 | #include "mem_alloc.h" 5 | #include "index_hash.h" 6 | #include "index_btree.h" 7 | #include "thread.h" 8 | 9 | RC TestWorkload::init() { 10 | workload::init(); 11 | string path; 12 | path = "./benchmarks/TEST_schema.txt"; 13 | init_schema( path.c_str() ); 14 | 15 | init_table(); 16 | return RCOK; 17 | } 18 | 19 | RC TestWorkload::init_schema(const char * schema_file) { 20 | workload::init_schema(schema_file); 21 | the_table = tables["MAIN_TABLE"]; 22 | the_index = indexes["MAIN_INDEX"]; 23 | return RCOK; 24 | } 25 | 26 | RC TestWorkload::init_table() { 27 | RC rc = RCOK; 28 | for (int rid = 0; rid < 10; rid ++) { 29 | row_t * new_row = NULL; 30 | uint64_t row_id; 31 | int part_id = 0; 32 | rc = the_table->get_new_row(new_row, part_id, row_id); 33 | assert(rc == RCOK); 34 | uint64_t primary_key = rid; 35 | new_row->set_primary_key(primary_key); 36 | new_row->set_value(0, rid); 37 | new_row->set_value(1, 0); 38 | new_row->set_value(2, 0); 39 | itemid_t * m_item = (itemid_t *) mem_allocator.alloc( sizeof(itemid_t), part_id ); 40 | assert(m_item != NULL); 41 | m_item->type = DT_row; 42 | m_item->location = new_row; 43 | m_item->valid = true; 44 | uint64_t idx_key = primary_key; 45 | rc = the_index->index_insert(idx_key, m_item, 0); 46 | assert(rc == RCOK); 47 | } 48 | return rc; 49 | } 50 | 51 | RC TestWorkload::get_txn_man(txn_man *& txn_manager, thread_t * h_thd) { 52 | txn_manager = (TestTxnMan *) 53 | mem_allocator.alloc( sizeof(TestTxnMan), h_thd->get_thd_id() ); 54 | new(txn_manager) TestTxnMan(); 55 | txn_manager->init(h_thd, this, h_thd->get_thd_id()); 56 | return RCOK; 57 | } 58 | 59 | void TestWorkload::summarize() { 60 | uint64_t curr_time = get_sys_clock(); 61 | if (g_test_case == CONFLICT) { 62 | assert(curr_time - time > g_thread_cnt * 1e9); 63 | int total_wait_cnt = 0; 64 | for (UInt32 tid = 0; tid < g_thread_cnt; tid ++) { 65 | total_wait_cnt += stats._stats[tid]->wait_cnt; 66 | } 67 | printf("CONFLICT TEST. PASSED.\n"); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/tpcc.h: -------------------------------------------------------------------------------- 1 | #ifndef _TPCC_H_ 2 | #define _TPCC_H_ 3 | 4 | #include "wl.h" 5 | #include "txn.h" 6 | 7 | class table_t; 8 | class INDEX; 9 | class tpcc_query; 10 | 11 | class tpcc_wl : public workload { 12 | public: 13 | RC init(); 14 | RC init_table(); 15 | RC init_schema(const char * schema_file); 16 | RC get_txn_man(txn_man *& txn_manager, thread_t * h_thd); 17 | table_t * t_warehouse; 18 | table_t * t_district; 19 | table_t * t_customer; 20 | table_t * t_history; 21 | table_t * t_neworder; 22 | table_t * t_order; 23 | table_t * t_orderline; 24 | table_t * t_item; 25 | table_t * t_stock; 26 | 27 | INDEX * i_item; 28 | INDEX * i_warehouse; 29 | INDEX * i_district; 30 | INDEX * i_customer_id; 31 | INDEX * i_customer_last; 32 | INDEX * i_stock; 33 | INDEX * i_order; // key = (w_id, d_id, o_id) 34 | INDEX * i_orderline; // key = (w_id, d_id, o_id) 35 | INDEX * i_orderline_wd; // key = (w_id, d_id). 36 | 37 | bool ** delivering; 38 | uint32_t next_tid {0}; 39 | private: 40 | uint64_t num_wh; 41 | void init_tab_item(); 42 | void init_tab_wh(uint32_t wid); 43 | void init_tab_dist(uint64_t w_id); 44 | void init_tab_stock(uint64_t w_id); 45 | void init_tab_cust(uint64_t d_id, uint64_t w_id); 46 | void init_tab_hist(uint64_t c_id, uint64_t d_id, uint64_t w_id); 47 | void init_tab_order(uint64_t d_id, uint64_t w_id); 48 | 49 | void init_permutation(uint64_t * perm_c_id, uint64_t wid); 50 | 51 | static void * threadInitItem(void * This); 52 | static void * threadInitWh(void * This); 53 | static void * threadInitDist(void * This); 54 | static void * threadInitStock(void * This); 55 | static void * threadInitCust(void * This); 56 | static void * threadInitHist(void * This); 57 | static void * threadInitOrder(void * This); 58 | 59 | static void * threadInitWarehouse(void * This); 60 | }; 61 | 62 | class tpcc_txn_man : public txn_man 63 | { 64 | public: 65 | void init(thread_t * h_thd, workload * h_wl, uint64_t part_id); 66 | RC run_txn(base_query * query); 67 | private: 68 | tpcc_wl * _wl; 69 | RC run_payment(tpcc_query * m_query); 70 | RC run_new_order(tpcc_query * m_query); 71 | RC run_order_status(tpcc_query * query); 72 | RC run_delivery(tpcc_query * query); 73 | RC run_stock_level(tpcc_query * query); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/tpcc_helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "global.h" 3 | #include "helper.h" 4 | 5 | uint64_t distKey(uint64_t d_id, uint64_t d_w_id); 6 | uint64_t custKey(uint64_t c_id, uint64_t c_d_id, uint64_t c_w_id); 7 | uint64_t orderlineKey(uint64_t w_id, uint64_t d_id, uint64_t o_id); 8 | uint64_t orderPrimaryKey(uint64_t w_id, uint64_t d_id, uint64_t o_id); 9 | // non-primary key 10 | uint64_t custNPKey(char * c_last, uint64_t c_d_id, uint64_t c_w_id); 11 | uint64_t stockKey(uint64_t s_i_id, uint64_t s_w_id); 12 | 13 | uint64_t Lastname(uint64_t num, char* name); 14 | 15 | extern drand48_data ** tpcc_buffer; 16 | // return random data from [0, max-1] 17 | uint64_t RAND(uint64_t max, uint64_t thd_id); 18 | // random number from [x, y] 19 | uint64_t URand(uint64_t x, uint64_t y, uint64_t thd_id); 20 | // non-uniform random number 21 | uint64_t NURand(uint64_t A, uint64_t x, uint64_t y, uint64_t thd_id); 22 | // random string with random length beteen min and max. 23 | uint64_t MakeAlphaString(int min, int max, char * str, uint64_t thd_id); 24 | uint64_t MakeNumberString(int min, int max, char* str, uint64_t thd_id); 25 | 26 | uint64_t wh_to_part(uint64_t wid); 27 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/tpcc_query.h: -------------------------------------------------------------------------------- 1 | #ifndef _TPCC_QUERY_H_ 2 | #define _TPCC_QUERY_H_ 3 | 4 | #include "global.h" 5 | #include "helper.h" 6 | #include "query.h" 7 | 8 | class workload; 9 | 10 | // items of new order transaction 11 | struct Item_no { 12 | uint64_t ol_i_id; 13 | uint64_t ol_supply_w_id; 14 | uint64_t ol_quantity; 15 | }; 16 | 17 | class tpcc_query : public base_query { 18 | public: 19 | void init(uint64_t thd_id, workload * h_wl); 20 | TPCCTxnType type; 21 | /**********************************************/ 22 | // common txn input for both payment & new-order 23 | /**********************************************/ 24 | uint64_t w_id; 25 | uint64_t d_id; 26 | uint64_t c_id; 27 | /**********************************************/ 28 | // txn input for payment 29 | /**********************************************/ 30 | uint64_t d_w_id; 31 | uint64_t c_w_id; 32 | uint64_t c_d_id; 33 | char c_last[LASTNAME_LEN]; 34 | double h_amount; 35 | bool by_last_name; 36 | /**********************************************/ 37 | // txn input for new-order 38 | /**********************************************/ 39 | Item_no * items; 40 | bool rbk; 41 | bool remote; 42 | uint64_t ol_cnt; 43 | uint64_t o_entry_d; 44 | // Input for delivery 45 | uint64_t o_carrier_id; 46 | uint64_t ol_delivery_d; 47 | // for order-status 48 | 49 | 50 | private: 51 | // warehouse id to partition id mapping 52 | // uint64_t wh_to_part(uint64_t wid); 53 | void gen_payment(uint64_t thd_id); 54 | void gen_new_order(uint64_t thd_id); 55 | void gen_order_status(uint64_t thd_id); 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/ycsb.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYNTH_BM_H_ 2 | #define _SYNTH_BM_H_ 3 | 4 | #include "wl.h" 5 | #include "txn.h" 6 | #include "global.h" 7 | #include "helper.h" 8 | 9 | class ycsb_query; 10 | 11 | class ycsb_wl : public workload { 12 | public : 13 | RC init(); 14 | RC init_table(); 15 | RC init_schema(string schema_file); 16 | RC get_txn_man(txn_man *& txn_manager, thread_t * h_thd); 17 | int key_to_part(uint64_t key); 18 | INDEX * the_index; 19 | table_t * the_table; 20 | private: 21 | void init_table_parallel(); 22 | void * init_table_slice(); 23 | static void * threadInitTable(void * This) { 24 | ((ycsb_wl *)This)->init_table_slice(); 25 | return NULL; 26 | } 27 | pthread_mutex_t insert_lock; 28 | // For parallel initialization 29 | static int next_tid; 30 | }; 31 | 32 | class ycsb_txn_man : public txn_man 33 | { 34 | public: 35 | void init(thread_t * h_thd, workload * h_wl, uint64_t part_id); 36 | RC run_txn(base_query * query); 37 | private: 38 | uint64_t row_cnt; 39 | ycsb_wl * _wl; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/ycsb_query.h: -------------------------------------------------------------------------------- 1 | #ifndef _YCSB_QUERY_H_ 2 | #define _YCSB_QUERY_H_ 3 | 4 | #include "global.h" 5 | #include "helper.h" 6 | #include "query.h" 7 | 8 | class workload; 9 | class Query_thd; 10 | // Each ycsb_query contains several ycsb_requests, 11 | // each of which is a RD, WR to a single table 12 | 13 | class ycsb_request { 14 | public: 15 | access_t rtype; 16 | uint64_t key; 17 | char value; 18 | // only for (qtype == SCAN) 19 | UInt32 scan_len; 20 | }; 21 | 22 | class ycsb_query : public base_query { 23 | public: 24 | void init(uint64_t thd_id, workload * h_wl) { assert(false); }; 25 | void init(uint64_t thd_id, workload * h_wl, Query_thd * query_thd); 26 | static void calculateDenom(); 27 | 28 | uint64_t request_cnt; 29 | ycsb_request * requests; 30 | 31 | private: 32 | void gen_requests(uint64_t thd_id, workload * h_wl); 33 | // for Zipfian distribution 34 | static double zeta(uint64_t n, double theta); 35 | uint64_t zipf(uint64_t n, double theta); 36 | 37 | static uint64_t the_n; 38 | static double denom; 39 | double zeta_2_theta; 40 | Query_thd * _query_thd; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /DBx1000/benchmarks/ycsb_txn.cpp: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | #include "helper.h" 3 | #include "ycsb.h" 4 | #include "ycsb_query.h" 5 | #include "wl.h" 6 | #include "thread.h" 7 | #include "table.h" 8 | #include "row.h" 9 | #include "index_hash.h" 10 | #include "index_btree.h" 11 | #include "catalog.h" 12 | #include "manager.h" 13 | #include "row_lock.h" 14 | #include "row_ts.h" 15 | #include "row_mvcc.h" 16 | #include "mem_alloc.h" 17 | #include "query.h" 18 | 19 | void ycsb_txn_man::init(thread_t * h_thd, workload * h_wl, uint64_t thd_id) { 20 | txn_man::init(h_thd, h_wl, thd_id); 21 | _wl = (ycsb_wl *) h_wl; 22 | } 23 | 24 | RC ycsb_txn_man::run_txn(base_query * query) { 25 | RC rc; 26 | ycsb_query * m_query = (ycsb_query *) query; 27 | ycsb_wl * wl = (ycsb_wl *) h_wl; 28 | itemid_t * m_item = NULL; 29 | row_cnt = 0; 30 | 31 | for (uint32_t rid = 0; rid < m_query->request_cnt; rid ++) { 32 | ycsb_request * req = &m_query->requests[rid]; 33 | int part_id = wl->key_to_part( req->key ); 34 | bool finish_req = false; 35 | UInt32 iteration = 0; 36 | while ( !finish_req ) { 37 | if (iteration == 0) { 38 | m_item = index_read(_wl->the_index, req->key, part_id); 39 | } 40 | #if INDEX_STRUCT == IDX_BTREE 41 | else { 42 | _wl->the_index->index_next(get_thd_id(), m_item); 43 | if (m_item == NULL) 44 | break; 45 | } 46 | #endif 47 | row_t * row = ((row_t *)m_item->location); 48 | row_t * row_local; 49 | access_t type = req->rtype; 50 | 51 | row_local = get_row(row, type); 52 | if (row_local == NULL) { 53 | rc = Abort; 54 | goto final; 55 | } 56 | 57 | // Computation // 58 | // Only do computation when there are more than 1 requests. 59 | if (m_query->request_cnt > 1) { 60 | if (req->rtype == RD || req->rtype == SCAN) { 61 | // for (int fid = 0; fid < schema->get_field_cnt(); fid++) { 62 | int fid = 0; 63 | char * data = row_local->get_data(); 64 | __attribute__((unused)) uint64_t fval = *(uint64_t *)(&data[fid * 10]); 65 | // } 66 | } else { 67 | assert(req->rtype == WR); 68 | // for (int fid = 0; fid < schema->get_field_cnt(); fid++) { 69 | int fid = 0; 70 | char * data = row->get_data(); 71 | *(uint64_t *)(&data[fid * 10]) = 0; 72 | // } 73 | } 74 | } 75 | 76 | 77 | iteration ++; 78 | if (req->rtype == RD || req->rtype == WR || iteration == req->scan_len) 79 | finish_req = true; 80 | } 81 | } 82 | rc = RCOK; 83 | final: 84 | rc = finish(rc); 85 | return rc; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/2plsf.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../../stms/2PLSF.hpp" 3 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/2plsf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define INCLUDED_FROM_MULTIPLE_CPP 4 | #include "../../stms/2PLSF.hpp" 5 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/dl_detect.h: -------------------------------------------------------------------------------- 1 | #ifndef _DL_DETECT_ 2 | #define _DL_DETECT_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "pthread.h" 8 | #include "config.h" 9 | //#include "global.h" 10 | //#include "helper.h" 11 | 12 | // The denpendency information per thread 13 | struct DepThd { 14 | std::list adj; // Pointer to an array containing adjacency lists 15 | pthread_mutex_t lock; 16 | volatile int64_t txnid; // -1 means invalid 17 | int num_locks; // the # of locks that txn is currently holding 18 | char pad[2 * CL_SIZE - sizeof(int64_t) - sizeof(pthread_mutex_t) - sizeof(std::list) - sizeof(int)]; 19 | }; 20 | 21 | // shared data for a particular deadlock detection 22 | struct DetectData { 23 | bool * visited; 24 | bool * recStack; 25 | bool loop; 26 | bool onloop; // the current node is on the loop 27 | int loopstart; // the starting point of the loop 28 | int min_lock_num; // the min lock num for txn in the loop 29 | uint64_t min_txnid; // the txnid that holds the min lock num 30 | }; 31 | 32 | class DL_detect { 33 | public: 34 | void init(); 35 | // return values: 36 | // 0: no deadlocks 37 | // 1: deadlock exists 38 | int detect_cycle(uint64_t txnid); 39 | // txn1 (txn_id) dependes on txns (containing cnt txns) 40 | // return values: 41 | // 0: succeed. 42 | // 16: cannot get lock 43 | int add_dep(uint64_t txnid, uint64_t * txnids, int cnt, int num_locks); 44 | // remove all outbound dependencies for txnid. 45 | // will wait for the lock until acquired. 46 | void clear_dep(uint64_t txnid); 47 | private: 48 | int V; // No. of vertices 49 | DepThd * dependency; 50 | 51 | /////////////////////////////////////////// 52 | // For deadlock detection 53 | /////////////////////////////////////////// 54 | // dl_lock is the global lock. Only used when deadlock detection happens 55 | pthread_mutex_t _lock; 56 | // return value: whether a loop is detected. 57 | bool nextNode(uint64_t txnid, DetectData * detect_data); 58 | bool isCyclic(uint64_t txnid, DetectData * detect_data); // return if "thd" is causing a cycle 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/hekaton.cpp: -------------------------------------------------------------------------------- 1 | #include "txn.h" 2 | #include "row.h" 3 | #include "row_hekaton.h" 4 | #include "manager.h" 5 | 6 | #if CC_ALG==HEKATON 7 | 8 | RC 9 | txn_man::validate_hekaton(RC rc) 10 | { 11 | uint64_t starttime = get_sys_clock(); 12 | INC_STATS(get_thd_id(), debug1, get_sys_clock() - starttime); 13 | ts_t commit_ts = glob_manager->get_ts(get_thd_id()); 14 | // validate the read set. 15 | #if ISOLATION_LEVEL == SERIALIZABLE 16 | if (rc == RCOK) { 17 | for (int rid = 0; rid < row_cnt; rid ++) { 18 | if (accesses[rid]->type == WR) 19 | continue; 20 | rc = accesses[rid]->orig_row->manager->prepare_read(this, accesses[rid]->data, commit_ts); 21 | if (rc == Abort) 22 | break; 23 | } 24 | } 25 | #endif 26 | // postprocess 27 | for (int rid = 0; rid < row_cnt; rid ++) { 28 | if (accesses[rid]->type == RD) 29 | continue; 30 | accesses[rid]->orig_row->manager->post_process(this, commit_ts, rc); 31 | } 32 | return rc; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/occ.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "row.h" 4 | 5 | // TODO For simplicity, the txn hisotry for OCC is oganized as follows: 6 | // 1. history is never deleted. 7 | // 2. hisotry forms a single directional list. 8 | // history head -> hist_1 -> hist_2 -> hist_3 -> ... -> hist_n 9 | // The head is always the latest and the tail the youngest. 10 | // When history is traversed, always go from head -> tail order. 11 | 12 | class txn_man; 13 | 14 | class set_ent{ 15 | public: 16 | set_ent(); 17 | UInt64 tn; 18 | txn_man * txn; 19 | UInt32 set_size; 20 | row_t ** rows; 21 | set_ent * next; 22 | }; 23 | 24 | class OptCC { 25 | public: 26 | void init(); 27 | RC validate(txn_man * txn); 28 | volatile bool lock_all; 29 | uint64_t lock_txn_id; 30 | private: 31 | 32 | // per row validation similar to Hekaton. 33 | RC per_row_validate(txn_man * txn); 34 | 35 | // parallel validation in the original OCC paper. 36 | RC central_validate(txn_man * txn); 37 | bool test_valid(set_ent * set1, set_ent * set2); 38 | RC get_rw_set(txn_man * txni, set_ent * &rset, set_ent *& wset); 39 | 40 | // "history" stores write set of transactions with tn >= smallest running tn 41 | set_ent * history; 42 | set_ent * active; 43 | uint64_t his_len; 44 | uint64_t active_len; 45 | volatile uint64_t tnc; // transaction number counter 46 | pthread_mutex_t latch; 47 | }; 48 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/plock.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOCK_H_ 2 | #define _PLOCK_H_ 3 | 4 | #include "global.h" 5 | #include "helper.h" 6 | 7 | class txn_man; 8 | 9 | // Parition manager for HSTORE 10 | class PartMan { 11 | public: 12 | void init(); 13 | RC lock(txn_man * txn); 14 | void unlock(txn_man * txn); 15 | private: 16 | pthread_mutex_t latch; 17 | txn_man * owner; 18 | txn_man ** waiters; 19 | UInt32 waiter_cnt; 20 | }; 21 | 22 | // Partition Level Locking 23 | class Plock { 24 | public: 25 | void init(); 26 | // lock all partitions in parts 27 | RC lock(txn_man * txn, uint64_t * parts, uint64_t part_cnt); 28 | void unlock(txn_man * txn, uint64_t * parts, uint64_t part_cnt); 29 | private: 30 | PartMan ** part_mans; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_2plsf.cpp: -------------------------------------------------------------------------------- 1 | #include "row.h" 2 | #include "txn.h" 3 | #include "row_2plsf.h" 4 | #include "mem_alloc.h" 5 | #include "manager.h" 6 | #include "2plsf.h" 7 | 8 | /* rc can be RCOK, Abort, Wait */ 9 | 10 | void Row_2plsf::init(row_t * row) { 11 | _row = row; 12 | } 13 | 14 | // 'type' can be LOCK_SH or LOCK_EX 15 | RC Row_2plsf::lock_get(lock_t type, txn_man * txn) { 16 | assert(this != nullptr); 17 | assert(_row != nullptr); 18 | if (type == LOCK_SH) { 19 | //if (twoplundodistsf::tryReadLock(_row, sizeof(Row_2plsf))) return RCOK; 20 | if (twoplsf::tryReadLock(_row, sizeof(uint64_t))) return RCOK; // TODO: temporary, should be ok 21 | } else { 22 | // type == LOCK_EX 23 | //if (twoplundodistsf::tryWriteLock(_row, sizeof(Row_2plsf))) return RCOK; 24 | if (twoplsf::tryWriteLock(_row, sizeof(uint64_t))) return RCOK; // TODO: temporary, should be ok 25 | } 26 | return Abort; 27 | } 28 | 29 | 30 | RC Row_2plsf::lock_release(txn_man * txn) { 31 | return RCOK; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_2plsf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "2plsf.h" 3 | 4 | class Row_2plsf { 5 | public: 6 | void init(row_t * row); 7 | RC lock_get(lock_t type, txn_man * txn); 8 | RC lock_release(txn_man * txn); 9 | 10 | private: 11 | row_t * _row; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_hekaton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "row_mvcc.h" 3 | 4 | class table_t; 5 | class Catalog; 6 | class txn_man; 7 | 8 | // Only a constant number of versions can be maintained. 9 | // If a request accesses an old version that has been recycled, 10 | // simply abort the request. 11 | 12 | #if CC_ALG == HEKATON 13 | 14 | struct WriteHisEntry { 15 | bool begin_txn; 16 | bool end_txn; 17 | ts_t begin; 18 | ts_t end; 19 | row_t * row; 20 | }; 21 | 22 | #define INF UINT64_MAX 23 | 24 | class Row_hekaton { 25 | public: 26 | void init(row_t * row); 27 | RC access(txn_man * txn, TsType type, row_t * row); 28 | RC prepare_read(txn_man * txn, row_t * row, ts_t commit_ts); 29 | void post_process(txn_man * txn, ts_t commit_ts, RC rc); 30 | 31 | private: 32 | volatile bool blatch; 33 | uint32_t reserveRow(txn_man * txn); 34 | void doubleHistory(); 35 | 36 | uint32_t _his_latest; 37 | uint32_t _his_oldest; 38 | WriteHisEntry * _write_history; // circular buffer 39 | bool _exists_prewrite; 40 | 41 | uint32_t _his_len; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_lock.h: -------------------------------------------------------------------------------- 1 | #ifndef ROW_LOCK_H 2 | #define ROW_LOCK_H 3 | 4 | struct LockEntry { 5 | lock_t type; 6 | txn_man * txn; 7 | LockEntry * next; 8 | LockEntry * prev; 9 | }; 10 | 11 | class Row_lock { 12 | public: 13 | void init(row_t * row); 14 | // [DL_DETECT] txnids are the txn_ids that current txn is waiting for. 15 | RC lock_get(lock_t type, txn_man * txn); 16 | RC lock_get(lock_t type, txn_man * txn, uint64_t* &txnids, int &txncnt); 17 | RC lock_release(txn_man * txn); 18 | 19 | private: 20 | pthread_mutex_t * latch; 21 | bool blatch; 22 | 23 | bool conflict_lock(lock_t l1, lock_t l2); 24 | LockEntry * get_entry(); 25 | void return_entry(LockEntry * entry); 26 | row_t * _row; 27 | lock_t lock_type; 28 | UInt32 owner_cnt; 29 | UInt32 waiter_cnt; 30 | 31 | // owners is a single linked list 32 | // waiters is a double linked list 33 | // [waiters] head is the oldest txn, tail is the youngest txn. 34 | // So new txns are inserted into the tail. 35 | LockEntry * owners; 36 | LockEntry * waiters_head; 37 | LockEntry * waiters_tail; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_mvcc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class table_t; 4 | class Catalog; 5 | class txn_man; 6 | 7 | // Only a constant number of versions can be maintained. 8 | // If a request accesses an old version that has been recycled, 9 | // simply abort the request. 10 | 11 | #if CC_ALG == MVCC 12 | struct WriteHisEntry { 13 | bool valid; // whether the entry contains a valid version 14 | bool reserved; // when valid == false, whether the entry is reserved by a P_REQ 15 | ts_t ts; 16 | row_t * row; 17 | }; 18 | 19 | struct ReqEntry { 20 | bool valid; 21 | TsType type; // P_REQ or R_REQ 22 | ts_t ts; 23 | txn_man * txn; 24 | ts_t time; 25 | }; 26 | 27 | 28 | class Row_mvcc { 29 | public: 30 | void init(row_t * row); 31 | RC access(txn_man * txn, TsType type, row_t * row); 32 | private: 33 | pthread_mutex_t * latch; 34 | volatile bool blatch; 35 | 36 | row_t * _row; 37 | 38 | RC conflict(TsType type, ts_t ts, uint64_t thd_id = 0); 39 | void update_buffer(txn_man * txn, TsType type); 40 | void buffer_req(TsType type, txn_man * txn, bool served); 41 | 42 | // Invariant: all valid entries in _requests have greater ts than any entry in _write_history 43 | row_t * _latest_row; 44 | ts_t _latest_wts; 45 | ts_t _oldest_wts; 46 | WriteHisEntry * _write_history; 47 | // the following is a small optimization. 48 | // the timestamp for the served prewrite request. There should be at most one 49 | // served prewrite request. 50 | bool _exists_prewrite; 51 | ts_t _prewrite_ts; 52 | uint32_t _prewrite_his_id; 53 | ts_t _max_served_rts; 54 | 55 | // _requests only contains pending requests. 56 | ReqEntry * _requests; 57 | uint32_t _his_len; 58 | uint32_t _req_len; 59 | // Invariant: _num_versions <= 4 60 | // Invariant: _num_prewrite_reservation <= 2 61 | uint32_t _num_versions; 62 | 63 | // list = 0: _write_history 64 | // list = 1: _requests 65 | void double_list(uint32_t list); 66 | row_t * reserveRow(ts_t ts, txn_man * txn); 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_occ.cpp: -------------------------------------------------------------------------------- 1 | #include "txn.h" 2 | #include "row.h" 3 | #include "row_occ.h" 4 | #include "mem_alloc.h" 5 | 6 | void 7 | Row_occ::init(row_t * row) { 8 | _row = row; 9 | int part_id = row->get_part_id(); 10 | _latch = (pthread_mutex_t *) 11 | mem_allocator.alloc(sizeof(pthread_mutex_t), part_id); 12 | pthread_mutex_init( _latch, NULL ); 13 | wts = 0; 14 | blatch = false; 15 | } 16 | 17 | RC 18 | Row_occ::access(txn_man * txn, TsType type) { 19 | RC rc = RCOK; 20 | pthread_mutex_lock( _latch ); 21 | if (type == R_REQ) { 22 | if (txn->start_ts < wts) 23 | rc = Abort; 24 | else { 25 | txn->cur_row->copy(_row); 26 | rc = RCOK; 27 | } 28 | } else 29 | assert(false); 30 | pthread_mutex_unlock( _latch ); 31 | return rc; 32 | } 33 | 34 | void 35 | Row_occ::latch() { 36 | pthread_mutex_lock( _latch ); 37 | } 38 | 39 | bool 40 | Row_occ::validate(uint64_t ts) { 41 | if (ts < wts) return false; 42 | else return true; 43 | } 44 | 45 | void 46 | Row_occ::write(row_t * data, uint64_t ts) { 47 | _row->copy(data); 48 | if (PER_ROW_VALID) { 49 | assert(ts > wts); 50 | wts = ts; 51 | } 52 | } 53 | 54 | void 55 | Row_occ::release() { 56 | pthread_mutex_unlock( _latch ); 57 | } 58 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_occ.h: -------------------------------------------------------------------------------- 1 | #ifndef ROW_OCC_H 2 | #define ROW_OCC_H 3 | 4 | class table_t; 5 | class Catalog; 6 | class txn_man; 7 | struct TsReqEntry; 8 | 9 | class Row_occ { 10 | public: 11 | void init(row_t * row); 12 | RC access(txn_man * txn, TsType type); 13 | void latch(); 14 | // ts is the start_ts of the validating txn 15 | bool validate(uint64_t ts); 16 | void write(row_t * data, uint64_t ts); 17 | void release(); 18 | private: 19 | pthread_mutex_t * _latch; 20 | bool blatch; 21 | 22 | row_t * _row; 23 | // the last update time 24 | ts_t wts; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_silo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class table_t; 4 | class Catalog; 5 | class txn_man; 6 | struct TsReqEntry; 7 | 8 | #if CC_ALG==SILO 9 | #define LOCK_BIT (1UL << 63) 10 | 11 | class Row_silo { 12 | public: 13 | void init(row_t * row); 14 | RC access(txn_man * txn, TsType type, row_t * local_row); 15 | 16 | bool validate(ts_t tid, bool in_write_set); 17 | void write(row_t * data, uint64_t tid); 18 | 19 | void lock(); 20 | void release(); 21 | bool try_lock(); 22 | uint64_t get_tid(); 23 | 24 | void assert_lock() {assert(_tid_word & LOCK_BIT); } 25 | private: 26 | #if ATOMIC_WORD 27 | volatile uint64_t _tid_word; 28 | #else 29 | pthread_mutex_t * _latch; 30 | ts_t _tid; 31 | #endif 32 | row_t * _row; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_tictoc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | 5 | #if CC_ALG == TICTOC 6 | 7 | #if WRITE_PERMISSION_LOCK 8 | 9 | #define LOCK_BIT (1UL << 63) 10 | #define WRITE_BIT (1UL << 62) 11 | #define RTS_LEN (15) 12 | #define WTS_LEN (62 - RTS_LEN) 13 | #define WTS_MASK ((1UL << WTS_LEN) - 1) 14 | #define RTS_MASK (((1UL << RTS_LEN) - 1) << WTS_LEN) 15 | 16 | #else 17 | 18 | #define LOCK_BIT (1UL << 63) 19 | #define WRITE_BIT (1UL << 63) 20 | #define RTS_LEN (15) 21 | #define WTS_LEN (63 - RTS_LEN) 22 | #define WTS_MASK ((1UL << WTS_LEN) - 1) 23 | #define RTS_MASK (((1UL << RTS_LEN) - 1) << WTS_LEN) 24 | 25 | #endif 26 | 27 | class txn_man; 28 | class row_t; 29 | 30 | class Row_tictoc { 31 | public: 32 | void init(row_t * row); 33 | RC access(txn_man * txn, TsType type, row_t * local_row); 34 | #if SPECULATE 35 | RC write_speculate(row_t * data, ts_t version, bool spec_read); 36 | #endif 37 | void write_data(row_t * data, ts_t wts); 38 | void write_ptr(row_t * data, ts_t wts, char *& data_to_free); 39 | bool renew_lease(ts_t wts, ts_t rts); 40 | bool try_renew(ts_t wts, ts_t rts, ts_t &new_rts, uint64_t thd_id); 41 | 42 | void lock(); 43 | bool try_lock(); 44 | void release(); 45 | 46 | ts_t get_wts(); 47 | ts_t get_rts(); 48 | void get_ts_word(bool &lock, uint64_t &rts, uint64_t &wts); 49 | private: 50 | row_t * _row; 51 | #if ATOMIC_WORD 52 | volatile uint64_t _ts_word; 53 | #else 54 | ts_t _wts; // last write timestamp 55 | ts_t _rts; // end lease timestamp 56 | pthread_mutex_t * _latch; 57 | #endif 58 | #if TICTOC_MV 59 | volatile ts_t _hist_wts; 60 | #endif 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_ts.h: -------------------------------------------------------------------------------- 1 | #ifndef ROW_TS_H 2 | #define ROW_TS_H 3 | 4 | class table_t; 5 | class Catalog; 6 | class txn_man; 7 | struct TsReqEntry { 8 | txn_man * txn; 9 | // for write requests, need to have a copy of the data to write. 10 | row_t * row; 11 | itemid_t * item; 12 | ts_t ts; 13 | TsReqEntry * next; 14 | }; 15 | 16 | class Row_ts { 17 | public: 18 | void init(row_t * row); 19 | RC access(txn_man * txn, TsType type, row_t * row); 20 | 21 | private: 22 | pthread_mutex_t * latch; 23 | bool blatch; 24 | 25 | void buffer_req(TsType type, txn_man * txn, row_t * row); 26 | TsReqEntry * debuffer_req(TsType type, txn_man * txn); 27 | TsReqEntry * debuffer_req(TsType type, ts_t ts); 28 | TsReqEntry * debuffer_req(TsType type, txn_man * txn, ts_t ts); 29 | void update_buffer(); 30 | ts_t cal_min(TsType type); 31 | TsReqEntry * get_req_entry(); 32 | void return_req_entry(TsReqEntry * entry); 33 | void return_req_list(TsReqEntry * list); 34 | 35 | row_t * _row; 36 | ts_t wts; 37 | ts_t rts; 38 | ts_t min_wts; 39 | ts_t min_rts; 40 | ts_t min_pts; 41 | 42 | TsReqEntry * readreq; 43 | TsReqEntry * writereq; 44 | TsReqEntry * prereq; 45 | uint64_t preq_len; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_vll.cpp: -------------------------------------------------------------------------------- 1 | #include "row.h" 2 | #include "row_vll.h" 3 | #include "global.h" 4 | #include "helper.h" 5 | 6 | void 7 | Row_vll::init(row_t * row) { 8 | _row = row; 9 | cs = 0; 10 | cx = 0; 11 | } 12 | 13 | bool 14 | Row_vll::insert_access(access_t type) { 15 | if (type == RD) { 16 | cs ++; 17 | return (cx > 0); 18 | } else { 19 | cx ++; 20 | return (cx > 1) || (cs > 0); 21 | } 22 | } 23 | 24 | void 25 | Row_vll::remove_access(access_t type) { 26 | if (type == RD) { 27 | assert (cs > 0); 28 | cs --; 29 | } else { 30 | assert (cx > 0); 31 | cx --; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/row_vll.h: -------------------------------------------------------------------------------- 1 | #ifndef ROW_VLL_H 2 | #define ROW_VLL_H 3 | 4 | class Row_vll { 5 | public: 6 | void init(row_t * row); 7 | // return true : the access is blocked. 8 | // return false : the access is NOT blocked 9 | bool insert_access(access_t type); 10 | void remove_access(access_t type); 11 | int get_cs() { return cs; }; 12 | private: 13 | row_t * _row; 14 | int cs; 15 | int cx; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /DBx1000/concurrency_control/vll.h: -------------------------------------------------------------------------------- 1 | #ifndef _VLL_H_ 2 | #define _VLL_H_ 3 | 4 | #include "global.h" 5 | #include "helper.h" 6 | #include "query.h" 7 | 8 | class txn_man; 9 | 10 | class TxnQEntry { 11 | public: 12 | TxnQEntry * prev; 13 | TxnQEntry * next; 14 | txn_man * txn; 15 | }; 16 | 17 | class VLLMan { 18 | public: 19 | void init(); 20 | void vllMainLoop(txn_man * next_txn, base_query * query); 21 | // 1: txn is blocked 22 | // 2: txn is not blocked. Can run. 23 | // 3: txn_queue is full. 24 | int beginTxn(txn_man * txn, base_query * query, TxnQEntry *& entry); 25 | void finishTxn(txn_man * txn, TxnQEntry * entry); 26 | void execute(txn_man * txn, base_query * query); 27 | private: 28 | TxnQEntry * _txn_queue; 29 | TxnQEntry * _txn_queue_tail; 30 | int _txn_queue_size; 31 | pthread_mutex_t _mutex; 32 | 33 | TxnQEntry * getQEntry(); 34 | void returnQEntry(TxnQEntry * entry); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /DBx1000/config.cpp: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | TPCCTxnType g_tpcc_txn_type = TPCC_ALL; 4 | TestCases g_test_case = CONFLICT; 5 | 6 | -------------------------------------------------------------------------------- /DBx1000/run-dbx1000.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import time 4 | 5 | #thread_list = [1,4,8,10,12,14,16] # List of threads to execute. This one is for Legion laptop 6 | thread_list = [1,4,8,16,32,48,56,64] # List of threads for cervino-2 7 | workload = "YCSB" 8 | 9 | print "\n\n+++ Running DBx1000 microbenchmarks +++\n" 10 | 11 | if workload == "YCSB": 12 | print "Make sure you built this with #define WORKLOAD YCSB and ABORT_BUFFER_ENABLE false in config.h" 13 | # "High contention", from page 1637 of https://dl.acm.org/doi/pdf/10.1145/2882903.2882935 14 | os.system("rm ycsb-high-results.txt") 15 | for thread in thread_list: 16 | os.system("./rundb -o output.txt -t"+ str(thread) + " -r0.5 -w0.5 -R16 -z0.9") 17 | os.system("cat output.txt >> ycsb-high-results.txt") 18 | time.sleep(1) 19 | 20 | # "Medium contention" 21 | os.system("rm ycsb-med-results.txt") 22 | for thread in thread_list: 23 | os.system("./rundb -o output.txt -t"+ str(thread) + " -r0.9 -w0.1 -R16 -z0.8") 24 | os.system("cat output.txt >> ycsb-med-results.txt") 25 | time.sleep(1) 26 | 27 | # "Low contention" 28 | os.system("rm ycsb-low-results.txt") 29 | for thread in thread_list: 30 | os.system("./rundb -o output.txt -t"+ str(thread) + " -r1.0 -w0 -R2 -z0") 31 | os.system("cat output.txt >> ycsb-low-results.txt") 32 | time.sleep(1) 33 | 34 | 35 | 36 | if workload == "TPCC": 37 | print "Make sure you built this with #define WORKLOAD TPCC in config.h\n" 38 | # "High contention", from page 1637 of https://dl.acm.org/doi/pdf/10.1145/2882903.2882935 39 | os.system("rm tpcc-results.txt") 40 | for thread in thread_list: 41 | os.system("./rundb -o output.txt -t"+ str(thread) + " -n4") 42 | os.system("cat output.txt >> tpcc-results.txt") 43 | time.sleep(1) 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /DBx1000/storage/catalog.cpp: -------------------------------------------------------------------------------- 1 | #include "catalog.h" 2 | #include "global.h" 3 | #include "helper.h" 4 | 5 | void 6 | Catalog::init(const char * table_name, int field_cnt) { 7 | this->table_name = table_name; 8 | this->field_cnt = 0; 9 | this->_columns = new Column [field_cnt]; 10 | this->tuple_size = 0; 11 | } 12 | 13 | void Catalog::add_col(char * col_name, uint64_t size, char * type) { 14 | _columns[field_cnt].size = size; 15 | strcpy(_columns[field_cnt].type, type); 16 | strcpy(_columns[field_cnt].name, col_name); 17 | _columns[field_cnt].id = field_cnt; 18 | _columns[field_cnt].index = tuple_size; 19 | tuple_size += size; 20 | field_cnt ++; 21 | } 22 | 23 | uint64_t Catalog::get_field_id(const char * name) { 24 | UInt32 i; 25 | for (i = 0; i < field_cnt; i++) { 26 | if (strcmp(name, _columns[i].name) == 0) 27 | break; 28 | } 29 | assert (i < field_cnt); 30 | return i; 31 | } 32 | 33 | char * Catalog::get_field_type(uint64_t id) { 34 | return _columns[id].type; 35 | } 36 | 37 | char * Catalog::get_field_name(uint64_t id) { 38 | return _columns[id].name; 39 | } 40 | 41 | 42 | char * Catalog::get_field_type(char * name) { 43 | return get_field_type( get_field_id(name) ); 44 | } 45 | 46 | uint64_t Catalog::get_field_index(char * name) { 47 | return get_field_index( get_field_id(name) ); 48 | } 49 | 50 | void Catalog::print_schema() { 51 | printf("\n[Catalog] %s\n", table_name); 52 | for (UInt32 i = 0; i < field_cnt; i++) { 53 | printf("\t%s\t%s\t%ld\n", get_field_name(i), 54 | get_field_type(i), get_field_size(i)); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DBx1000/storage/catalog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "global.h" 6 | #include "helper.h" 7 | 8 | class Column { 9 | public: 10 | Column() { 11 | this->type = new char[80]; 12 | this->name = new char[80]; 13 | } 14 | Column(uint64_t size, char * type, char * name, 15 | uint64_t id, uint64_t index) 16 | { 17 | this->size = size; 18 | this->id = id; 19 | this->index = index; 20 | this->type = new char[80]; 21 | this->name = new char[80]; 22 | strcpy(this->type, type); 23 | strcpy(this->name, name); 24 | }; 25 | 26 | UInt64 id; 27 | UInt32 size; 28 | UInt32 index; 29 | char * type; 30 | char * name; 31 | char pad[CL_SIZE - sizeof(uint64_t)*3 - sizeof(char *)*2]; 32 | }; 33 | 34 | class Catalog { 35 | public: 36 | // abandoned init function 37 | // field_size is the size of each each field. 38 | void init(const char * table_name, int field_cnt); 39 | void add_col(char * col_name, uint64_t size, char * type); 40 | 41 | UInt32 field_cnt; 42 | const char * table_name; 43 | 44 | UInt32 get_tuple_size() { return tuple_size; }; 45 | 46 | uint64_t get_field_cnt() { return field_cnt; }; 47 | uint64_t get_field_size(int id) { return _columns[id].size; }; 48 | uint64_t get_field_index(int id) { return _columns[id].index; }; 49 | char * get_field_type(uint64_t id); 50 | char * get_field_name(uint64_t id); 51 | uint64_t get_field_id(const char * name); 52 | char * get_field_type(char * name); 53 | uint64_t get_field_index(char * name); 54 | 55 | void print_schema(); 56 | Column * _columns; 57 | UInt32 tuple_size; 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /DBx1000/storage/index_base.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | 5 | class table_t; 6 | 7 | class index_base { 8 | public: 9 | virtual RC init() { return RCOK; }; 10 | virtual RC init(uint64_t size) { return RCOK; }; 11 | 12 | virtual bool index_exist(idx_key_t key)=0; // check if the key exist. 13 | 14 | virtual RC index_insert(idx_key_t key, 15 | itemid_t * item, 16 | int part_id=-1)=0; 17 | 18 | virtual RC index_read(idx_key_t key, 19 | itemid_t * &item, 20 | int part_id=-1)=0; 21 | 22 | virtual RC index_read(idx_key_t key, 23 | itemid_t * &item, 24 | int part_id=-1, int thd_id=0)=0; 25 | 26 | // TODO implement index_remove 27 | virtual RC index_remove(idx_key_t key) { return RCOK; }; 28 | 29 | // the index in on "table". The key is the merged key of "fields" 30 | table_t * table; 31 | }; 32 | -------------------------------------------------------------------------------- /DBx1000/storage/index_hash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | #include "helper.h" 5 | #include "index_base.h" 6 | 7 | //TODO make proper variables private 8 | // each BucketNode contains items sharing the same key 9 | class BucketNode { 10 | public: 11 | BucketNode(idx_key_t key) { init(key); }; 12 | void init(idx_key_t key) { 13 | this->key = key; 14 | next = NULL; 15 | items = NULL; 16 | } 17 | idx_key_t key; 18 | // The node for the next key 19 | BucketNode * next; 20 | // NOTE. The items can be a list of items connected by the next pointer. 21 | itemid_t * items; 22 | }; 23 | 24 | // BucketHeader does concurrency control of Hash 25 | class BucketHeader { 26 | public: 27 | void init(); 28 | void insert_item(idx_key_t key, itemid_t * item, int part_id); 29 | void read_item(idx_key_t key, itemid_t * &item, const char * tname); 30 | BucketNode * first_node; 31 | uint64_t node_cnt; 32 | bool locked; 33 | }; 34 | 35 | // TODO Hash index does not support partition yet. 36 | class IndexHash : public index_base 37 | { 38 | public: 39 | RC init(uint64_t bucket_cnt, int part_cnt); 40 | RC init(int part_cnt, 41 | table_t * table, 42 | uint64_t bucket_cnt); 43 | bool index_exist(idx_key_t key); // check if the key exist. 44 | RC index_insert(idx_key_t key, itemid_t * item, int part_id=-1); 45 | // the following call returns a single item 46 | RC index_read(idx_key_t key, itemid_t * &item, int part_id=-1); 47 | RC index_read(idx_key_t key, itemid_t * &item, 48 | int part_id=-1, int thd_id=0); 49 | private: 50 | void get_latch(BucketHeader * bucket); 51 | void release_latch(BucketHeader * bucket); 52 | 53 | // TODO implement more complex hash function 54 | uint64_t hash(idx_key_t key) { return key % _bucket_cnt_per_part; } 55 | 56 | BucketHeader ** _buckets; 57 | uint64_t _bucket_cnt; 58 | uint64_t _bucket_cnt_per_part; 59 | }; 60 | -------------------------------------------------------------------------------- /DBx1000/storage/table.cpp: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | #include "helper.h" 3 | #include "table.h" 4 | #include "catalog.h" 5 | #include "row.h" 6 | #include "mem_alloc.h" 7 | 8 | void table_t::init(Catalog * schema) { 9 | this->table_name = schema->table_name; 10 | this->schema = schema; 11 | } 12 | 13 | RC table_t::get_new_row(row_t *& row) { 14 | // this function is obsolete. 15 | assert(false); 16 | return RCOK; 17 | } 18 | 19 | // the row is not stored locally. the pointer must be maintained by index structure. 20 | RC table_t::get_new_row(row_t *& row, uint64_t part_id, uint64_t &row_id) { 21 | RC rc = RCOK; 22 | cur_tab_size ++; 23 | 24 | row = (row_t *) _mm_malloc(sizeof(row_t), 64); 25 | rc = row->init(this, part_id, row_id); 26 | row->init_manager(row); 27 | 28 | return rc; 29 | } 30 | -------------------------------------------------------------------------------- /DBx1000/storage/table.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | 5 | // TODO sequential scan is not supported yet. 6 | // only index access is supported for table. 7 | class Catalog; 8 | class row_t; 9 | 10 | class table_t 11 | { 12 | public: 13 | void init(Catalog * schema); 14 | // row lookup should be done with index. But index does not have 15 | // records for new rows. get_new_row returns the pointer to a 16 | // new row. 17 | RC get_new_row(row_t *& row); // this is equivalent to insert() 18 | RC get_new_row(row_t *& row, uint64_t part_id, uint64_t &row_id); 19 | 20 | void delete_row(); // TODO delete_row is not supportet yet 21 | 22 | uint64_t get_table_size() { return cur_tab_size; }; 23 | Catalog * get_schema() { return schema; }; 24 | const char * get_table_name() { return table_name; }; 25 | 26 | Catalog * schema; 27 | private: 28 | const char * table_name; 29 | uint64_t cur_tab_size; 30 | char pad[CL_SIZE - sizeof(void *)*3]; 31 | }; 32 | -------------------------------------------------------------------------------- /DBx1000/system/global.cpp: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | #include "mem_alloc.h" 3 | #include "stats.h" 4 | #include "dl_detect.h" 5 | #include "manager.h" 6 | #include "query.h" 7 | #include "plock.h" 8 | #include "occ.h" 9 | #include "vll.h" 10 | 11 | mem_alloc mem_allocator; 12 | Stats stats; 13 | DL_detect dl_detector; 14 | Manager * glob_manager; 15 | Query_queue * query_queue; 16 | Plock part_lock_man; 17 | OptCC occ_man; 18 | #if CC_ALG == VLL 19 | VLLMan vll_man; 20 | #endif 21 | 22 | bool volatile warmup_finish = false; 23 | bool volatile enable_thread_mem_pool = false; 24 | pthread_barrier_t warmup_bar; 25 | #ifndef NOGRAPHITE 26 | carbon_barrier_t enable_barrier; 27 | #endif 28 | 29 | ts_t g_abort_penalty = ABORT_PENALTY; 30 | bool g_central_man = CENTRAL_MAN; 31 | UInt32 g_ts_alloc = TS_ALLOC; 32 | bool g_key_order = KEY_ORDER; 33 | bool g_no_dl = NO_DL; 34 | ts_t g_timeout = TIMEOUT; 35 | ts_t g_dl_loop_detect = DL_LOOP_DETECT; 36 | bool g_ts_batch_alloc = TS_BATCH_ALLOC; 37 | UInt32 g_ts_batch_num = TS_BATCH_NUM; 38 | 39 | bool g_part_alloc = PART_ALLOC; 40 | bool g_mem_pad = MEM_PAD; 41 | UInt32 g_cc_alg = CC_ALG; 42 | ts_t g_query_intvl = QUERY_INTVL; 43 | UInt32 g_part_per_txn = PART_PER_TXN; 44 | double g_perc_multi_part = PERC_MULTI_PART; 45 | double g_read_perc = READ_PERC; 46 | double g_write_perc = WRITE_PERC; 47 | double g_zipf_theta = ZIPF_THETA; 48 | bool g_prt_lat_distr = PRT_LAT_DISTR; 49 | UInt32 g_part_cnt = PART_CNT; 50 | UInt32 g_virtual_part_cnt = VIRTUAL_PART_CNT; 51 | UInt32 g_thread_cnt = THREAD_CNT; 52 | UInt64 g_synth_table_size = SYNTH_TABLE_SIZE; 53 | UInt32 g_req_per_query = REQ_PER_QUERY; 54 | UInt32 g_field_per_tuple = FIELD_PER_TUPLE; 55 | UInt32 g_init_parallelism = INIT_PARALLELISM; 56 | 57 | UInt32 g_num_wh = NUM_WH; 58 | double g_perc_payment = PERC_PAYMENT; 59 | bool g_wh_update = WH_UPDATE; 60 | char * output_file = NULL; 61 | 62 | map g_params; 63 | 64 | #if TPCC_SMALL 65 | UInt32 g_max_items = 10000; 66 | UInt32 g_cust_per_dist = 2000; 67 | #else 68 | UInt32 g_max_items = 100000; 69 | UInt32 g_cust_per_dist = 3000; 70 | #endif 71 | -------------------------------------------------------------------------------- /DBx1000/system/manager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "helper.h" 4 | #include "global.h" 5 | 6 | class row_t; 7 | class txn_man; 8 | 9 | class Manager { 10 | public: 11 | void init(); 12 | // returns the next timestamp. 13 | ts_t get_ts(uint64_t thread_id); 14 | 15 | // For MVCC. To calculate the min active ts in the system 16 | void add_ts(uint64_t thd_id, ts_t ts); 17 | ts_t get_min_ts(uint64_t tid = 0); 18 | 19 | // HACK! the following mutexes are used to model a centralized 20 | // lock/timestamp manager. 21 | void lock_row(row_t * row); 22 | void release_row(row_t * row); 23 | 24 | txn_man * get_txn_man(int thd_id) { return _all_txns[thd_id]; }; 25 | void set_txn_man(txn_man * txn); 26 | 27 | uint64_t get_epoch() { return *_epoch; }; 28 | void update_epoch(); 29 | private: 30 | // for SILO 31 | volatile uint64_t * _epoch; 32 | ts_t * _last_epoch_update_time; 33 | 34 | pthread_mutex_t ts_mutex; 35 | uint64_t * timestamp; 36 | pthread_mutex_t mutexes[BUCKET_CNT]; 37 | uint64_t hash(row_t * row); 38 | ts_t volatile * volatile * volatile all_ts; 39 | txn_man ** _all_txns; 40 | // for MVCC 41 | volatile ts_t _last_min_ts_time; 42 | ts_t _min_ts; 43 | }; 44 | -------------------------------------------------------------------------------- /DBx1000/system/mem_alloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _MEM_ALLOC_H_ 2 | #define _MEM_ALLOC_H_ 3 | 4 | #include "global.h" 5 | #include 6 | 7 | const int SizeNum = 4; 8 | const UInt32 BlockSizes[] = {32, 64, 256, 1024}; 9 | 10 | typedef struct free_block { 11 | int size; 12 | struct free_block* next; 13 | } FreeBlock; 14 | 15 | class Arena { 16 | public: 17 | void init(int arena_id, int size); 18 | void * alloc(); 19 | void free(void * ptr); 20 | private: 21 | char * _buffer; 22 | int _size_in_buffer; 23 | int _arena_id; 24 | int _block_size; 25 | FreeBlock * _head; 26 | char _pad[128 - sizeof(int)*3 - sizeof(void *)*2 - 8]; 27 | }; 28 | 29 | class mem_alloc { 30 | public: 31 | void init(uint64_t part_cnt, uint64_t bytes_per_part); 32 | void register_thread(int thd_id); 33 | void unregister(); 34 | void * alloc(uint64_t size, uint64_t part_id); 35 | void free(void * block, uint64_t size); 36 | int get_arena_id(); 37 | private: 38 | void init_thread_arena(); 39 | int get_size_id(UInt32 size); 40 | 41 | // each thread has several arenas for different block size 42 | Arena ** _arenas; 43 | int _bucket_cnt; 44 | std::pair* pid_arena;// max_arena_id; 45 | pthread_mutex_t map_lock; // only used for pid_to_arena update 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /DBx1000/system/query.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | #include "helper.h" 5 | 6 | class workload; 7 | class ycsb_query; 8 | class tpcc_query; 9 | 10 | class base_query { 11 | public: 12 | virtual void init(uint64_t thd_id, workload * h_wl) = 0; 13 | uint64_t waiting_time; 14 | uint64_t part_num; 15 | uint64_t * part_to_access; 16 | }; 17 | 18 | // All the querise for a particular thread. 19 | class Query_thd { 20 | public: 21 | void init(workload * h_wl, int thread_id); 22 | base_query * get_next_query(); 23 | int q_idx; 24 | #if WORKLOAD == YCSB 25 | ycsb_query * queries; 26 | #else 27 | tpcc_query * queries; 28 | #endif 29 | char pad[CL_SIZE - sizeof(void *) - sizeof(int)]; 30 | drand48_data buffer; 31 | }; 32 | 33 | // TODO we assume a separate task queue for each thread in order to avoid 34 | // contention in a centralized query queue. In reality, more sofisticated 35 | // queue model might be implemented. 36 | class Query_queue { 37 | public: 38 | void init(workload * h_wl); 39 | void init_per_thread(int thread_id); 40 | base_query * get_next_query(uint64_t thd_id); 41 | 42 | private: 43 | static void * threadInitQuery(void * This); 44 | 45 | Query_thd ** all_queries; 46 | workload * _wl; 47 | static int _next_tid; 48 | }; 49 | -------------------------------------------------------------------------------- /DBx1000/system/stats.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Stats_thd { 4 | public: 5 | void init(uint64_t thd_id); 6 | void clear(); 7 | 8 | char _pad2[CL_SIZE]; 9 | uint64_t txn_cnt; 10 | uint64_t abort_cnt; 11 | double run_time; 12 | double time_man; 13 | double time_index; 14 | double time_wait; 15 | double time_abort; 16 | double time_cleanup; 17 | uint64_t time_ts_alloc; 18 | double time_query; 19 | uint64_t wait_cnt; 20 | uint64_t debug1; 21 | uint64_t debug2; 22 | uint64_t debug3; 23 | uint64_t debug4; 24 | uint64_t debug5; 25 | 26 | uint64_t latency; 27 | uint64_t * all_debug1; 28 | uint64_t * all_debug2; 29 | char _pad[CL_SIZE]; 30 | }; 31 | 32 | class Stats_tmp { 33 | public: 34 | void init(); 35 | void clear(); 36 | double time_man; 37 | double time_index; 38 | double time_wait; 39 | char _pad[CL_SIZE - sizeof(double)*3]; 40 | }; 41 | 42 | class Stats { 43 | public: 44 | // PER THREAD statistics 45 | Stats_thd ** _stats; 46 | // stats are first written to tmp_stats, if the txn successfully commits, 47 | // copy the values in tmp_stats to _stats 48 | Stats_tmp ** tmp_stats; 49 | 50 | // GLOBAL statistics 51 | double dl_detect_time; 52 | double dl_wait_time; 53 | uint64_t cycle_detect; 54 | uint64_t deadlock; 55 | 56 | void init(); 57 | void init(uint64_t thread_id); 58 | void clear(uint64_t tid); 59 | void add_debug(uint64_t thd_id, uint64_t value, uint32_t select); 60 | void commit(uint64_t thd_id); 61 | void abort(uint64_t thd_id); 62 | void print(); 63 | void print_lat_distr(); 64 | }; 65 | -------------------------------------------------------------------------------- /DBx1000/system/thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | 5 | class workload; 6 | class base_query; 7 | 8 | class thread_t { 9 | public: 10 | uint64_t _thd_id; 11 | workload * _wl; 12 | 13 | uint64_t get_thd_id(); 14 | 15 | uint64_t get_host_cid(); 16 | void set_host_cid(uint64_t cid); 17 | 18 | uint64_t get_cur_cid(); 19 | void set_cur_cid(uint64_t cid); 20 | 21 | void init(uint64_t thd_id, workload * workload); 22 | // the following function must be in the form void* (*)(void*) 23 | // to run with pthread. 24 | // conversion is done within the function. 25 | RC run(); 26 | private: 27 | uint64_t _host_cid; 28 | uint64_t _cur_cid; 29 | ts_t _curr_ts; 30 | ts_t get_next_ts(); 31 | 32 | RC runTest(txn_man * txn); 33 | drand48_data buffer; 34 | 35 | // A restart buffer for aborted txns. 36 | struct AbortBufferEntry { 37 | ts_t ready_time; 38 | base_query * query; 39 | }; 40 | AbortBufferEntry * _abort_buffer; 41 | int _abort_buffer_size; 42 | int _abort_buffer_empty_slots; 43 | bool _abort_buffer_enable; 44 | }; 45 | -------------------------------------------------------------------------------- /DBx1000/system/wl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "global.h" 4 | 5 | class row_t; 6 | class table_t; 7 | class IndexHash; 8 | class index_btree; 9 | class Catalog; 10 | class lock_man; 11 | class txn_man; 12 | class thread_t; 13 | class index_base; 14 | class Timestamp; 15 | class Mvcc; 16 | 17 | // this is the base class for all workload 18 | class workload 19 | { 20 | public: 21 | // tables indexed by table name 22 | map tables; 23 | map indexes; 24 | 25 | 26 | // initialize the tables and indexes. 27 | virtual RC init(); 28 | virtual RC init_schema(string schema_file); 29 | virtual RC init_table()=0; 30 | virtual RC get_txn_man(txn_man *& txn_manager, thread_t * h_thd)=0; 31 | 32 | bool sim_done; 33 | protected: 34 | void index_insert(string index_name, uint64_t key, row_t * row); 35 | void index_insert(INDEX * index, uint64_t key, row_t * row, int64_t part_id = -1); 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 pramalhe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /common/ThreadRegistry.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 3 | * Andreia Correia 4 | * Pedro Ramalhete 5 | * Pascal Felber 6 | * 7 | * This work is published under the MIT license. See LICENSE.txt 8 | */ 9 | 10 | /* 11 | * Contains all global variables. 12 | */ 13 | #include "common/ThreadRegistry.hpp" 14 | 15 | // Global/singleton to hold all the thread registry functionality 16 | ThreadRegistry gThreadRegistry {}; 17 | 18 | // This is where every thread stores the tid it has been assigned when it calls getTID() for the first time. 19 | // When the thread dies, the destructor of ThreadCheckInCheckOut will be called and de-register the thread. 20 | thread_local ThreadCheckInCheckOut tl_tcico {}; 21 | 22 | void thread_registry_deregister_thread(const int tid) { 23 | gThreadRegistry.deregister_thread(tid); 24 | } 25 | -------------------------------------------------------------------------------- /graphs/README.md: -------------------------------------------------------------------------------- 1 | Every .cpp file here outputs a plot taken from a benchmark. 2 | The corresponding tab-separated values are placed in the data/ folder and can then be read by gnuplot to make the actual plots. 3 | The .gp and corresponding pdf files are in the plots/ folder. 4 | To generate the plots, type: 5 | cd plots 6 | ./plot-all.sh 7 | -------------------------------------------------------------------------------- /graphs/data/.gitignore: -------------------------------------------------------------------------------- 1 | /part-disjoint-2plundodistsf.txt 2 | /part-disjoint-tl2undo.txt 3 | /sps-integer-2plundodistsf.txt 4 | /sps-integer-oreceager.txt 5 | /sps-integer-tiny.txt 6 | /sps-integer-tl2orig.txt 7 | /sps-integer-ofwf.txt 8 | /set-tree-1m-2plundodistsf.txt 9 | /map-ravl-10k-tiny.txt 10 | /map-ravl-98u-100k-ofwf.txt 11 | /map-skiplist-98u-100k-ofwf.txt 12 | /map-ziptree-98u-100k-ofwf.txt 13 | /set-tree-1m-2plsf.txt 14 | -------------------------------------------------------------------------------- /graphs/data/cervino/latency-2plsf.txt: -------------------------------------------------------------------------------- 1 | threads P90 P99 P999 2 | 1 1163 1182 1196 3 | 4 2404 2469 2508 4 | 8 2377 2451 2495 5 | 16 2375 2462 2502 6 | 24 2375 2452 2498 7 | 32 2363 2432 2484 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/latency-ofwf.txt: -------------------------------------------------------------------------------- 1 | threads P90 P99 P999 2 | 1 1157 1178 1193 3 | 4 6762 7930 8017 4 | 8 13479 16986 20348 5 | 16 26916 33709 41565 6 | 24 40393 48194 51522 7 | 32 40393 48194 51522 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/latency-oreceager.txt: -------------------------------------------------------------------------------- 1 | threads P90 P99 P999 2 | 1 1145 1158 1169 3 | 4 64227 70435 72787 4 | 8 61964 68715 72506 5 | 16 58406 67602 72383 6 | 24 56809 67201 72215 7 | 32 54191 65890 71917 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/latency-tiny.txt: -------------------------------------------------------------------------------- 1 | threads P90 P99 P999 2 | 1 1147 1165 1181 3 | 4 1682323 5012220 5653718 4 | 8 725991 3025805 4362391 5 | 16 1628749 4789842 7628150 6 | 24 1255441 2401368 6538200 7 | 32 1873899 5079261 16872792 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/latency-tl2orig.txt: -------------------------------------------------------------------------------- 1 | threads P90 P99 P999 2 | 1 1150 1162 1175 3 | 4 14916 49919 137821 4 | 8 16094 41985 83778 5 | 16 7989 32642 65328 6 | 24 7912 28346 76820 7 | 32 6719 24668 63942 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-RAVL-100% 2 | 1 1335704 3 | 4 4775333 4 | 8 8513050 5 | 12 12671199 6 | 16 18047424 7 | 24 21830325 8 | 32 22585464 9 | 40 28839209 10 | 48 30905796 11 | 56 31049970 12 | 64 30817305 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-RAVL-100% 2 | 1 1479588 3 | 4 4024967 4 | 8 2823720 5 | 12 2415537 6 | 16 1970608 7 | 24 2613382 8 | 32 3212057 9 | 40 1509440 10 | 48 1456588 11 | 56 1880308 12 | 64 2379891 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-RAVL-100% 2 | 1 1583697 3 | 4 6852045 4 | 8 8752174 5 | 12 10255716 6 | 16 10126529 7 | 24 15535669 8 | 32 13389124 9 | 40 12610183 10 | 48 12921687 11 | 56 13739262 12 | 64 14676589 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-RAVL-100% 2 | 1 645002 3 | 4 2491732 4 | 8 4204408 5 | 12 5934906 6 | 16 7375304 7 | 24 8810444 8 | 32 9452734 9 | 40 9182136 10 | 48 9171911 11 | 56 9780706 12 | 64 10129836 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100u-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-RAVL-100% 2 | 1 1370745 3 | 4 6361837 4 | 8 11618070 5 | 12 16362487 6 | 16 16360270 7 | 24 23678628 8 | 32 23647435 9 | 40 33303748 10 | 48 37011570 11 | 56 33260977 12 | 64 33885962 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100u-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-RAVL-100% 2 | 1 1550208 3 | 4 3382039 4 | 8 2758618 5 | 12 2290682 6 | 16 1895897 7 | 24 1993179 8 | 32 2278397 9 | 40 1663462 10 | 48 1430804 11 | 56 1836752 12 | 64 2367432 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100u-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-RAVL-100% 2 | 1 1691417 3 | 4 7627553 4 | 8 8755921 5 | 12 9709049 6 | 16 10337373 7 | 24 12053625 8 | 32 13449151 9 | 40 11464893 10 | 48 11656746 11 | 56 12514736 12 | 64 13244446 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-100u-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-RAVL-100% 2 | 1 664743 3 | 4 2434277 4 | 8 4145639 5 | 12 5971702 6 | 16 7281660 7 | 24 8953314 8 | 32 9133869 9 | 40 9167168 10 | 48 9549306 11 | 56 9831945 12 | 64 9928136 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-98u-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-RAVL-Map-100% 2 | 1 1454371 3 | 4 5282283 4 | 8 10639481 5 | 12 13044419 6 | 16 17687154 7 | 24 23360765 8 | 32 28629829 9 | 40 30266133 10 | 48 30940105 11 | 56 31977976 12 | 64 29630802 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-98u-100k-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-RAVL-Map-100% 2 | 1 1606256 3 | 4 1854058 4 | 8 1472219 5 | 12 1862644 6 | 16 2109853 7 | 24 2492685 8 | 32 2419502 9 | 40 2385162 10 | 48 2375966 11 | 56 2325072 12 | 64 2060894 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-98u-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-RAVL-Map-100% 2 | 1 1517233 3 | 4 4141444 4 | 8 2810023 5 | 12 2272504 6 | 16 1725669 7 | 24 1580633 8 | 32 1318590 9 | 40 1407054 10 | 48 1447564 11 | 56 1833148 12 | 64 2339417 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-98u-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-RAVL-Map-100% 2 | 1 1983931 3 | 4 7025075 4 | 8 8127263 5 | 12 9594646 6 | 16 9983958 7 | 24 12356005 8 | 32 12277006 9 | 40 11537675 10 | 48 12355203 11 | 56 13299655 12 | 64 14193987 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-98u-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-RAVL-Map-100% 2 | 1 659778 3 | 4 2631856 4 | 8 4467922 5 | 12 6162057 6 | 16 7316964 7 | 24 9202167 8 | 32 9515730 9 | 40 9518515 10 | 48 8827416 11 | 56 9615365 12 | 64 9691434 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ravl-98u-100k-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads TLRW-RAVLMap-100% 2 | 1 1105806 3 | 4 1826355 4 | 8 2612502 5 | 12 2845517 6 | 16 2569381 7 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-SkipListMap-100% 2 | 1 762087 3 | 4 2975602 4 | 8 5437572 5 | 12 7918312 6 | 16 10288774 7 | 24 13784619 8 | 32 15843392 9 | 40 18115925 10 | 48 19697077 11 | 56 19878557 12 | 64 18541017 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-SkipListMap-100% 2 | 1 669313 3 | 4 1909573 4 | 8 2473270 5 | 12 2437162 6 | 16 2347292 7 | 24 2327534 8 | 32 2925886 9 | 40 1649501 10 | 48 1563356 11 | 56 2001146 12 | 64 2561815 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-SkipListMap-100% 2 | 1 960453 3 | 4 3743902 4 | 8 6137124 5 | 12 8141148 6 | 16 9716628 7 | 24 13318245 8 | 32 14690901 9 | 40 11562890 10 | 48 12093146 11 | 56 12900702 12 | 64 13740638 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-SkipListMap-100% 2 | 1 423916 3 | 4 1659204 4 | 8 2998363 5 | 12 4287822 6 | 16 5713655 7 | 24 7477706 8 | 32 8309597 9 | 40 9234125 10 | 48 9463297 11 | 56 8857363 12 | 64 9170052 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100u-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-SkipListMap-100% 2 | 1 806791 3 | 4 2769782 4 | 8 5963704 5 | 12 8310362 6 | 16 10442103 7 | 24 14552213 8 | 32 16731131 9 | 40 20524208 10 | 48 22565592 11 | 56 22844003 12 | 64 23043793 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100u-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-SkipListMap-100% 2 | 1 705093 3 | 4 1829551 4 | 8 2403818 5 | 12 2326614 6 | 16 1789206 7 | 24 2643528 8 | 32 2152675 9 | 40 1661354 10 | 48 1474619 11 | 56 1874565 12 | 64 2451127 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100u-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-SkipListMap-100% 2 | 1 999953 3 | 4 3684483 4 | 8 6186529 5 | 12 8019391 6 | 16 9040256 7 | 24 12974852 8 | 32 14420744 9 | 40 10433010 10 | 48 10907227 11 | 56 11704474 12 | 64 12476735 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-100u-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-SkipListMap-100% 2 | 1 430296 3 | 4 1674269 4 | 8 3004414 5 | 12 4386906 6 | 16 5388033 7 | 24 7486356 8 | 32 8399476 9 | 40 8818613 10 | 48 8802363 11 | 56 8469548 12 | 64 8484062 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-98u-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-SkipListMap-100% 2 | 1 737024 3 | 4 2995945 4 | 8 5570248 5 | 12 8130809 6 | 16 10628689 7 | 24 14970877 8 | 32 18204405 9 | 40 19380309 10 | 48 19918700 11 | 56 19753460 12 | 64 19449338 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-98u-100k-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-SkipListMap-100% 2 | 1 1067523 3 | 4 1744050 4 | 8 1309563 5 | 12 1547385 6 | 16 1588449 7 | 24 1631620 8 | 32 1676315 9 | 40 1561518 10 | 48 1553747 11 | 56 1519460 12 | 64 1430635 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-98u-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-SkipListMap-100% 2 | 1 654122 3 | 4 1884818 4 | 8 2402240 5 | 12 2289268 6 | 16 1755803 7 | 24 1469286 8 | 32 1115603 9 | 40 1524484 10 | 48 1493178 11 | 56 1911941 12 | 64 2446770 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-98u-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-SkipListMap-100% 2 | 1 942463 3 | 4 3792893 4 | 8 6247059 5 | 12 8027490 6 | 16 9074521 7 | 24 9342862 8 | 32 9533139 9 | 40 10325818 10 | 48 11644004 11 | 56 12708437 12 | 64 13427995 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-98u-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-SkipListMap-100% 2 | 1 407617 3 | 4 1605531 4 | 8 2946433 5 | 12 4338395 6 | 16 5568967 7 | 24 7481229 8 | 32 8400592 9 | 40 8927960 10 | 48 9055837 11 | 56 8992813 12 | 64 8949225 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-skiplist-98u-100k-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads TLRW-SkipListMap-100% 2 | 1 498071 3 | 4 1245945 4 | 8 1642641 5 | 12 1901661 6 | 16 1980521 7 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-ZipTreeMap-100% 2 | 1 1018540 3 | 4 4181048 4 | 8 7814969 5 | 12 11402510 6 | 16 14604217 7 | 24 20081631 8 | 32 22032363 9 | 40 26736912 10 | 48 27720119 11 | 56 25367348 12 | 64 21489341 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-ZipTreeMap-100% 2 | 1 782052 3 | 4 3094204 4 | 8 4174735 5 | 12 3801522 6 | 16 2732651 7 | 24 4866870 8 | 32 3845950 9 | 40 2980744 10 | 48 2537047 11 | 56 3182292 12 | 64 3857663 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-ZipTreeMap-100% 2 | 1 1325947 3 | 4 5220157 4 | 8 10151380 5 | 12 15164307 6 | 16 20057323 7 | 24 27807188 8 | 32 31196689 9 | 40 37893270 10 | 48 40606991 11 | 56 42220357 12 | 64 43596978 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-ZipTreeMap-100% 2 | 1 525887 3 | 4 2125195 4 | 8 4258027 5 | 12 6279846 6 | 16 8475773 7 | 24 10253486 8 | 32 10687391 9 | 40 16566692 10 | 48 17831723 11 | 56 18374385 12 | 64 18820824 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100u-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-ZipTreeMap-100% 2 | 1 1055443 3 | 4 4145135 4 | 8 7180935 5 | 12 10972245 6 | 16 13810999 7 | 24 19802641 8 | 32 20364991 9 | 40 24974634 10 | 48 28031081 11 | 56 28152216 12 | 64 28417373 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100u-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-ZipTreeMap-100% 2 | 1 1030167 3 | 4 2626402 4 | 8 2705103 5 | 12 2243945 6 | 16 1720431 7 | 24 2026859 8 | 32 1873640 9 | 40 1652222 10 | 48 1491096 11 | 56 1863142 12 | 64 2460366 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100u-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-ZipTreeMap-100% 2 | 1 1475638 3 | 4 5400858 4 | 8 7852114 5 | 12 9663581 6 | 16 10550250 7 | 24 14098448 8 | 32 14018234 9 | 40 11691477 10 | 48 12207732 11 | 56 13069943 12 | 64 13913998 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-100u-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-ZipTreeMap-100% 2 | 1 525393 3 | 4 2038865 4 | 8 3590730 5 | 12 5041971 6 | 16 6321476 7 | 24 8592473 8 | 32 9046608 9 | 40 9021573 10 | 48 8950895 11 | 56 8970119 12 | 64 9052885 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-98u-100k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-ZipTreeMap-100% 2 | 1 1019833 3 | 4 3931038 4 | 8 7050402 5 | 12 9840996 6 | 16 12423908 7 | 24 16437536 8 | 32 19050441 9 | 40 20667505 10 | 48 21148404 11 | 56 21332514 12 | 64 20828039 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-98u-100k-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-ZipTreeMap-100% 2 | 1 1390530 3 | 4 1781602 4 | 8 1397826 5 | 12 1683810 6 | 16 1874644 7 | 24 2157111 8 | 32 2195972 9 | 40 2320704 10 | 48 2328202 11 | 56 2269143 12 | 64 2071053 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-98u-100k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-ZipTreeMap-100% 2 | 1 940922 3 | 4 2572548 4 | 8 2612924 5 | 12 2223126 6 | 16 1671063 7 | 24 1418635 8 | 32 1103468 9 | 40 1403718 10 | 48 1470420 11 | 56 1914565 12 | 64 2408520 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-98u-100k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-ZipTreeMap-100% 2 | 1 1357935 3 | 4 5307010 4 | 8 7666885 5 | 12 8468721 6 | 16 9019068 7 | 24 10737905 8 | 32 11155009 9 | 40 11339022 10 | 48 12111903 11 | 56 12920729 12 | 64 13697712 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-98u-100k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-ZipTreeMap-100% 2 | 1 504261 3 | 4 1971355 4 | 8 3595730 5 | 12 5200362 6 | 16 6593062 7 | 24 7800169 8 | 32 8354378 9 | 40 9228372 10 | 48 8858473 11 | 56 8831022 12 | 64 9304038 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/map-ziptree-98u-100k-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads TLRW-ZipTreeMap-100% 2 | 1 673465 3 | 4 1579109 4 | 8 2112100 5 | 12 2275981 6 | 16 2656802 7 | -------------------------------------------------------------------------------- /graphs/data/cervino/part-disjoint-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF 2 | 1 879 3 | 4 1708 4 | 8 3444 5 | 16 6918 6 | 24 10379 7 | 32 13891 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/part-disjoint-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileWF 2 | 1 887 3 | 4 880 4 | 8 883 5 | 16 884 6 | 24 881 7 | 32 879 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/part-disjoint-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager 2 | 1 889 3 | 4 83 4 | 8 213 5 | 16 539 6 | 24 938 7 | 32 1364 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/part-disjoint-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM 2 | 1 887 3 | 4 4 4 | 8 20 5 | 16 15 6 | 24 31 7 | 32 22 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/part-disjoint-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig 2 | 1 885 3 | 4 711 4 | 8 1291 5 | 16 4374 6 | 24 6919 7 | 32 10622 8 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-btree-1m-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-SF-BTree-100% 2PL-Undo-Dist-SF-BTree-10% 2PL-Undo-Dist-SF-BTree-1% 2PL-Undo-Dist-SF-BTree-0% 2 | 1 941713 1137582 1278450 1343108 3 | 4 3670687 4356168 4910851 5223153 4 | 8 6085122 8052082 8685854 10410082 5 | 12 3701021 7426677 13849275 15582545 6 | 16 10547374 15219608 16933001 20782139 7 | 24 14044824 18380711 18935661 26176950 8 | 32 12171060 28113980 29947490 31185437 9 | 40 17842875 31092111 37460061 41360725 10 | 48 19605199 28288595 24005313 50622640 11 | 56 8148827 11464038 50648493 55181993 12 | 64 17217715 35833883 26007806 59804220 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-btree-1m-2plundo.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-BTree-100% 2PL-Undo-BTree-10% 2PL-Undo-BTree-1% 2PL-Undo-BTree-0% 2 | 1 726388 971594 1010513 1021162 3 | 2 753726 1406313 1379924 1458255 4 | 3 506660 1447271 1414570 1484169 5 | 4 475719 1424076 1681721 1517341 6 | 6 312203 1810023 1344180 1539444 7 | 8 192693 1501104 1736520 1867170 8 | 12 22100 400974 1891311 1211937 9 | 16 957207 316636 1781344 1766426 10 | 24 24882 98380 3087071 2171377 11 | 32 19152 172410 2016896 2404412 12 | 40 76241 1314414 586423 2530543 13 | 48 1083386 1991211 635026 2220254 14 | 55 5247 234853 2351705 2249264 15 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-btree-1m-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-BTree-100% OneFileSTM-WF-BTree-10% OneFileSTM-WF-BTree-1% OneFileSTM-WF-BTree-0% 2 | 1 713220 1097594 1159952 1170109 3 | 2 634170 1024981 1124367 1220495 4 | 4 406359 1079247 928067 987105 5 | 8 358048 780659 921092 978514 6 | 12 344899 728432 903360 919970 7 | 16 391364 696931 843790 880550 8 | 24 381074 688392 811854 810227 9 | 32 397554 681530 754139 692522 10 | 40 340632 676518 724278 704110 11 | 48 344254 680298 731906 694395 12 | 56 315681 670118 766273 714995 13 | 64 331879 546832 574405 532984 14 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-btree-1m-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-BTree-100% TinySTM-BTree-10% TinySTM-BTree-1% TinySTM-BTree-0% 2 | 1 906885 1366298 1460555 1482737 3 | 4 2917836 4531505 5521728 5729068 4 | 8 1568263 6872282 11069179 11317985 5 | 12 2434287 13646804 16128210 17123943 6 | 16 2775462 17857972 20308060 22589184 7 | 24 7417169 21565963 26556911 31630986 8 | 32 8022972 25747414 30853255 40970599 9 | 40 6796493 21979518 42563150 46371895 10 | 48 1570438 31382257 45924370 53959132 11 | 56 1617398 32057935 48160868 58529449 12 | 64 1837801 36323068 58512780 62727865 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-SF-HashMapFixedSize-100% 2PL-Undo-Dist-SF-HashMapFixedSize-20% 2PL-Undo-Dist-SF-HashMapFixedSize-0% 2 | 1 7290078 5733665 8164614 3 | 4 20915836 20228773 33428626 4 | 8 25622618 28597569 67147476 5 | 12 31741861 39345121 100609690 6 | 16 38516234 50138085 133153575 7 | 24 43867273 69011073 194398557 8 | 32 53245656 83253201 243780537 9 | 40 55665405 87983768 285654841 10 | 48 56049001 94064121 314890279 11 | 56 56664247 101924284 339666211 12 | 64 55427355 106870662 359539976 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-HashMapFixedSize-100% 2PL-Undo-Dist-HashMapFixedSize-20% 2PL-Undo-Dist-HashMapFixedSize-0% 2 | 1 7478151 5846691 8096659 3 | 4 20747571 20922251 32991303 4 | 8 26367301 30509596 65730186 5 | 12 31671888 39092305 99693807 6 | 16 36627372 49789955 134107433 7 | 24 42794125 68564326 197611757 8 | 32 53775547 82964840 248425045 9 | 40 52818634 87521837 287445704 10 | 48 53592527 90479556 323859125 11 | 56 49040145 96097003 350157925 12 | 64 53868911 105911084 377503549 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-HashMapFixedSize-100% OneFileSTM-WF-HashMapFixedSize-20% OneFileSTM-WF-HashMapFixedSize-0% 2 | 1 4872518 6771053 13757558 3 | 4 2189447 4606435 53337688 4 | 8 1228606 4739120 105817390 5 | 12 1357743 5325927 161770254 6 | 16 1489431 5936064 214548510 7 | 24 1704752 6945120 318059720 8 | 32 1860457 8234062 408868312 9 | 40 1998069 9195347 431774532 10 | 48 2163247 10075766 465759983 11 | 56 2274228 10481376 484506577 12 | 64 2036928 9947544 503596741 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-HashMapFixedSize-100% orec_eager-HashMapFixedSize-20% orec_eager-HashMapFixedSize-0% 2 | 1 6151371 2675223 1368672 3 | 4 6799990 5845320 4094413 4 | 8 3763563 3312923 2101576 5 | 12 3280096 2459608 3373955 6 | 16 2332954 1844348 2845984 7 | 24 1839022 1685010 3226628 8 | 32 1470894 3745385 3648594 9 | 40 1531946 1986590 3072616 10 | 48 1719101 2506016 3923240 11 | 56 2298639 3112978 4391922 12 | 64 3039863 3453470 4510920 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-HashMapFixedSize-100% TinySTM-HashMapFixedSize-20% TinySTM-HashMapFixedSize-0% 2 | 1 7003371 8549601 8767492 3 | 4 12896318 14508555 35996744 4 | 8 7643787 18045780 71850983 5 | 12 7516234 19512719 106120623 6 | 16 7416821 20111365 142105378 7 | 24 5683409 20104727 211513656 8 | 32 6011766 20137419 267155988 9 | 40 6484326 22257998 307694640 10 | 48 7396067 22281570 336614120 11 | 56 8855813 24086774 358582929 12 | 64 10134238 26324006 380763843 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-HashMapFixedSize-100% TL2-Orig-HashMapFixedSize-20% TL2-Orig-HashMapFixedSize-0% 2 | 1 1363373 1482971 1531649 3 | 4 4688758 5761954 6112225 4 | 8 5570694 9544591 12285737 5 | 12 5610978 13280125 18363687 6 | 16 5715314 16628326 24316223 7 | 24 5949175 19729950 34807498 8 | 32 6709492 20455353 37863119 9 | 40 7109933 21139287 42587256 10 | 48 7990816 21446010 45023280 11 | 56 9116644 21898856 46486614 12 | 64 10272137 22436675 47065198 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-hash-10k-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-HashMapFixedSize-100% TL2-Orig-HashMapFixedSize-20% TL2-Orig-HashMapFixedSize-0% 2 | 1 5162520 6128825 6660864 3 | 4 7365747 6636393 6278820 4 | 8 5397047 3617366 4838455 5 | 12 5450178 3812046 5197157 6 | 16 5311245 5344879 4789244 7 | 32 5691245 5645829 5776558 8 | 48 6362085 6940822 6814755 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-LinkedListSet-100% 2PLSF-LinkedListSet-20% 2PLSF-LinkedListSet-0% 2 | 1 97705 98191 98972 3 | 4 164957 300532 388897 4 | 8 143279 361324 784553 5 | 12 141166 369549 1174525 6 | 16 142351 384170 1516432 7 | 24 143557 393836 2367720 8 | 32 141806 397392 3105368 9 | 40 135172 378770 3476388 10 | 48 129077 366287 3966745 11 | 56 124480 362729 4426219 12 | 64 119845 356384 4846954 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-LinkedListSet-100% 2PL-Undo-Dist-LinkedListSet-20% 2PL-Undo-Dist-LinkedListSet-0% 2 | 1 96263 96465 97063 3 | 4 134698 191175 387521 4 | 8 121124 198038 778507 5 | 12 120402 202194 1166255 6 | 16 123390 206393 1553411 7 | 24 124427 211725 2301216 8 | 32 125387 214635 3012556 9 | 40 119633 212517 3556215 10 | 48 114650 208928 4079164 11 | 56 109830 206733 4559905 12 | 64 105359 205131 5019055 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-LinkedListSet-100% OneFileSTM-WF-LinkedListSet-20% OneFileSTM-WF-LinkedListSet-0% 2 | 1 281903 236757 249104 3 | 4 178516 561797 1001498 4 | 8 136174 599982 1948051 5 | 12 115993 552800 2971350 6 | 16 103786 519301 3895945 7 | 24 104392 489796 5824291 8 | 32 106421 487150 8304292 9 | 40 108365 492233 9940816 10 | 48 108735 487166 11194542 11 | 56 107503 461463 12353887 12 | 64 76346 350671 14000377 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads ORec-LinkedListSet-100% Orec-LinkedListSet-20% Orec-LinkedListSet-0% 2 | 1 130897 0 0 3 | 4 110168 0 0 4 | 8 118510 0 0 5 | 12 121404 0 0 6 | 16 125043 0 0 7 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-LinkedListSet-100% TinySTM-LinkedListSet-20% TinySTM-LinkedListSet-0% 2 | 1 176264 224687 251869 3 | 4 158057 470374 953494 4 | 8 118510 552286 1964033 5 | 12 95757 494696 2869267 6 | 16 95633 441690 3880967 7 | 24 74043 422217 5772936 8 | 32 79803 375830 7073870 9 | 40 79718 407794 7289390 10 | 48 87527 411099 7195646 11 | 56 87200 434828 7489960 12 | 64 71538 338413 7601254 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-LinkedListSet-100% TL2-Orig-LinkedListSet-20% TL2-Orig-LinkedListSet-0% 2 | 1 38467 75582 103333 3 | 4 51779 166684 417086 4 | 8 60603 188874 827450 5 | 12 68339 200195 1305032 6 | 16 74630 207654 1700041 7 | 24 80954 217554 2513136 8 | 32 76189 213881 3227814 9 | 40 78491 212829 3265727 10 | 48 75856 205415 3490410 11 | 56 69096 192537 3512892 12 | 64 81447 183439 3573188 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ll-1k-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads TLRW-LinkedListSet-100% TLRW-LinkedListSet-20% TLRW-LinkedListSet-0% 2 | 1 80688 0 0 3 | 4 61912 0 0 4 | 8 42336 0 0 5 | 12 35605 0 0 6 | 16 33114 0 0 7 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-RAVL-100% 2PLSF-RAVL-20% 2PLSF-RAVL-0% 2 | 1 758761 661587 918877 3 | 4 2860907 2651214 3409382 4 | 8 4433921 4691140 6791275 5 | 12 6114172 6683112 10031762 6 | 16 7810878 8681855 13374436 7 | 24 11266185 12846451 18130170 8 | 32 10901100 15502391 22291301 9 | 40 11873805 17034009 29946034 10 | 48 12778251 18136451 34388958 11 | 56 12799910 18758723 38217684 12 | 64 13109196 20691849 42494969 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-2plundo.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-RAVL-100% 2PL-Undo-RAVL-10% 2PL-Undo-RAVL-1% 2PL-Undo-RAVL-0% 2 | 1 598145 648895 670722 660883 3 | 4 1572396 1540813 1503387 1510664 4 | 8 1591112 1565972 1555771 1513132 5 | 12 1469871 1546753 1497386 1685167 6 | 16 1881266 1980883 2413476 1854860 7 | 24 1803697 2242033 1855021 2587678 8 | 32 2316595 2874064 3539480 2259914 9 | 40 1900100 1679586 2134801 2159115 10 | 48 2106841 2110240 2128368 2361963 11 | 55 2756814 2669452 2433721 2619413 12 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-RAVL-100% 2PL-Undo-Dist-RAVL-20% 2PL-Undo-Dist-RAVL-0% 2 | 1 758123 640190 899580 3 | 4 2727645 2598307 3643190 4 | 8 3402406 3800528 6646161 5 | 12 3877544 5088561 9913857 6 | 16 4693677 6698847 13331812 7 | 24 5028015 8338301 18412717 8 | 32 5207035 9126426 22570393 9 | 40 5192446 9588912 28158050 10 | 48 4998540 12169086 34274419 11 | 56 4635547 12882392 38105472 12 | 64 5538348 13126321 42458407 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-RAVL-100% OneFileSTM-WF-RAVL-20% OneFileSTM-WF-RAVL-0% 2 | 1 855440 944528 1079818 3 | 4 579071 2233421 4378234 4 | 8 440452 1983204 7875764 5 | 12 426521 1980088 11595590 6 | 16 435621 2033409 15613827 7 | 24 431034 1979722 23348677 8 | 32 428900 1902360 30211337 9 | 40 407890 1734371 36970109 10 | 48 371008 1622731 43836472 11 | 56 359673 1572347 50164051 12 | 64 395858 1909868 56271509 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-RAVL-100% orec_eager-RAVL-20% orec_eager-RAVL-0% 2 | 1 770543 717969 598728 3 | 4 2039467 2505989 2181175 4 | 8 2518800 3551332 2293434 5 | 12 2940584 2623983 3871105 6 | 16 2760555 2885693 2442294 7 | 24 3684766 2690452 3366292 8 | 32 3493513 6854466 4782264 9 | 40 1740759 2898801 2646544 10 | 48 1714330 3203733 3967475 11 | 56 2274609 3934134 4222652 12 | 64 2902346 4411110 4514488 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-oreclazy.txt: -------------------------------------------------------------------------------- 1 | Threads orec_lazy-RAVL-100% orec_lazy-RAVL-10% orec_lazy-RAVL-1% orec_lazy-RAVL-0% 2 | 1 678473 685432 544713 478560 3 | 4 1780981 1782475 2013528 1816446 4 | 8 2371588 3864766 2639099 2785315 5 | 12 2856780 2765144 3030845 2487967 6 | 16 2879737 3104538 3334864 2679527 7 | 24 3024624 2975975 4313312 2831937 8 | 32 3855398 8297569 5398185 2366247 9 | 40 1880977 2772947 3238897 3479039 10 | 48 1663928 3426562 3754549 3104091 11 | 56 2351423 4266151 4166271 3227381 12 | 64 3057792 4772376 4443058 3795678 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-RAVL-100% TinySTM-RAVL-20% TinySTM-RAVL-0% 2 | 1 904162 1087577 1178325 3 | 4 3080050 4039922 4556177 4 | 8 4720846 6713642 8318604 5 | 12 5418795 9311728 12446212 6 | 16 6194666 11807476 16573336 7 | 24 7294109 16486392 24965311 8 | 32 7310264 18663560 32586088 9 | 40 7406729 20569231 38322066 10 | 48 7815813 22393641 44333116 11 | 56 8162494 23829276 49723430 12 | 64 7553494 25315176 53714612 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-tl2.txt: -------------------------------------------------------------------------------- 1 | Threads tl2-RAVL-100% tl2-RAVL-10% tl2-RAVL-1% tl2-RAVL-0% 2 | 1 710751 699369 547891 484885 3 | 4 1803424 2259668 2029051 1831942 4 | 8 2509260 3759791 2266837 2647253 5 | 12 2853961 2509889 4741873 1999717 6 | 16 2507304 4199484 2177237 4696180 7 | 24 3037647 2571257 5920869 2897581 8 | 32 2502925 4358072 7944925 2788177 9 | 40 2020348 2811309 3050031 3260439 10 | 48 1798047 3160935 4005344 4070831 11 | 56 2173021 4140825 4646537 3697256 12 | 64 2954732 4536253 4824120 4078917 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-RAVL-100% TL2-Orig-RAVL-20% TL2-Orig-RAVL-0% 2 | 1 305701 509948 585967 3 | 4 1167902 1828234 2317420 4 | 8 1978739 3530023 4726143 5 | 12 2593671 5238060 6978150 6 | 16 3091360 6875665 9063324 7 | 24 3895650 9249458 13814025 8 | 32 4493671 11422424 17673673 9 | 40 4238819 12585087 19984450 10 | 48 4351364 13817854 21768873 11 | 56 4679298 14818749 23906497 12 | 64 5395156 15106797 25578402 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ravl-1m-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads tlrw_eager-RAVL-100% tlrw_eager-RAVL-10% tlrw_eager-RAVL-1% tlrw_eager-RAVL-0% 2 | 1 528458 600076 610734 606218 3 | 4 1663230 1632940 1637047 1648760 4 | 8 2381193 2392157 2402933 2874154 5 | 12 2884456 2810204 2806361 2664005 6 | 16 1345930 2306519 0 3115841 7 | 24 1071467 2148283 0 3034012 8 | 32 1023025 1894270 0 3574812 9 | 48 688846 1224080 0 4032315 10 | 11 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-SkipList-100% 2PLSF-SkipList-20% 2PLSF-SkipList-0% 2 | 1 479109 354824 412540 3 | 4 1685031 1267092 1632930 4 | 8 2462653 2533410 3094031 5 | 12 3037479 3694829 4630462 6 | 16 3228088 4850930 6051962 7 | 24 3246835 6864476 7947293 8 | 32 3162670 8697458 10557187 9 | 40 3115436 9509550 13370198 10 | 48 3095545 10142350 15158789 11 | 56 3192837 10709427 16299107 12 | 64 3105020 11303362 18055604 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-SkipList-100% 2PL-Undo-Dist-SkipList-20% 2PL-Undo-Dist-SkipList-0% 2 | 1 471481 354177 398148 3 | 4 1324105 1287120 1650930 4 | 8 1514946 1808306 3172338 5 | 12 1662470 2099116 4727766 6 | 16 1795816 2879971 6155732 7 | 24 1951828 2880859 8796021 8 | 32 2122222 3379311 10090155 9 | 40 2034780 4591193 12979933 10 | 48 2038927 3653804 15374003 11 | 56 2300952 3362382 16832769 12 | 64 2088213 4715415 18422978 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-SkipList-100% OneFileSTM-WF-SkipList-20% OneFileSTM-WF-SkipList-0% 2 | 1 666164 588945 587426 3 | 4 458118 1619486 2466772 4 | 8 364179 1470661 4632675 5 | 12 337228 1357171 7390708 6 | 16 328391 1317790 9330342 7 | 24 308357 1297466 12679868 8 | 32 298083 1259293 16963848 9 | 40 297192 1212806 20621917 10 | 48 283327 1200508 23782724 11 | 56 263334 1115211 26531302 12 | 64 227888 972428 29344566 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-SkipList-100% orec_eager-SkipList-20% orec_eager-SkipList-0% 2 | 1 451783 362861 321730 3 | 4 1090877 1258910 1225024 4 | 8 1283692 2084776 2053312 5 | 12 1419383 2490700 3060928 6 | 16 1448209 2750863 2636558 7 | 24 1467433 3056198 2669597 8 | 32 1511054 3582842 3660372 9 | 40 1206285 2711831 2619691 10 | 48 1004475 3041927 3850649 11 | 56 981976 3675389 4190034 12 | 64 552428 3705156 4210456 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-SkipList-100% TinySTM-SkipList-20% TinySTM-SkipList-0% 2 | 1 523653 518837 502158 3 | 4 1722077 1936101 2034547 4 | 8 2609514 3483657 3866746 5 | 12 3083079 5126598 5675454 6 | 16 3147071 6711925 7467450 7 | 24 3151301 9574918 11223154 8 | 32 3154190 11736889 14505445 9 | 40 3233901 13196576 17115832 10 | 48 3208459 14101068 19497993 11 | 56 3154379 14497514 22069759 12 | 64 3099821 14572520 23987817 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-SkipList-100% TL2-Orig-SkipList-20% TL2-Orig-SkipList-0% 2 | 1 135034 288580 237658 3 | 4 526018 0 714469 4 | 8 998073 0 1746900 5 | 12 1097064 0 2380009 6 | 16 1146485 0 2895201 7 | 24 1459669 0 3869556 8 | 32 1811156 0 4716627 9 | 40 2151554 0 4350215 10 | 48 2372606 0 4645379 11 | 56 2330047 0 4999734 12 | 64 2463856 0 5008874 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-skiplist-1m-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads tlrw_eager-SkipList-100% tlrw_eager-SkipList-20% tlrw_eager-SkipList-0% 2 | 1 332199 0 302712 3 | 4 1059411 0 881053 4 | 8 1479120 0 1327635 5 | 12 1915642 0 1924658 -------------------------------------------------------------------------------- /graphs/data/cervino/set-tree-1m-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-RedBlackTree-100% 2PLSF-RedBlackTree-20% 2PLSF-RedBlackTree-0% 2 | 1 164751 189528 979404 3 | 4 64208 112922 3904522 4 | 8 37128 98795 7317149 5 | 12 31068 92082 10815237 6 | 16 28640 84578 14547742 7 | 24 24072 79484 20957561 8 | 32 20573 72533 24228311 9 | 40 16000 58938 32320168 10 | 48 13392 54657 37033345 11 | 56 11144 49599 41026794 12 | 64 9348 47902 44702043 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-tree-1m-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-RedBlackTree-100% 2PL-Undo-Dist-RedBlackTree-20% 2PL-Undo-Dist-RedBlackTree-0% 2 | 1 166590 193828 999615 3 | 4 117924 142085 3915463 4 | 8 50034 71190 7166033 5 | 12 32335 59152 10858803 6 | 16 23151 45211 14277092 7 | 24 16562 53375 20413762 8 | 32 11806 44206 26134396 9 | 40 9625 30141 31094501 10 | 48 7567 31577 35985286 11 | 56 6792 22721 40129840 12 | 64 5477 19371 44696019 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-tree-1m-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-RedBlackTree-100% OneFileSTM-WF-RedBlackTree-20% OneFileSTM-WF-RedBlackTree-0% 2 | 1 67684 264783 1149608 3 | 4 57764 302560 4495812 4 | 8 42471 216404 8346812 5 | 12 36556 197635 12290157 6 | 16 35526 166545 16141289 7 | 24 29193 155394 24321256 8 | 32 30103 158205 31874215 9 | 40 30782 158807 38797107 10 | 48 32541 171474 45047221 11 | 56 37452 183863 51344180 12 | 64 32381 165759 58403441 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-tree-1m-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-RedBlackTree-100% TinySTM-RedBlackTree-20% TinySTM-RedBlackTree-0% 2 | 1 124211 393736 1024278 3 | 4 103177 420728 3879159 4 | 8 86942 412136 7548474 5 | 12 83164 389261 11397452 6 | 16 79745 385176 15180344 7 | 24 77142 362365 21192338 8 | 32 73068 341483 30075268 9 | 40 68135 314911 35424234 10 | 48 62997 296164 40245373 11 | 56 57628 273927 45365239 12 | 64 50513 244986 51090150 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-tree-1m-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-RedBlackTree-100% TL2-Orig-RedBlackTree-20% TL2-Orig-RedBlackTree-0% 2 | 1 8469 39250 574531 3 | 4 8359 39067 2288396 4 | 8 7860 37953 4415941 5 | 12 8170 38238 6865650 6 | 16 7958 37794 9030808 7 | 24 8071 38449 13501359 8 | 32 7849 38104 16910894 9 | 40 7796 37310 19273989 10 | 48 7647 36337 21596926 11 | 56 7142 35264 23198294 12 | 64 6723 32446 24916654 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-tree-1m-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads tlrw_eager-RedBlackTree-100% tlrw_eager-RedBlackTree-10% tlrw_eager-RedBlackTree-0% 2 | 1 92815 384753 616313 3 | 4 43105 396194 1689044 4 | 8 31524 244936 2253872 5 | 12 26693 250570 2402706 6 | 7 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PLSF-ZipTree-100% 2PLSF-ZipTree-20% 2PLSF-ZipTree-0% 2 | 1 528930 487059 611911 3 | 4 1979810 1865982 2379944 4 | 8 3031455 3290911 4477175 5 | 12 4049091 4591299 6947245 6 | 16 5056102 6108885 9029451 7 | 24 6744943 7961107 11843593 8 | 32 7372474 8755020 17436241 9 | 40 7470025 9988564 19812096 10 | 48 7998356 10528765 22816344 11 | 56 7981487 11056745 24245006 12 | 64 7931004 11299085 26700419 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-ZipTree-100% 2PL-Undo-Dist-ZipTree-20% 2PL-Undo-Dist-ZipTree-0% 2 | 1 497578 466707 560420 3 | 4 1456704 1853542 2174633 4 | 8 1618823 2524714 4443018 5 | 12 1731799 2664872 6536472 6 | 16 1941234 3593133 8768519 7 | 24 2252676 4339048 11390032 8 | 32 2350404 4796452 13702190 9 | 40 2280253 5862508 18612372 10 | 48 2492274 5798013 21268015 11 | 56 2211959 6365180 23048071 12 | 64 2124274 5737718 25464792 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-ZipTree-100% OneFileSTM-WF-ZipTree-20% OneFileSTM-WF-ZipTree-0% 2 | 1 640084 677377 755243 3 | 4 386289 1416399 2905556 4 | 8 302289 1244407 5548556 5 | 12 276714 1206292 8297548 6 | 16 269499 1204881 11002176 7 | 24 256695 1210003 16052833 8 | 32 254746 1196452 19774581 9 | 40 255036 1171459 24904543 10 | 48 242416 1102299 29298728 11 | 56 231819 1067124 33159617 12 | 64 208472 1009347 36755801 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-ZipTree-100% orec_eager-ZipTree-20% orec_eager-ZipTree-0% 2 | 1 348164 389059 351275 3 | 4 967942 1135632 1255425 4 | 8 1487522 2225680 2205099 5 | 12 1955891 2564954 3056037 6 | 16 2180335 2783074 2945443 7 | 24 2436531 3046814 3772564 8 | 32 2201217 2844238 5810996 9 | 40 1909759 2852958 2662705 10 | 48 1947167 3113180 3469800 11 | 56 2364197 4011087 3744071 12 | 64 2800732 3916230 4237448 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-ZipTree-100% TinySTM-ZipTree-20% TinySTM-ZipTree-0% 2 | 1 555592 709750 742129 3 | 4 1834837 2685120 2765709 4 | 8 3101052 4672439 5641120 5 | 12 4342595 6871316 8488028 6 | 16 5218082 9037697 11174074 7 | 24 5957486 12405590 16855462 8 | 32 6366286 14009724 22052841 9 | 40 6676460 15977942 24910844 10 | 48 7143675 18071705 27860481 11 | 56 7976428 19390487 30828191 12 | 64 7902299 20575447 32831513 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-ZipTree-100% TL2-Orig-ZipTree-20% TL2-Orig-ZipTree-0% 2 | 1 178860 295562 360124 3 | 4 693755 1118407 1431460 4 | 8 1260471 2250615 2921650 5 | 12 1824119 3314550 4355131 6 | 16 2354900 4405537 5789576 7 | 24 3051628 5947123 8353403 8 | 32 3670260 7363539 8619320 9 | 40 4014666 8976170 11647153 10 | 48 4203923 9758211 13383052 11 | 56 4266356 10415194 14052998 12 | 64 4355144 11116624 15207450 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/set-ziptree-1m-tlrweager.txt: -------------------------------------------------------------------------------- 1 | Threads tlrw_eager-ZipTree-100% tlrw_eager-ZipTree-20% tlrw_eager-ZipTree-0% 2 | 1 294011 336395 348157 3 | 4 977166 1052279 1062269 4 | 8 1395376 1439638 1433093 5 | 12 1705464 1714459 1944070 6 | 16 1569712 1867391 2243446 7 | 32 1655772 2449743 2283074 8 | 48 1894697 2438127 2733184 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/sps-integer-2plsf.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-SF-2 2PL-Undo-Dist-SF-32 2PL-Undo-Dist-SF-128 2 | 1 5658260 1020960 1029376 3 | 4 11662106 3618752 4098944 4 | 8 22107790 7114528 6864512 5 | 12 24186890 11949856 9561088 6 | 16 34875290 16349280 14800256 7 | 24 34668462 16179680 15502208 8 | 32 28208142 16179680 16726912 9 | 40 25734914 21485120 17147392 10 | 48 30084398 24385248 18983040 11 | 56 30646294 26252512 19682048 12 | 64 28741816 27153408 20186112 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/sps-integer-2plundodist.txt: -------------------------------------------------------------------------------- 1 | Threads 2PL-Undo-Dist-2 2PL-Undo-Dist-32 2PL-Undo-Dist-128 2 | 1 5445312 1035616 1069568 3 | 4 11432020 4308704 4115968 4 | 8 23453576 7377024 6774912 5 | 12 30983506 10886592 9461888 6 | 16 36642822 15236608 14174592 7 | 24 34600256 16157184 13073664 8 | 32 27749060 16533600 12567040 9 | 40 26337054 20547008 16422528 10 | 48 29983512 24697152 17558784 11 | 56 30812074 26339936 17271552 12 | 64 29472816 27391136 16955136 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/sps-integer-ofwf.txt: -------------------------------------------------------------------------------- 1 | Threads OneFileSTM-WF-2 OneFileSTM-WF-32 OneFileSTM-WF-128 2 | 1 4605918 4792256 5700224 3 | 4 1554056 1913952 2847616 4 | 8 1755588 1523840 1357184 5 | 12 1920212 1695360 1160064 6 | 16 2016112 1261024 1002752 7 | 24 2562596 1782368 877696 8 | 32 2327486 833312 1187456 9 | 40 2392172 906720 774272 10 | 48 2520754 1016352 879872 11 | 56 2497190 1301888 1092224 12 | 64 2255862 1552576 1176832 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/sps-integer-oreceager.txt: -------------------------------------------------------------------------------- 1 | Threads orec_eager-2 orec_eager-32 orec_eager-128 2 | 1 5172054 5416032 5324672 3 | 4 11166702 17878016 13134592 4 | 8 7809736 23864192 23037184 5 | 12 6979518 31682272 31305856 6 | 16 5853736 50949344 47188096 7 | 24 7143284 53909568 50606208 8 | 32 7102310 45669632 53844736 9 | 40 3614980 50272288 53754752 10 | 48 3599046 59575424 60026496 11 | 56 4729624 61201792 66192896 12 | 64 6335092 62555520 67616256 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/sps-integer-tiny.txt: -------------------------------------------------------------------------------- 1 | Threads TinySTM-2 TinySTM-32 TinySTM-128 2 | 1 6367806 7341856 7132288 3 | 4 17962952 20867680 25357312 4 | 8 13964064 41119808 34602496 5 | 12 13081636 75671520 59423360 6 | 16 12803382 68830720 59387648 7 | 24 18453618 80411904 69608960 8 | 32 28587126 82727136 76997504 9 | 40 15514324 91823328 76726144 10 | 48 15670062 103853472 87867776 11 | 56 17745224 123816736 96964224 12 | 64 19961142 142475584 103716736 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/sps-integer-tl2orig.txt: -------------------------------------------------------------------------------- 1 | Threads TL2-Orig-2 TL2-Orig-32 TL2-Orig-128 2 | 1 2110900 2606272 971648 3 | 4 7567568 10466912 3544576 4 | 8 10942054 18352864 6136704 5 | 12 11441596 26634240 8345088 6 | 16 12051610 35041472 10276864 7 | 24 12994398 50235040 12788352 8 | 32 14095714 59065312 13877632 9 | 40 15678046 68990784 16497408 10 | 48 15942088 80742208 17473024 11 | 56 18043206 89387232 18097664 12 | 64 19911546 98842976 18705280 13 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-high-2plsf.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.794862 2 | 4 385675 3.834564 3 | 8 775521 12.267507 4 | 16 1562991 51.084862 5 | 32 3144420 294.205758 6 | 48 4708046 753.836975 7 | 56 5506658 1160.138562 8 | 64 6278488 1594.516400 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-high-dl_detect.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.905264 2 | 4 396376 4.771880 3 | 8 779541 18.333104 4 | 16 1546364 202.398056 5 | 32 3111720 4251.999762 6 | 48 4597836 19700.685274 7 | 56 5290215 34581.936150 8 | 64 6035795 56662.520482 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-high-no_wait.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.893893 2 | 4 397555 8.514146 3 | 8 793268 25.963176 4 | 16 1572656 93.432475 5 | 32 3112921 369.327236 6 | 48 4720849 765.332445 7 | 56 5428780 1041.570330 8 | 64 6262202 1369.556430 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-high-tictoc.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.901244 2 | 4 362297 5.814178 3 | 8 774567 16.275314 4 | 16 1514450 44.717787 5 | 32 2728486 123.969822 6 | 48 4411993 244.152791 7 | 56 5240506 321.554967 8 | 64 6101456 408.989794 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-high-wait_die.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.919571 2 | 4 397164 4.367930 3 | 8 791557 15.180762 4 | 16 1580865 73.737511 5 | 32 3146157 493.762914 6 | 48 4690930 2624.533436 7 | 56 5454298 7183.772360 8 | 64 6262202 10000.0 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-low-2plsf.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.164319 2 | 4 381003 0.633734 3 | 8 786052 1.309471 4 | 16 1533936 2.700442 5 | 32 3092009 6.723203 6 | 48 4109505 12.758796 7 | 56 4905622 16.593704 8 | 64 5650847 20.012285 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-low-dl_detect.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.177972 2 | 4 396981 0.711318 3 | 8 789785 1.455866 4 | 16 1539444 3.062812 5 | 32 2926150 7.004551 6 | 48 4462024 14.534368 7 | 56 5033272 18.855299 8 | 64 5652448 24.061768 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-low-no_wait.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.175057 2 | 4 396538 0.715407 3 | 8 779068 1.441773 4 | 16 1552782 3.071959 5 | 32 3123233 7.451127 6 | 48 4447817 14.640326 7 | 56 4876565 19.621603 8 | 64 5677371 24.137020 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-low-tictoc.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.163560 2 | 4 383693 0.655619 3 | 8 787902 1.365953 4 | 16 1500036 2.835730 5 | 32 3114543 6.748309 6 | 48 4114235 14.109565 7 | 56 4826551 17.567176 8 | 64 5521239 22.024506 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-low-wait_die.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.183162 2 | 4 398373 0.749232 3 | 8 784470 1.538018 4 | 16 1526143 3.275686 5 | 32 3122255 7.545623 6 | 48 4579463 16.298374 7 | 56 4603747 19.869596 8 | 64 5790585 27.589806 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-med-2plsf.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.929108 2 | 4 382721 3.759611 3 | 8 787270 8.003545 4 | 16 1523752 18.095850 5 | 32 3110271 47.086020 6 | 48 4524598 114.661018 7 | 56 5212888 159.388947 8 | 64 6026856 220.356582 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-med-dl_detect.txt: -------------------------------------------------------------------------------- 1 | 1 100000 1.039540 2 | 4 397215 4.357476 3 | 8 747810 11.566345 4 | 16 1570688 20.516390 5 | 32 3041189 82.779491 6 | 48 4633853 281.709298 7 | 56 5427996 587.568508 8 | 64 6305578 1279.430578 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-med-no_wait.txt: -------------------------------------------------------------------------------- 1 | 1 100000 1.035772 2 | 4 395558 4.559886 3 | 8 782369 13.190926 4 | 16 1551459 24.432385 5 | 32 3093588 66.258552 6 | 48 4515420 133.753257 7 | 56 5188785 178.402500 8 | 64 6066897 231.226961 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-med-tictoc.txt: -------------------------------------------------------------------------------- 1 | 1 100000 0.992282 2 | 4 388941 4.046024 3 | 8 754736 8.863190 4 | 16 1543846 18.801306 5 | 32 3127155 44.083391 6 | 48 4452052 88.736473 7 | 56 5244393 114.256090 8 | 64 5993248 141.763544 9 | -------------------------------------------------------------------------------- /graphs/data/cervino/ycsb-med-wait_die.txt: -------------------------------------------------------------------------------- 1 | 1 100000 1.067274 2 | 4 396871 4.400158 3 | 8 773315 9.537589 4 | 16 1573743 19.317457 5 | 32 3125584 48.509393 6 | 48 4514571 114.213632 7 | 56 5189947 184.229084 8 | 64 5874742 337.550322 9 | -------------------------------------------------------------------------------- /graphs/plots/.gitignore: -------------------------------------------------------------------------------- 1 | /speed-of-light-maps-98u-10m-c5.24xlarge.pdf 2 | -------------------------------------------------------------------------------- /graphs/plots/caption.gp: -------------------------------------------------------------------------------- 1 | set term postscript color eps enhanced 22 2 | set output "caption.eps" 3 | 4 | set size 0.95,0.15 5 | 6 | load "styles.inc" 7 | 8 | unset tics 9 | unset border 10 | unset xlabel 11 | unset ylabel 12 | unset label 13 | 14 | set object 1 rectangle from screen 0.02,0.01 to screen 0.925,0.14 fillcolor rgb "white" dashtype (2,3) behind 15 | set label at screen 0.5,0.11 center "{/Helvetica-bold Legend for volatile memory} (all graphs of {\247}5.1)" 16 | 17 | set key at screen 0.9,0.07 samplen 1.5 maxrows 2 width 0.25 18 | plot [][0:1] \ 19 | 2 with linespoints title 'OF-LF' ls 1 lw 3 dt 1, \ 20 | 2 with linespoints title 'OF-WF' ls 2 lw 3 dt 1, \ 21 | 2 with linespoints title 'ESTM' ls 3 lw 3 dt (1,1), \ 22 | 2 with linespoints title 'Tiny' ls 5 lw 3 dt (1,1) 23 | -------------------------------------------------------------------------------- /graphs/plots/caption.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/caption.pdf -------------------------------------------------------------------------------- /graphs/plots/latency-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/latency-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/maps-98u-100k.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/maps-98u-100k.pdf -------------------------------------------------------------------------------- /graphs/plots/part-disjoint-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/part-disjoint-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/plot-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for i in \ 4 | set-ravl-1m-2pl.gp \ 5 | set-ll-1k-cervino.gp \ 6 | set-hash-10k-cervino.gp \ 7 | set-skiplist-1m-cervino.gp \ 8 | set-ziptree-1m-cervino.gp \ 9 | set-ravl-1m-cervino.gp \ 10 | maps-98u-100k.gp \ 11 | latency-cervino.gp \ 12 | ycsb-cervino.gp \ 13 | ; 14 | do 15 | echo "Processing:" $i 16 | gnuplot $i 17 | epstopdf `basename $i .gp`.eps 18 | rm `basename $i .gp`.eps 19 | done 20 | 21 | # set-btree-1m-cervino.gp \ 22 | # set-hash-10k-cervino.gp \ 23 | # set-ravl-1m-cervino.gp \ 24 | # set-skiplist-1m-cervino.gp \ 25 | # set-tree-1m-cervino.gp \ 26 | # set-ziptree-1m-cervino.gp \ 27 | # set-ll-1k-cervino.gp \ 28 | # latency-cervino.gp \ 29 | # ycsb-cervino.gp \ 30 | # sps-integer-cervino.gp \ 31 | # set-ravl-1m-2pl.gp \ 32 | # maps-98u-100k.gp \ 33 | # maps-100u-100k.gp \ 34 | # maps-98u-100k-c6a.48xlarge.gp \ 35 | # set-ravl-1m-c6a.48xlarge.gp \ 36 | -------------------------------------------------------------------------------- /graphs/plots/plot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while [ $# -gt 0 ] 4 | do 5 | echo "Processing:" $1 6 | gnuplot $1 7 | epstopdf `basename $1 .gp`.eps 8 | rm `basename $1 .gp`.eps 9 | open `basename $1 .gp`.pdf 10 | shift 11 | done 12 | -------------------------------------------------------------------------------- /graphs/plots/set-btree-1m-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-btree-1m-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/set-hash-10k-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-hash-10k-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/set-ll-1k-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-ll-1k-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/set-ravl-1m-2pl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-ravl-1m-2pl.pdf -------------------------------------------------------------------------------- /graphs/plots/set-ravl-1m-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-ravl-1m-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/set-skiplist-1m-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-skiplist-1m-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/set-tree-1m-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-tree-1m-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/set-ziptree-1m-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/set-ziptree-1m-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/sps-integer-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/sps-integer-cervino.pdf -------------------------------------------------------------------------------- /graphs/plots/styles.inc: -------------------------------------------------------------------------------- 1 | set pointsize 2 2 | 3 | # BLUE -> #0066CC (light: #0099FF - dark: #003366) 4 | # RED -> #993333 5 | # GREEN -> #669900 (light: #00CC66) 6 | # PURPLE -> #663399 7 | # ORANGE -> #CC6633 (light: #FFCC00) 8 | 9 | # TL2 Orig 10 | set style line 1 lt 1 lc rgb "#000000" lw 2 pt 4 ps 1.25 dt 1 11 | # TL2 Undo 12 | set style line 2 lt 1 lc rgb "#333333" lw 2 pt 7 ps 1.25 dt 1 13 | # TL2-Z or TinySTM 14 | set style line 3 lt 1 lc rgb "#663399" lw 2 pt 2 ps 1.25 dt 1 15 | # TLRW-Z 16 | set style line 4 lt 1 lc rgb "#663399" lw 2 pt 3 ps 1.25 dt 1 17 | # orec_eager-Z 18 | set style line 5 lt 1 lc rgb "#CC6633" lw 2 pt 1 ps 1.25 dt 1 19 | # orec_lazy-Z 20 | set style line 6 lt 1 lc rgb "#FFCC00" lw 2 pt 6 ps 1.25 dt 1 21 | # OFWF 22 | set style line 7 lt 1 lc rgb "#993333" lw 2 pt 5 ps 1.25 dt 1 23 | # 2PL Undo 24 | set style line 8 lt 1 lc rgb "#0033CC" lw 2 pt 11 ps 1.75 dt 1 25 | # 2PL Undo Dist 26 | set style line 9 lt 1 lc rgb "#0099FF" lw 2 pt 9 ps 1.75 dt 1 27 | # 2PL Undo Dist SF 28 | set style line 10 lt 1 lc rgb "#00CC66" lw 2 pt 13 ps 1.75 dt 1 29 | 30 | 31 | pat1 = 'fs solid 0.5 lc rgb "#FFCC00"' 32 | pat2 = 'fs solid 0.5 lc rgb "#00CC66"' 33 | pat3 = 'fs solid 0.7 lc rgb "#0066CC"' 34 | pat4 = 'fs solid 1.0 lc rgb "#993333"' 35 | pat5 = 'fs solid 1.0 lc rgb "#333333"' 36 | #pat5 = 'fs pattern 2 lc rgb "#0066CC"' 37 | #pat6 = 'fs pattern 6 lc rgb "#0066CC"' 38 | #pat5 = 'fs pattern 2 lc rgb "#000000"' 39 | #pat6 = 'fs pattern 6 lc rgb "#000000"' 40 | 41 | #pat1 = 'fs solid 0.0 lc rgb "#000000"' 42 | #pat2 = 'fs solid 0.3 lc rgb "#000000"' 43 | #pat3 = 'fs solid 0.65 lc rgb "#000000"' 44 | #pat4 = 'fs solid 1.0 lc rgb "#000000"' 45 | #pat5 = 'fs pattern 2 lc rgb "#000000"' 46 | #pat6 = 'fs pattern 6 lc rgb "#000000"' 47 | #pat7 = 'fs solid 0.5 lc rgb "#000000"' 48 | -------------------------------------------------------------------------------- /graphs/plots/ycsb-cervino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/graphs/plots/ycsb-cervino.pdf -------------------------------------------------------------------------------- /pdatastructures/README.md: -------------------------------------------------------------------------------- 1 | # Persistent Data Structures # 2 | 3 | This is a collection of transactional data structures 4 | 5 | -------------------------------------------------------------------------------- /pdatastructures/TMLinkedListQueue.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _TM_LINKED_LIST_QUEUE_H_ 2 | #define _TM_LINKED_LIST_QUEUE_H_ 3 | 4 | #include 5 | 6 | 7 | /** 8 | *

A Linked List queue (memory unbounded) for usage with STMs and PTMs

9 | * 10 | */ 11 | template class TMTYPE> 12 | class TMLinkedListQueue : public TM::tmbase { 13 | 14 | private: 15 | struct Node : public TM::tmbase { 16 | TMTYPE item; 17 | TMTYPE next {nullptr}; 18 | Node(T* userItem) : item{userItem} { } 19 | }; 20 | 21 | alignas(128) TMTYPE head {nullptr}; 22 | alignas(128) TMTYPE tail {nullptr}; 23 | 24 | 25 | public: 26 | TMLinkedListQueue() { 27 | TM::template updateTx([=] () { 28 | Node* sentinelNode = TM::template tmNew(nullptr); 29 | head = sentinelNode; 30 | tail = sentinelNode; 31 | return true; 32 | }); 33 | } 34 | 35 | 36 | ~TMLinkedListQueue() { 37 | TM::template updateTx([=] () { 38 | while (dequeue() != nullptr); // Drain the queue 39 | Node* lhead = head; 40 | TM::tmDelete(lhead); 41 | return true; 42 | }); 43 | } 44 | 45 | 46 | static std::string className() { return TM::className() + "-LinkedListQueue"; } 47 | 48 | 49 | bool enqueue(T* item) { 50 | return TM::template updateTx([=] () { 51 | Node* newNode = TM::template tmNew(item); 52 | tail->next = newNode; 53 | tail = newNode; 54 | return true; 55 | }); 56 | } 57 | 58 | 59 | T* dequeue() { 60 | return TM::template updateTx([=] () -> T* { 61 | Node* lhead = head; 62 | if (lhead == tail) return nullptr; 63 | head = lhead->next; 64 | TM::tmDelete(lhead); 65 | return head->item; 66 | }); 67 | } 68 | }; 69 | 70 | #endif /* _TM_LINKED_LIST_QUEUE_H_ */ 71 | -------------------------------------------------------------------------------- /pdatastructures/TMLinkedListQueueByRef.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _TM_LINKED_LIST_QUEUE_BY_REF_H_ 2 | #define _TM_LINKED_LIST_QUEUE_BY_REF_H_ 3 | 4 | #include 5 | 6 | 7 | /** 8 | *

A Linked List queue (memory unbounded) for usage with STMs and PTMs

9 | * 10 | */ 11 | template class TMTYPE> 12 | class TMLinkedListQueueByRef : public TM::tmbase { 13 | 14 | private: 15 | struct Node : public TM::tmbase { 16 | TMTYPE item; 17 | TMTYPE next {nullptr}; 18 | Node(T* userItem) : item{userItem} { } 19 | }; 20 | 21 | alignas(128) TMTYPE head {nullptr}; 22 | alignas(128) TMTYPE tail {nullptr}; 23 | 24 | 25 | public: 26 | TMLinkedListQueueByRef() { 27 | TM::template updateTx([&] () { 28 | Node* sentinelNode = TM::template tmNew(nullptr); 29 | head = sentinelNode; 30 | tail = sentinelNode; 31 | }); 32 | } 33 | 34 | 35 | ~TMLinkedListQueueByRef() { 36 | TM::template updateTx([&] () { 37 | while (dequeue() != nullptr); // Drain the queue 38 | Node* lhead = head; 39 | TM::tmDelete(lhead); 40 | }); 41 | } 42 | 43 | 44 | static std::string className() { return TM::className() + "-LinkedListQueue"; } 45 | 46 | 47 | bool enqueue(T* item) { 48 | bool retval = false; 49 | TM::template updateTx([&] () { 50 | Node* newNode = TM::template tmNew(item); 51 | tail->next = newNode; 52 | tail = newNode; 53 | retval = true; 54 | }); 55 | return retval; 56 | } 57 | 58 | 59 | T* dequeue() { 60 | T* retval = nullptr; 61 | TM::template updateTx([&] () { 62 | Node* lhead = head; 63 | if (lhead == tail) return; 64 | head = lhead->next; 65 | TM::tmDelete(lhead); 66 | retval = head->item; 67 | }); 68 | return retval; 69 | } 70 | }; 71 | 72 | #endif /* _TM_LINKED_LIST_QUEUE_BY_REF_H_ */ 73 | -------------------------------------------------------------------------------- /stms/tinystm/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2011 2 | Pascal Felber 3 | Patrick Marlier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /stms/tinystm/Makefile.clang: -------------------------------------------------------------------------------- 1 | # Debug/optimization flags (optimized by default) 2 | ifeq ($(CFG),debug) 3 | CFLAGS += -O0 -ggdb3 4 | else 5 | # For Link Time Optimization, it requires gold linker and clang compiled with --enable-gold 6 | # CFLAGS += -O4 7 | # LDFLAGS += -use-gold-plugin 8 | CFLAGS += -O3 9 | CFLAGS += -march=native 10 | endif 11 | 12 | # Enable all warnings but unsused functions and labels 13 | CFLAGS += -Wall 14 | CFLAGS += -Werror -Wno-unused-label -Wno-unused-function 15 | -------------------------------------------------------------------------------- /stms/tinystm/Makefile.common: -------------------------------------------------------------------------------- 1 | # Path to root directory 2 | ROOT ?= . 3 | 4 | # CC, LD and AR are builtin-variables of Make (?= is useless in this case) 5 | # To override these defines, you must use "make CC=cc" or change it here 6 | # Linker set by default to the CC definition 7 | LD = $(CC) 8 | # Other tools 9 | DOXYGEN ?= doxygen 10 | UNIFDEF ?= unifdef 11 | 12 | # Define global parameters 13 | TM = stm 14 | SRCDIR = $(ROOT)/src 15 | INCDIR = $(ROOT)/include 16 | LIBDIR = $(ROOT)/lib 17 | TMLIB = $(LIBDIR)/lib$(TM).a 18 | 19 | # Supposing all compilers has -I -L 20 | # TODO -I$(SRCDIR) only for library build 21 | CPPFLAGS += -I$(INCDIR) -I$(SRCDIR) 22 | 23 | # Disable assert for non-debug build 24 | ifneq ($(CFG),debug) 25 | CPPFLAGS += -DNDEBUG 26 | endif 27 | 28 | # TODO Should be only for test binaries 29 | LDFLAGS += -L$(LIBDIR) -l$(TM) 30 | 31 | # Only on linux / TODO make source compatible with non-pthread OS 32 | LDFLAGS += -lpthread 33 | 34 | # Solaris default memory allocator is quite slow, better use mtmalloc 35 | # LDFLAGS += -lmtmalloc 36 | 37 | # Disable additionnal checks from glibc (__longjmp_chk/__printf_chk) 38 | CPPFLAGS += -U_FORTIFY_SOURCE 39 | # CPPFLAGS += -D_FORTIFY_SOURCE=0 40 | # Enable multi-thread support in glibc 41 | CPPFLAGS += -D_REENTRANT 42 | 43 | # Rely on the definition of CC to determine the compiler 44 | # if the compiler is not detected correctly, use "gmake COMPILER=your_compiler" 45 | # Default: gcc 46 | COMPILER ?= $(CC) 47 | ifeq ($(COMPILER),icc) 48 | include $(ROOT)/Makefile.icc 49 | else 50 | ifeq ($(COMPILER),suncc) 51 | include $(ROOT)/Makefile.suncc 52 | else 53 | ifeq ($(COMPILER),xlc) 54 | else 55 | ifeq ($(COMPILER),llvm-gcc) 56 | else 57 | ifeq ($(COMPILER),clang) 58 | include $(ROOT)/Makefile.clang 59 | else 60 | include $(ROOT)/Makefile.gcc 61 | endif 62 | endif 63 | endif 64 | endif 65 | endif 66 | 67 | ######################################################################## 68 | # libatomic_ops path 69 | # LIBAO_HOME must be set to the path of libatomic_ops 70 | # (use the embedded light libatomic_ops if LIBAO_HOME is not defined) 71 | ######################################################################## 72 | ifndef LIBAO_HOME 73 | LIBAO_HOME = $(SRCDIR)/atomic_ops 74 | LIBAO_INC = $(LIBAO_HOME) 75 | else 76 | LIBAO_INC = $(LIBAO_HOME)/include 77 | endif 78 | CPPFLAGS += -I$(LIBAO_INC) 79 | -------------------------------------------------------------------------------- /stms/tinystm/Makefile.gcc: -------------------------------------------------------------------------------- 1 | # Debug/optimization flags (optimized by default) 2 | ifeq ($(CFG),debug) 3 | CFLAGS += -O0 -ggdb3 4 | else 5 | CFLAGS += -O2 6 | CFLAGS += -march=native 7 | endif 8 | 9 | # Disable strict aliasing 10 | # TODO: no-strict-aliasing removes some optimizations but seems required for correctness. need more investigation. 11 | CFLAGS += -fno-strict-aliasing 12 | # Disable stack smashing protector (__stack_chk_fail) 13 | CFLAGS += -fno-stack-protector 14 | # Enable all warnings but unsused functions and labels 15 | CFLAGS += -Wall -Wno-unused-function -Wno-unused-label 16 | # Enable extra warnings 17 | # CFLAGS += -Wextra 18 | # Link Time Optimization (LDFLAGS also requires optimization flags) 19 | # CFLAGS += -flto 20 | # LDFLAGS += $(CFLAGS) -fwhole-program -fuse-linker-plugin 21 | 22 | # Enable profiling mode 23 | # CFLAGS += -fprofile-generate 24 | # LDFLAGS += -fprofile-generate 25 | # Run typical program 26 | # Use the profiling information to compile 27 | # CFLAGS += -fprofile-use 28 | # LDFLAGS += -fprofile-use 29 | 30 | -------------------------------------------------------------------------------- /stms/tinystm/Makefile.icc: -------------------------------------------------------------------------------- 1 | # Intel compiler has a GCC compatibility mode 2 | 3 | # Debug/optimization flags (optimized by default) 4 | ifeq ($(CFG),debug) 5 | CFLAGS += -O0 -ggdb3 6 | else 7 | CFLAGS += -xHOST -O2 8 | endif 9 | 10 | # Full optimizations (IPO, O3, xHOST) 11 | # CFLAGS += -fast 12 | 13 | # Disable strict aliasing (remove some optimization but required for correctness? need more investigation) 14 | CFLAGS += -fno-strict-aliasing 15 | # Disable stack smashing protector (__stack_chk_fail) 16 | CFLAGS += -fno-stack-protector 17 | # Enable all warnings but unsused functions and labels 18 | CFLAGS += -Wall 19 | # Enable inlining information 20 | # CFLAGS += -Winline 21 | # Disable intel builtins like _intel_fast_memset 22 | # CFLAGS += -fno-builtin 23 | # Align functions on 16-bytes boundary 24 | # CFLAGS += -falign-functions=16 25 | 26 | # Enable profiling mode 27 | # CFLAGS += -prof-gen 28 | # LDFLAGS += -prof-gen 29 | # Run typical program 30 | # Use the profiled information to compile 31 | # CFLAGS += -prof-use 32 | # LDFLAGS += -prof-use 33 | 34 | -------------------------------------------------------------------------------- /stms/tinystm/Makefile.suncc: -------------------------------------------------------------------------------- 1 | # Debug/optimization flags (optimized by default) 2 | ifeq ($(CFG),debug) 3 | CFLAGS += -g 4 | else 5 | CFLAGS += -xO3 6 | CFLAGS += -native 7 | endif 8 | 9 | # Enable all optimizations 10 | # CFLAGS += -fast 11 | # Enable Inter-procedural optimization (LTO) 12 | # CFLAGS += -xipo=2 13 | # Enable profiling mode 14 | # CFLAGS += -xprofile=collect 15 | # Run typical program 16 | # Use the profiling information to compile 17 | # CFLAGS += -xprofile=use 18 | -------------------------------------------------------------------------------- /stms/tinystm/README.md: -------------------------------------------------------------------------------- 1 | TinySTM 2 | ======= 3 | 4 | OVERVIEW 5 | -------- 6 | 7 | TinySTM is a lightweight but efficient word-based STM implementation. 8 | This distribution includes three versions of TinySTM: write-back 9 | (updates are buffered until commit time), write-through (updates are 10 | directly written to memory), and commit-time locking (locks are only 11 | acquired upon commit). The version can be selected by editing the 12 | makefile, which documents all the different compilation options. 13 | 14 | TinySTM compiles and runs on 32 or 64-bit architectures. It was tested 15 | on various flavors of Unix, on Mac OS X, and on Windows using cygwin. 16 | It comes with a few test applications, notably a linked list, a skip 17 | list, and a red-black tree. 18 | 19 | 20 | INSTALLATION 21 | ------------ 22 | 23 | TinySTM requires the 'atomic\_ops' library, freely available from 24 | [www.hpl.hp.com](http://www.hpl.hp.com/research/linux/atomic_ops/). 25 | A stripped-down version of the library is included in the TinySTM 26 | distribution. If you wish to use another version, you must set the 27 | environment variable LIBAO\_HOME to the installation directory of 28 | 'atomic\_ops'. 29 | 30 | If your system does not support GCC thread-local storage, modify the 31 | TLS parameter in the 'Makefile' file. 32 | 33 | To compile TinySTM libraries, execute 'make' in the main directory. To 34 | compile test applications, execute 'make test'. To check the compiled 35 | library, execute 'make check'. 'make clean' will remove all compiled 36 | files. 37 | To compile the TinySTM GCC compatible library, execute 'make abi-gcc'. 38 | To compile test applications, execute 'make abi-gcc-test'. 39 | 40 | 41 | CONTACT 42 | ------- 43 | 44 | * E-mail : [tinystm@tinystm.org](mailto:tinystm@tinystm.org) 45 | * Web : [http://tinystm.org](http://tinystm.org) and 46 | [http://www.tmware.org](http://www.tmware.org) 47 | 48 | 49 | ACKNOWLEDGEMENT 50 | --------------- 51 | 52 | This library was supported by the European research consortium 53 | [VELOX](http://www.velox-project.eu). 54 | -------------------------------------------------------------------------------- /stms/tinystm/abi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: all gcc dtmc intel clean test check 3 | 4 | all: gcc dtmc intel 5 | 6 | gcc: 7 | $(MAKE) -C gcc 8 | 9 | gcc%: 10 | $(MAKE) -C gcc $(subst -, , $(subst gcc,,$@)) 11 | 12 | dtmc: 13 | $(MAKE) -C dtmc 14 | 15 | dtmc%: 16 | $(MAKE) -C dtmc $(subst -, , $(subst dtmc,,$@)) 17 | 18 | intel: 19 | $(MAKE) -C intel 20 | 21 | intel%: 22 | $(MAKE) -C intel $(subst -, , $(subst intel,,$@)) 23 | 24 | clean: 25 | $(MAKE) -C test clean 26 | $(MAKE) -C gcc clean 27 | $(MAKE) -C dtmc clean 28 | $(MAKE) -C intel clean 29 | 30 | # simple test and check that use explicit calls to gcc libitm library 31 | test: 32 | $(MAKE) -C test test 33 | 34 | check: 35 | $(MAKE) -C test check 36 | 37 | # test-all and check-all need TM compilers (INTEL/DTMC/GCC) in the path 38 | test-all: 39 | $(MAKE) -C gcc test 40 | $(MAKE) -C dtmc test 41 | $(MAKE) -C intel test 42 | 43 | check-all: 44 | $(MAKE) -C gcc check 45 | $(MAKE) -C dtmc check 46 | $(MAKE) -C intel check 47 | 48 | gcc/libitm.h: libitm.h.tpl.header libitm.h.tpl.unifdef libitm.h.tpl.cpp libitm.h.tpl.footer 49 | cat libitm.h.tpl.header > $@ 50 | unifdef -DTM_GCC -UTM_INTEL -UTM_DTMC libitm.h.tpl.unifdef >> $@ || true 51 | cat libitm.h.tpl.cpp >> $@ 52 | cat libitm.h.tpl.footer >> $@ 53 | sed -i 's/TX_ARGS //g' $@ 54 | sed -i 's/TX_ARG//g' $@ 55 | 56 | dtmc/libitm.h: libitm.h.tpl.header libitm.h.tpl.unifdef libitm.h.tpl.cpp libitm.h.tpl.footer 57 | cat libitm.h.tpl.header > $@ 58 | unifdef -UTM_GCC -UTM_INTEL -DTM_DTMC libitm.h.tpl.unifdef >> $@ || true 59 | cat libitm.h.tpl.cpp >> $@ 60 | cat libitm.h.tpl.footer >> $@ 61 | sed -i 's/TX_ARGS//g' $@ 62 | sed -i 's/TX_ARG//g' $@ 63 | 64 | intel/libitm.h: libitm.h.tpl.header libitm.h.tpl.unifdef libitm.h.tpl.cpp libitm.h.tpl.footer 65 | cat libitm.h.tpl.header > $@ 66 | unifdef -UTM_GCC -DTM_INTEL -UTM_DTMC libitm.h.tpl.unifdef >> $@ || true 67 | cat libitm.h.tpl.cpp >> $@ 68 | cat libitm.h.tpl.footer >> $@ 69 | sed -i 's/TX_ARGS/_ITM_transaction *,/g' $@ 70 | sed -i 's/TX_ARG/_ITM_transaction */g' $@ 71 | 72 | -------------------------------------------------------------------------------- /stms/tinystm/abi/dtmc/Makefile: -------------------------------------------------------------------------------- 1 | # Path to tinySTM 2 | ROOT = ../.. 3 | 4 | .PHONY: dtmc all clean check 5 | 6 | all: dtmc 7 | 8 | # ROOT must be defined to include Makefile.common 9 | include $(ROOT)/abi/Makefile.common 10 | 11 | ############################################################################## 12 | ## DTMC 13 | ############################################################################## 14 | LLVMCC ?= llvm-gcc 15 | LLVMLD ?= llvm-ld 16 | LLC ?= llc 17 | 18 | CPPFLAGS += -DTM_DTMC -I. 19 | 20 | # TODO find a way to avoid compiling not 21 | #LLVMCC_OK = $(shell $(LLVMCC) ; if [ $$? -neq 0 ] ; then echo "no differences" ; fi) 22 | #@$(echo) "TEST" 23 | #if [ $$? -eq 0 ] ; then echo "no differences" ; fi 24 | #$(shell echo $(LLVMCC_OK)) 25 | 26 | # -DNO_STACK_CHECK => shouldn't be used 27 | # TODO Add possibility to create 32 bits lib => llvm-ld needs -m32? 28 | # TODO find a good way to add dependencies abi.c tanger.c arch.S and also the lib (otherwise it will not be built or updated) 29 | #%.bc: ../%.c 30 | # $(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -emit-llvm -c -o $@ $< 31 | 32 | dtmc: dtmc-bc dtmc-static 33 | 34 | libtanger-stm.bc: ../abi.c tanger.c tanger.h 35 | $(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -emit-llvm -c -o abi.bc ../abi.c 36 | $(LLVMLD) -link-as-library -o $@ abi.bc 37 | 38 | arch.o: arch.S 39 | $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< 40 | 41 | dtmc-static: libtanger-stm.bc arch.o 42 | $(LLC) libtanger-stm.bc -o libtanger-stm.s 43 | $(CC) $(CPPFLAGS) $(CFLAGS) -c libtanger-stm.s -o libtanger-stm.o 44 | $(AR) cru libitm.a libtanger-stm.o arch.o 45 | 46 | dtmc-bc: libtanger-stm.bc arch.o 47 | $(AR) cru libtanger-stm.a arch.o 48 | 49 | ############################################################################## 50 | 51 | TANGERDIR ?= YOU_DID_NOT_SET_TANGERDIR 52 | LLVMBUILD ?= $(shell llvm-config --build-mode) 53 | ifeq ($(shell uname),Darwin) 54 | LIBTYPE ?= dylib 55 | else 56 | LIBTYPE ?= so 57 | endif 58 | #STMLIBDIR ?= $(TANGERDIR)/$(LLVMBUILD)/lib/ 59 | STMLIBDIR ?= . 60 | STMSUPPORTDIR ?= $(TANGERDIR)/$(LLVMBUILD)/lib/ 61 | TANGERPASS ?= $(TANGERDIR)/$(LLVMBUILD)/lib/libtanger.$(LIBTYPE) 62 | TMLINK ?= $(TANGERDIR)/$(LLVMBUILD)/bin/tmlink 63 | TMLINKFLAGS ?= -stmsupport=$(STMSUPPORTDIR) -stmlib=$(STMLIBDIR) 64 | LLVMCCFLAGS ?= --gnu-tm -emit-llvm 65 | 66 | TESTCC ?= $(LLVMCC) 67 | TESTCFLAGS += $(LLVMCCFLAGS) -DTM_DTMC 68 | 69 | TESTLD ?= $(TMLINK) 70 | TESTLDFLAGS := $(TMLINKFLAGS) $(TESTLDFLAGS) 71 | # TESTLDFLAGS += -static 72 | 73 | clean: intset-clean 74 | rm -f *.bc *.o libtanger-stm.bc libtanger-stm.a libitm.a libtanger-stm.s 75 | 76 | -------------------------------------------------------------------------------- /stms/tinystm/abi/dtmc/libtanger-stm.public-symbols: -------------------------------------------------------------------------------- 1 | main 2 | GTM_begin_transaction 3 | 4 | -------------------------------------------------------------------------------- /stms/tinystm/abi/dtmc/libtanger-stm.support: -------------------------------------------------------------------------------- 1 | ,1 2 | -------------------------------------------------------------------------------- /stms/tinystm/abi/dtmc/tanger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * tanger.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Tanger adapter for tinySTM. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #ifndef _TANGER_H_ 27 | # define _TANGER_H_ 28 | 29 | typedef struct { 30 | void *stack_addr; 31 | size_t stack_size; 32 | void *data; 33 | size_t data_size; 34 | } appstack_t; 35 | 36 | extern __thread appstack_t appstack; 37 | 38 | static inline void tanger_stm_save_stack() 39 | { 40 | // Is the data big enough? 41 | if (appstack.stack_size > appstack.data_size) { 42 | // TODO round to 4096+ 43 | appstack.data_size = appstack.stack_size; 44 | appstack.data = realloc(appstack.data, appstack.data_size); 45 | } 46 | __builtin_memcpy(appstack.data, appstack.stack_addr, appstack.stack_size); 47 | } 48 | 49 | static inline void tanger_stm_restore_stack() 50 | { 51 | __builtin_memcpy(appstack.stack_addr, appstack.data, appstack.stack_size); 52 | } 53 | 54 | static inline void tanger_stm_reset_stack() 55 | { 56 | appstack.stack_addr = NULL; 57 | } 58 | 59 | static inline void tanger_stm_free_stack() 60 | { 61 | if (appstack.data) { 62 | free(appstack.data); 63 | appstack.data = NULL; 64 | } 65 | } 66 | 67 | #endif /* _TANGER_H_ */ 68 | 69 | -------------------------------------------------------------------------------- /stms/tinystm/abi/dtmc/tm_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * tm_macros.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Defines macros for transactional operations. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #ifndef _TM_MACROS_H_ 27 | # define _TM_MACROS_H_ 28 | 29 | # define TM_START(id,ro) __tm_atomic { 30 | # define TM_LOAD(x) *x 31 | # define TM_STORE(x,y) *x=y 32 | # define TM_COMMIT } 33 | # define TM_MALLOC(size) malloc(size) 34 | # define TM_FREE(addr) free(addr) 35 | # define TM_FREE2(addr, size) free(addr) 36 | 37 | # define TM_INIT 38 | # define TM_EXIT 39 | # define TM_INIT_THREAD 40 | # define TM_EXIT_THREAD 41 | 42 | /* Define Annotations */ 43 | # define TM_PURE __attribute__((tm_pure)) 44 | # define TM_SAFE __attribute__((tm_callable)) 45 | 46 | /* FIXME to be removed when DTMC will support annotations */ 47 | static double tanger_wrapperpure_erand48(unsigned short int __xsubi[3]) __attribute__ ((weakref("erand48"))); 48 | 49 | #endif /* _TM_MACROS_H_ */ 50 | 51 | -------------------------------------------------------------------------------- /stms/tinystm/abi/gcc/Makefile: -------------------------------------------------------------------------------- 1 | # Path to TinySTM 2 | ROOT = ../.. 3 | 4 | .PHONY: gcc all clean check test 5 | 6 | all: gcc 7 | 8 | # ROOT must be defined to include Makefile.common 9 | include $(ROOT)/abi/Makefile.common 10 | 11 | 12 | ############################################################################## 13 | ## GCC 14 | ############################################################################## 15 | CPPFLAGS += -DTM_GCC -I. 16 | INCLUDES += $(wildcard ../../src/*.h) 17 | 18 | # NOTES 19 | # lib.map enables to export only some functions 20 | gcc: libitm.so libitm.a 21 | 22 | arch.o: arch.S 23 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 24 | 25 | %.do: ../%.c $(INCLUDES) 26 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 27 | 28 | %.o: ../%.c $(INCLUDES) 29 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 30 | 31 | %.s: ../%.c 32 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -fverbose-asm -S -o $@ $< 33 | 34 | libitm.a: abi.o arch.o 35 | $(AR) cru $@ $^ 36 | 37 | libitm.so: abi.do arch.o 38 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) -shared -Wl,--version-script,../lib.map -o $@ $^ 39 | # TODO Check if strip is really needed 40 | # strip $@ 41 | # cp libitm.so libitm.so.1 42 | # ln -s libitm.so libitm.so.1 43 | #TODO for FAT filesystem, ln doesn't work 44 | ############################################################################## 45 | 46 | TESTCC ?= $(CC) 47 | TESTCFLAGS += $(CPPFLAGS) $(CFLAGS) -DTM_GCC -fgnu-tm 48 | TESTLD ?= $(LD) 49 | TESTLDFLAGS += -Wl,-rpath=$(shell pwd) 50 | TESTLDFLAGS += -L$(ROOT)/abi/gcc 51 | TESTLDFLAGS += -static -litm 52 | 53 | clean: intset-clean 54 | rm -f *.o *.do libitm.a libitm.so 55 | 56 | -------------------------------------------------------------------------------- /stms/tinystm/abi/gcc/tm_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * tm_macros.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Defines macros for transactional operations. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | #ifndef _TM_MACROS_H_ 26 | # define _TM_MACROS_H_ 27 | 28 | # define TM_START(id,ro) __transaction_atomic { 29 | # define TM_LOAD(x) *x 30 | # define TM_STORE(x,y) *x=y 31 | # define TM_COMMIT } 32 | # define TM_MALLOC(size) malloc(size) 33 | // TODO is it possible to do TM_FREE(addr ...) free(addr) ? //__VA_ARGS__ 34 | # define TM_FREE(addr) free(addr) 35 | # define TM_FREE2(addr, size) free(addr) 36 | 37 | # define TM_INIT 38 | # define TM_EXIT 39 | # define TM_INIT_THREAD 40 | # define TM_EXIT_THREAD 41 | 42 | /* Define Annotations */ 43 | # define TM_PURE __attribute__((transaction_pure)) 44 | # define TM_SAFE __attribute__((transaction_safe)) 45 | 46 | #endif /* _TM_MACROS_H_ */ 47 | 48 | -------------------------------------------------------------------------------- /stms/tinystm/abi/intel/Makefile: -------------------------------------------------------------------------------- 1 | # Path to tinySTM 2 | ROOT = ../.. 3 | 4 | .PHONY: intel all clean check test 5 | 6 | all: intel 7 | 8 | # ROOT must be defined to include Makefile.common 9 | include $(ROOT)/abi/Makefile.common 10 | 11 | 12 | ############################################################################## 13 | ## INTEL 14 | ############################################################################## 15 | CPPFLAGS += -DTM_INTEL -I. 16 | 17 | # NOTES 18 | # Intel STM Compiler uses explicit transaction descriptor 19 | # Two ways to use: 20 | # - Compile STM application using libitm.a 21 | # - Compile STM application using Intel STM and change LD_LIBRARY_PATH to use tiny's libitmdyn.so 22 | # FIXME 23 | # .so version need minor modification to stm_tx_t structure (add vtable at 0x10) 24 | # intel/libitmdyn.so 25 | intel: libitm.a 26 | 27 | %.do: ../%.c 28 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 29 | 30 | %.o: ../%.c 31 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 32 | 33 | # TODO the dependency of arch_x86.S is not set 34 | arch.o: arch.S 35 | $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 36 | 37 | libitm.a: abi.o arch.o alloc.o 38 | $(AR) cru $@ $^ 39 | 40 | # TODO check the dynamic version (not really needed) 41 | arch.do: arch.S 42 | $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 43 | 44 | abi_dyn.o: abi.c 45 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 46 | 47 | libitmdyn.so: abi_dyn.o arch.do 48 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) -shared -Wl,--version-script,../lib.map -o $@ $^ 49 | ############################################################################## 50 | 51 | TESTCC ?= icc 52 | TESTCFLAGS += -Qtm_enabled -DTM_INTEL 53 | 54 | TESTLD ?= icc 55 | TESTLDFLAGS += -Qtm_enabled -litm -L. 56 | 57 | clean: intset-clean 58 | rm -f *.o *.do libitm.a libitmdyn.so 59 | 60 | -------------------------------------------------------------------------------- /stms/tinystm/abi/intel/alloc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mod_mem.h" 3 | 4 | /* TODO make inline calls */ 5 | 6 | void *malloc_txn(size_t size) __asm__("malloc._$TXN"); 7 | void *malloc_txn(size_t size) 8 | { 9 | return stm_malloc(size); 10 | } 11 | 12 | void *malloc_wraptxn(size_t size) __asm__("malloc._$WrapTXN"); 13 | void *malloc_wraptxn(size_t size) 14 | { 15 | __asm__ __volatile__("jmp 1f\nmov $0xf0f0f0f0,%eax\n1:"); 16 | return malloc_txn(size); 17 | } 18 | 19 | void *calloc_txn(size_t nmemb, size_t size) __asm__("calloc._$TXN"); 20 | void *calloc_txn(size_t nmemb, size_t size) 21 | { 22 | return stm_calloc(nmemb, size); 23 | } 24 | 25 | void *calloc_wraptxn(size_t nmemb, size_t size) __asm__("calloc._$WrapTXN"); 26 | void *calloc_wraptxn(size_t nmemb, size_t size) 27 | { 28 | __asm__ __volatile__("jmp 1f\nmov $0xf0f0f0f0,%eax\n1:"); 29 | return calloc_txn(nmemb, size); 30 | } 31 | 32 | void free_txn(void *addr) __asm__("free._$TXN"); 33 | void free_txn(void *addr) 34 | { 35 | stm_free(addr, sizeof(void *)); 36 | } 37 | 38 | void free_wraptxn(void *addr) __asm__("free._$WrapTXN"); 39 | void free_wraptxn(void *addr) 40 | { 41 | __asm__ __volatile__("jmp 1f\nmov $0xf0f0f0f0,%eax\n1:"); 42 | free_txn(addr); 43 | } 44 | 45 | #if 0 46 | /* TODO */ 47 | _mm_free._$TXN 48 | _mm_free._$WrapTXN 49 | _mm_malloc._$TXN 50 | _mm_malloc._$WrapTXN 51 | 52 | void* _mm_malloc (int size, int align) 53 | void _mm_free (void *p) 54 | 55 | _ZdaPv._$TXN 56 | _ZdaPv._$WrapTXN 57 | _ZdlPv._$TXN 58 | _ZdlPv._$WrapTXN 59 | _Znam._$TXN 60 | _Znam._$WrapTXN 61 | _Znwm._$TXN 62 | _Znwm._$WrapTXN 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /stms/tinystm/abi/intel/tm_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * tm_macros.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Defines macros for transactional operations. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #ifndef _TM_MACROS_H_ 27 | # define _TM_MACROS_H_ 28 | /* TODO check for exit() and perror() */ 29 | /* TODO check function pointer in rbtree */ 30 | /* 3.0 #define __INTEL_COMPILER_BUILD_DATE 20081204 */ 31 | /* 4.0 #define __INTEL_COMPILER_BUILD_DATE 20100806 */ 32 | # if __INTEL_COMPILER_BUILD_DATE < 20100806 33 | # define TM_START(id,ro) __tm_atomic { 34 | # else /* __INTEL_COMPILER_BUILD_DATE >= 20100806 */ 35 | # define TM_START(id,ro) __transaction [[atomic]] { 36 | # endif /* __INTEL_COMPILER_BUILD_DATE >= 20100806 */ 37 | # define TM_LOAD(x) *x 38 | # define TM_STORE(x,y) *x=y 39 | # define TM_COMMIT } 40 | # define TM_MALLOC(size) malloc(size) 41 | # define TM_FREE(addr) free(addr) 42 | # define TM_FREE2(addr, size) free(addr) 43 | 44 | # define TM_INIT 45 | # define TM_EXIT 46 | # define TM_INIT_THREAD 47 | # define TM_EXIT_THREAD 48 | 49 | /* Define Annotations */ 50 | # if __INTEL_COMPILER_BUILD_DATE < 20100806 51 | # define TM_PURE __attribute__((tm_pure)) 52 | # define TM_SAFE __attribute__((tm_callable)) 53 | # else /* __INTEL_COMPILER_BUILD_DATE >= 20100806 */ 54 | # define TM_PURE [[transaction_pure]] 55 | # define TM_SAFE [[transaction_safe]] 56 | 57 | /* error: non [[transaction_safe]] function "malloc" called inside [[transaction_safe]] routine */ 58 | TM_SAFE 59 | void *malloc(size_t); 60 | 61 | TM_SAFE 62 | void free(void *); 63 | 64 | # endif /* __INTEL_COMPILER_BUILD_DATE >= 20100806 */ 65 | 66 | #endif /* _TM_MACROS_H_ */ 67 | 68 | -------------------------------------------------------------------------------- /stms/tinystm/abi/libitm.h.tpl.footer: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __cplusplus 3 | } /* extern "C" */ 4 | #endif /* __cplusplus */ 5 | 6 | #endif /* _LIBITM_H_ */ 7 | 8 | -------------------------------------------------------------------------------- /stms/tinystm/abi/libitm.h.tpl.header: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * libitm.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * ABI for tinySTM. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #ifndef _LIBITM_H_ 27 | #define _LIBITM_H_ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif /* __cplusplus */ 32 | 33 | #include 34 | #include 35 | #ifdef __SSE__ 36 | # include 37 | #endif 38 | 39 | /* ################################################################### * 40 | * DEFINES 41 | * ################################################################### */ 42 | #define _ITM_VERSION_NO_STR "1.0.4" 43 | #define _ITM_VERSION_NO 104 44 | 45 | #if defined(__i386__) 46 | # define _ITM_CALL_CONVENTION __attribute__((regparm(2))) 47 | #else 48 | # define _ITM_CALL_CONVENTION 49 | #endif 50 | 51 | #define _ITM_noTransactionId 1 /* Id for non-transactional code. */ 52 | 53 | 54 | -------------------------------------------------------------------------------- /stms/tinystm/abi/oracle/Makefile: -------------------------------------------------------------------------------- 1 | # Path to TinySTM 2 | ROOT = ../.. 3 | 4 | .PHONY: oracletm all clean check test 5 | 6 | all: oracletm 7 | 8 | # ROOT must be defined to include Makefile.common 9 | include $(ROOT)/abi/Makefile.common 10 | 11 | 12 | ############################################################################## 13 | ## Oracle TM 14 | ############################################################################## 15 | CPPFLAGS += -DTM_ORACLE -I. 16 | 17 | oracletm: libitm.a 18 | 19 | arch.o: arch.S 20 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 21 | 22 | %.o: %.c 23 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 24 | 25 | %.s: %.c 26 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -fverbose-asm -S -o $@ $< 27 | 28 | libitm.a: otm.o arch.o 29 | $(AR) cru $@ $^ 30 | 31 | clean: 32 | rm -f *.o *.do libitm.a 33 | 34 | -------------------------------------------------------------------------------- /stms/tinystm/abi/pthread_wrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * pthread_wrapper.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Pthread wrapper to handle thread creation. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #include 27 | 28 | /* Original pthread function */ 29 | static int (*pthread_create_orig)(pthread_t *__restrict, 30 | __const pthread_attr_t *__restrict, 31 | void *(*)(void *), 32 | void *__restrict) = NULL; 33 | 34 | typedef struct { 35 | void * (*start_routine)(void *); 36 | void * arg; 37 | } wrapper_t; 38 | 39 | static void * wpthread_create(void * data) 40 | { 41 | void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine; 42 | void * arg = ((wrapper_t*)data)->arg; 43 | void * ret; 44 | /* Free the allocated memory by the wrapper */ 45 | free(data); 46 | /* Initialize thread */ 47 | _ITM_initializeThread(); 48 | /* Call user function */ 49 | ret = start_routine(arg); 50 | /* Finalizing thread */ 51 | _ITM_finalizeThread(); 52 | return ret; 53 | } 54 | 55 | int pthread_create(pthread_t *__restrict thread, 56 | __const pthread_attr_t *__restrict attr, 57 | void * (*start_routine)(void *), 58 | void *__restrict arg) 59 | { 60 | int i_return; 61 | /* Allocate memory to pass as argument (we can't assume that stack will not be modified) */ 62 | wrapper_t * wdata = malloc(sizeof(wrapper_t)); 63 | wdata->start_routine = start_routine; 64 | wdata->arg = arg; 65 | /* Solving link to original pthread_create */ 66 | if (pthread_create_orig == NULL) { 67 | pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create"); 68 | if (pthread_create_orig == NULL) { 69 | char *error = dlerror(); 70 | if (error == NULL) { 71 | error = "pthread_create can't be solved."; 72 | } 73 | fprintf(stderr, "%s\n", error); 74 | exit(EXIT_FAILURE); 75 | } 76 | } 77 | /* Call original pthread function */ 78 | i_return = pthread_create_orig(thread, attr, wpthread_create, wdata); 79 | return i_return; 80 | } 81 | -------------------------------------------------------------------------------- /stms/tinystm/abi/test/Makefile: -------------------------------------------------------------------------------- 1 | # Path to TinySTM 2 | ROOT = ../.. 3 | 4 | .PHONY: gcc all clean test check 5 | 6 | all: gcc 7 | 8 | # ROOT must be defined to include Makefile.common 9 | include $(ROOT)/abi/Makefile.common 10 | 11 | ############################################################################## 12 | ## GCC 13 | ############################################################################## 14 | # TODO Currently it is a copy of GCC-TM Makefile but I didn't find a best way 15 | # to do that until now 16 | CPPFLAGS += -DTM_GCC -I../gcc 17 | 18 | # NOTES 19 | # lib.map enables to export only some functions 20 | gcc: libitm.so libitm.a 21 | 22 | arch.o: ../gcc/arch.S 23 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 24 | 25 | %.do: ../%.c 26 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 27 | 28 | %.o: ../%.c 29 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEF_ABI) -c -o $@ $< 30 | 31 | libitm.a: abi.o arch.o 32 | $(AR) cru $@ $^ 33 | 34 | libitm.so: abi.do arch.o 35 | $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) -shared -Wl,--version-script,../lib.map -o $@ $^ 36 | # TODO Check if strip is really needed 37 | # strip $@ 38 | # cp libitm.so libitm.so.1 39 | # ln -s libitm.so libitm.so.1 40 | #TODO for FAT filesystem, ln doesn't work 41 | ############################################################################## 42 | 43 | TESTCC ?= gcc 44 | TESTCFLAGS += -Wall -O2 -march=native -DTM_ABI -I../gcc/ -DTLS 45 | TESTLD ?= gcc 46 | TESTLDFLAGS += -Wl,-rpath=$(shell pwd) 47 | TESTLDFLAGS += -L$(shell pwd) 48 | # TESTLDFLAGS += libitm.a 49 | # FIXME: see why big perf degradation with shared library 50 | TESTLDFLAGS += -litm 51 | 52 | clean: intset-clean 53 | rm -f *.o *.do libitm.a libitm.so 54 | 55 | -------------------------------------------------------------------------------- /stms/tinystm/include/mod_cb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * mod_cb.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Module for user callbacks. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | /** 27 | * @file 28 | * Module for user callbacks. 29 | * @author 30 | * Pascal Felber 31 | * Patrick Marlier 32 | * @date 33 | * 2007-2014 34 | */ 35 | 36 | #ifndef _MOD_CB_H_ 37 | # define _MOD_CB_H_ 38 | 39 | # include "stm.h" 40 | 41 | # ifdef __cplusplus 42 | extern "C" { 43 | # endif 44 | 45 | /** 46 | * Register an application-specific callback triggered when the current 47 | * transaction commits. The callback is automatically unregistered once 48 | * the transaction commits or aborts. If the transaction aborts, the 49 | * callback is never triggered. 50 | * 51 | * @param on_commit 52 | * Function called upon successful transaction commit. 53 | * @param arg 54 | * Parameter to be passed to the callback function. 55 | * @return 56 | * 1 if the callbacks have been successfully registered, 0 otherwise. 57 | */ 58 | int stm_on_commit(void (*on_commit)(void *arg), void *arg); 59 | 60 | /** 61 | * Register an application-specific callback triggered when the current 62 | * transaction aborts. The callback is automatically unregistered once 63 | * the transaction commits or aborts. If the transaction commits, the 64 | * callback is never triggered. 65 | * 66 | * @param on_abort 67 | * Function called upon transaction abort. 68 | * @param arg 69 | * Parameter to be passed to the callback function. 70 | * @return 71 | * 1 if the callbacks have been successfully registered, 0 otherwise. 72 | */ 73 | int stm_on_abort(void (*on_abort)(void *arg), void *arg); 74 | 75 | /** 76 | * Initialize the module. This function must be called once, from the 77 | * main thread, after initializing the STM library and before 78 | * performing any transactional operation. 79 | * 80 | */ 81 | void mod_cb_init(void); 82 | 83 | # ifdef __cplusplus 84 | } 85 | # endif 86 | 87 | #endif /* _MOD_CB_H_ */ 88 | -------------------------------------------------------------------------------- /stms/tinystm/include/mod_order.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * mod_order.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Module to force transactions to commit in order. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | /** 27 | * @file 28 | * Module to force transactions to commit in order. The first transaction that 29 | * starts will be the first one to commit. This module requires CM_MODULAR. 30 | * @author 31 | * Pascal Felber 32 | * Patrick Marlier 33 | * @date 34 | * 2007-2014 35 | */ 36 | 37 | #ifndef _MOD_PRINT_H_ 38 | # define _MOD_PRINT_H_ 39 | 40 | # ifdef __cplusplus 41 | extern "C" { 42 | # endif 43 | 44 | /** 45 | * Initialize the module. This function must be called once, from the 46 | * main thread, after initializing the STM library and before 47 | * performing any transactional operation. 48 | */ 49 | void mod_order_init(void); 50 | 51 | # ifdef __cplusplus 52 | } 53 | # endif 54 | 55 | #endif /* _MOD_PRINT_H_ */ 56 | -------------------------------------------------------------------------------- /stms/tinystm/include/mod_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * mod_print.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Module to test callbacks. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | /** 27 | * @file 28 | * Module to test callbacks. This module simply prints a message at 29 | * each invocation of a callback. 30 | * @author 31 | * Pascal Felber 32 | * Patrick Marlier 33 | * @date 34 | * 2007-2014 35 | */ 36 | 37 | #ifndef _MOD_PRINT_H_ 38 | # define _MOD_PRINT_H_ 39 | 40 | # ifdef __cplusplus 41 | extern "C" { 42 | # endif 43 | 44 | /** 45 | * Initialize the module. This function must be called once, from the 46 | * main thread, after initializing the STM library and before 47 | * performing any transactional operation. 48 | */ 49 | void mod_print_init(void); 50 | 51 | # ifdef __cplusplus 52 | } 53 | # endif 54 | 55 | #endif /* _MOD_PRINT_H_ */ 56 | -------------------------------------------------------------------------------- /stms/tinystm/lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /stms/tinystm/src/.gitignore: -------------------------------------------------------------------------------- 1 | /mod_ab.o 2 | /mod_cb_mem.o 3 | /mod_log.o 4 | /mod_order.o 5 | /mod_print.o 6 | /mod_stats.o 7 | /stm.o 8 | /wrappers.o 9 | -------------------------------------------------------------------------------- /stms/tinystm/src/atomic_ops/AUTHORS: -------------------------------------------------------------------------------- 1 | Originally written by Hans Boehm, with some platform-dependent code 2 | imported from the Boehm-Demers-Weiser GC, where it was contributed 3 | by many others. 4 | 5 | -------------------------------------------------------------------------------- /stms/tinystm/src/atomic_ops/README: -------------------------------------------------------------------------------- 1 | This directory contains a stripped-down (support only gcc) version of libatomic_ops by Hans Boehm. 2 | The official release is available from http://www.hpl.hp.com/research/linux/atomic_ops/. 3 | -------------------------------------------------------------------------------- /stms/tinystm/src/atomic_ops/aligned_atomic_load_store.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003 Hewlett-Packard Development Company, L.P. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | /* 24 | * Definitions for architectures on which loads and stores of AO_t are 25 | * atomic fo all legal alignments. 26 | */ 27 | 28 | AO_INLINE AO_t 29 | AO_load(const volatile AO_t *addr) 30 | { 31 | assert(((size_t)addr & (sizeof(AO_t) - 1)) == 0); 32 | /* Cast away the volatile for architectures where */ 33 | /* volatile adds barrier semantics. */ 34 | return *(AO_t *)addr; 35 | } 36 | 37 | #define AO_HAVE_load 38 | 39 | AO_INLINE void 40 | AO_store(volatile AO_t *addr, AO_t new_val) 41 | { 42 | assert(((size_t)addr & (sizeof(AO_t) - 1)) == 0); 43 | (*(AO_t *)addr) = new_val; 44 | } 45 | 46 | #define AO_HAVE_store 47 | -------------------------------------------------------------------------------- /stms/tinystm/src/atomic_ops/standard_ao_double_t.h: -------------------------------------------------------------------------------- 1 | /* NEC LE-IT: For 64Bit OS we extend the double type to hold two int64's 2 | * 3 | * x86-64: __m128 serves as placeholder which also requires the compiler 4 | * to align it on 16 byte boundary (as required by cmpxchg16. 5 | * Similar things could be done for PowerPC 64bit using a VMX data type... */ 6 | 7 | #if (defined(__x86_64__) && defined(__GNUC__)) || defined(_WIN64) 8 | # include 9 | typedef __m128 double_ptr_storage; 10 | #elif defined(_WIN32) && !defined(__GNUC__) 11 | typedef unsigned __int64 double_ptr_storage; 12 | #else 13 | typedef unsigned long long double_ptr_storage; 14 | #endif 15 | 16 | # define AO_HAVE_DOUBLE_PTR_STORAGE 17 | 18 | typedef union { 19 | double_ptr_storage AO_whole; 20 | struct {AO_t AO_v1; AO_t AO_v2;} AO_parts; 21 | } AO_double_t; 22 | 23 | #define AO_HAVE_double_t 24 | #define AO_val1 AO_parts.AO_v1 25 | #define AO_val2 AO_parts.AO_v2 26 | -------------------------------------------------------------------------------- /stms/tinystm/src/atomic_ops/test_and_set_t_is_ao_t.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004 Hewlett-Packard Development Company, L.P. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | /* 24 | * These are common definitions for architectures on which test_and_set 25 | * operates on pointer-sized quantities, the "clear" value contains 26 | * all zeroes, and the "set" value contains only one lowest bit set. 27 | * This can be used if test_and_set is synthesized from compare_and_swap. 28 | */ 29 | typedef enum {AO_TS_clear = 0, AO_TS_set = 1} AO_TS_val; 30 | #define AO_TS_VAL_t AO_TS_val 31 | #define AO_TS_CLEAR AO_TS_clear 32 | #define AO_TS_SET AO_TS_set 33 | 34 | #define AO_TS_t AO_t 35 | 36 | #define AO_AO_TS_T 1 37 | -------------------------------------------------------------------------------- /stms/tinystm/src/atomic_ops/test_and_set_t_is_char.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004 Hewlett-Packard Development Company, L.P. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | /* 24 | * These are common definitions for architectures on which test_and_set 25 | * operates on byte sized quantities, the "clear" value contains 26 | * all zeroes, and the "set" value contains all ones. 27 | */ 28 | 29 | #define AO_TS_t unsigned char 30 | typedef enum {AO_BYTE_TS_clear = 0, AO_BYTE_TS_set = 0xff} AO_BYTE_TS_val; 31 | #define AO_TS_VAL_t AO_BYTE_TS_val 32 | #define AO_TS_CLEAR AO_BYTE_TS_clear 33 | #define AO_TS_SET AO_BYTE_TS_set 34 | 35 | #define AO_CHAR_TS_T 1 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /stms/tinystm/src/gc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * gc.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Epoch-based garbage collector. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #ifndef _GC_H_ 27 | # define _GC_H_ 28 | 29 | # include 30 | # include 31 | 32 | # ifdef __cplusplus 33 | extern "C" { 34 | # endif 35 | 36 | typedef uintptr_t gc_word_t; 37 | 38 | void gc_init(gc_word_t (*epoch)(void)); 39 | void gc_exit(void); 40 | 41 | void gc_init_thread(void); 42 | void gc_exit_thread(void); 43 | 44 | void gc_set_epoch(gc_word_t epoch); 45 | 46 | void gc_free(void *addr, gc_word_t epoch); 47 | 48 | void gc_cleanup(void); 49 | 50 | void gc_cleanup_all(void); 51 | 52 | void gc_reset(void); 53 | 54 | # ifdef __cplusplus 55 | } 56 | # endif 57 | 58 | #endif /* _GC_H_ */ 59 | -------------------------------------------------------------------------------- /stms/tinystm/src/mod_print.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * mod_print.c 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Module to test callbacks. 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | 26 | #include "mod_print.h" 27 | 28 | #include "stm.h" 29 | 30 | /* 31 | * Called upon thread creation. 32 | */ 33 | static void mod_print_on_thread_init(void *arg) 34 | { 35 | printf("==> on_thread_init()\n"); 36 | fflush(NULL); 37 | } 38 | 39 | /* 40 | * Called upon thread deletion. 41 | */ 42 | static void mod_print_on_thread_exit(void *arg) 43 | { 44 | printf("==> on_thread_exit()\n"); 45 | fflush(NULL); 46 | } 47 | 48 | /* 49 | * Called upon transaction start. 50 | */ 51 | static void mod_print_on_start(void *arg) 52 | { 53 | printf("==> on_start()\n"); 54 | fflush(NULL); 55 | } 56 | 57 | /* 58 | * Called before transaction try to commit. 59 | */ 60 | static void mod_print_on_precommit(void *arg) 61 | { 62 | printf("==> on_precommit()\n"); 63 | fflush(NULL); 64 | } 65 | 66 | /* 67 | * Called upon transaction commit. 68 | */ 69 | static void mod_print_on_commit(void *arg) 70 | { 71 | printf("==> on_commit()\n"); 72 | fflush(NULL); 73 | } 74 | 75 | /* 76 | * Called upon transaction abort. 77 | */ 78 | static void mod_print_on_abort(void *arg) 79 | { 80 | printf("==> on_abort()\n"); 81 | fflush(NULL); 82 | } 83 | 84 | /* 85 | * Initialize module. 86 | */ 87 | void mod_print_init(void) 88 | { 89 | if (!stm_register(mod_print_on_thread_init, mod_print_on_thread_exit, mod_print_on_start, mod_print_on_precommit, mod_print_on_commit, mod_print_on_abort, NULL)) { 90 | fprintf(stderr, "Cannot register callbacks\n"); 91 | exit(1); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /stms/tinystm/test/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | TESTS = bank intset regression 4 | 5 | .PHONY: all $(TESTS) 6 | 7 | all: $(TESTS) 8 | 9 | check: all 10 | @echo Testing load/store \(regression/types\) 11 | @./regression/types 1>/dev/null 2>&1 12 | @echo Testing irrevocability \(regression/irrevocability\) 13 | @./regression/irrevocability 1>/dev/null 2>&1 14 | @echo Testing Linked List \(intset/intset-ll\) 15 | @./intset/intset-ll -d 2000 1>/dev/null 2>&1 16 | @echo Testing Linked List with concurrency \(intset/intset-ll -n 4\) 17 | @./intset/intset-ll -d 2000 -n 4 1>/dev/null 2>&1 18 | @echo Testing Red Black Tree \(intset/intset-rb\) 19 | @./intset/intset-rb -d 2000 1>/dev/null 2>&1 20 | @echo Testing Red Black Tree with concurrency \(intset/intset-rb -n 4\) 21 | @./intset/intset-rb -d 2000 -n 4 1>/dev/null 2>&1 22 | @echo Testing Skip List \(intset/intset-sl\) 23 | @./intset/intset-sl -d 2000 1>/dev/null 2>&1 24 | @echo Testing Skip List with concurrency \(intset/intset-sl -n 4\) 25 | @./intset/intset-sl -d 2000 -n 4 1>/dev/null 2>&1 26 | @echo Testing Hash Set \(intset/intset-hs\) 27 | @./intset/intset-hs -d 2000 1>/dev/null 2>&1 28 | @echo Testing Hash Set with concurrency \(intset/intset-hs -n 4\) 29 | @./intset/intset-hs -d 2000 -n 4 1>/dev/null 2>&1 30 | @echo All tests passed 31 | 32 | $(TESTS): 33 | $(MAKE) -C $@ $(TARGET) 34 | -------------------------------------------------------------------------------- /stms/tinystm/test/bank/.gitignore: -------------------------------------------------------------------------------- 1 | bank 2 | -------------------------------------------------------------------------------- /stms/tinystm/test/bank/Makefile: -------------------------------------------------------------------------------- 1 | ROOT = ../.. 2 | 3 | include $(ROOT)/Makefile.common 4 | 5 | BINS = bank 6 | 7 | .PHONY: all clean 8 | 9 | all: $(BINS) 10 | 11 | %.o: %.c 12 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $< 13 | 14 | $(BINS): %: %.o $(TMLIB) 15 | $(CC) -o $@ $< $(LDFLAGS) 16 | 17 | clean: 18 | rm -f $(BINS) *.o 19 | -------------------------------------------------------------------------------- /stms/tinystm/test/intset/.gitignore: -------------------------------------------------------------------------------- 1 | intset-ll 2 | intset-hs 3 | intset-sl 4 | intset-rb 5 | -------------------------------------------------------------------------------- /stms/tinystm/test/intset/Makefile: -------------------------------------------------------------------------------- 1 | ROOT ?= ../.. 2 | 3 | include $(ROOT)/Makefile.common 4 | 5 | BINS = intset-hs intset-ll intset-rb intset-sl 6 | 7 | UNAME := $(shell uname) 8 | ifeq ($(UNAME), SunOS) 9 | # Solaris requires rt lib for nanosleep 10 | LDFLAGS += -lrt 11 | endif 12 | 13 | .PHONY: all clean 14 | 15 | all: $(BINS) 16 | 17 | intset-hs.o: intset.c 18 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -DUSE_HASHSET -c -o $@ $< 19 | 20 | intset-ll.o: intset.c 21 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -DUSE_LINKEDLIST -c -o $@ $< 22 | 23 | intset-rb.o: intset.c rbtree.c rbtree.h 24 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -DUSE_RBTREE -c -o $@ $< 25 | 26 | intset-sl.o: intset.c 27 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -DUSE_SKIPLIST -c -o $@ $< 28 | 29 | # FIXME in case of ABI $(TMLIB) must be replaced to abi/... 30 | $(BINS): %: %.o $(TMLIB) 31 | $(LD) -o $@ $< $(LDFLAGS) 32 | 33 | clean: 34 | rm -f $(BINS) *.o 35 | -------------------------------------------------------------------------------- /stms/tinystm/test/intset/README.rbtree: -------------------------------------------------------------------------------- 1 | The red-black tree implementation (rbtree.c, rbtree.h, types.h) comes 2 | from the STAMP 0.9.10 distribution available from 3 | . Files have not been modified in any way 4 | besides enabling memory deallocation upon node release. 5 | -------------------------------------------------------------------------------- /stms/tinystm/test/intset/tm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: 3 | * tm.h 4 | * Author(s): 5 | * Pascal Felber 6 | * Patrick Marlier 7 | * Description: 8 | * Empty file (to avoid source modifications red-black tree). 9 | * 10 | * Copyright (c) 2007-2014. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License 14 | * as published by the Free Software Foundation, version 2 15 | * of the License. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This program has a dual license and can also be distributed 23 | * under the terms of the MIT license. 24 | */ 25 | -------------------------------------------------------------------------------- /stms/tinystm/test/regression/.gitignore: -------------------------------------------------------------------------------- 1 | irrevocability 2 | types 3 | -------------------------------------------------------------------------------- /stms/tinystm/test/regression/Makefile: -------------------------------------------------------------------------------- 1 | ROOT = ../.. 2 | 3 | include $(ROOT)/Makefile.common 4 | 5 | BINS = types irrevocability 6 | 7 | .PHONY: all clean 8 | 9 | all: $(BINS) 10 | 11 | %.o: %.c 12 | $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $< 13 | 14 | $(BINS): %: %.o $(TMLIB) 15 | $(CC) -o $@ $< $(LDFLAGS) 16 | 17 | clean: 18 | rm -f $(BINS) *.o 19 | -------------------------------------------------------------------------------- /stms/tl2-x86/LEGALNOTICE: -------------------------------------------------------------------------------- 1 | Sun Microsystems, Inc. has intellectual property rights relating to technology 2 | embodied in the product that is described in this document. In particular, and 3 | without limitation, these intellectual property rights may include one or more 4 | of the U.S. patents listed at http://www.sun.com/patents and one or more 5 | additional patents or pendi ng patent applications in the U.S. and in other 6 | countries. Use is subject to license terms. Sun, Sun Microsystems, the Sun 7 | logo, Java and Solaris are trademarks or registered trademarks of Sun 8 | Microsystems, Inc. in the U.S. and other countries. UNIX is a registered 9 | trademark in the U.S. and other countries, exclusively licensed through X/Open 10 | Company, Ltd. 11 | -------------------------------------------------------------------------------- /stms/tl2-x86/Makefile: -------------------------------------------------------------------------------- 1 | # ============================================================================== 2 | # 3 | # Makefile.real 4 | # 5 | # ============================================================================== 6 | 7 | 8 | # ============================================================================== 9 | # Variables 10 | # ============================================================================== 11 | 12 | CC := gcc-10 13 | CFLAGS := -g -Wall -Winline -O2 14 | #CFLAGS += -m32 15 | #CFLAGS += -DTL2_OPTIM_HASHLOG 16 | #CFLAGS += -DTL2_RESIZE_HASHLOG 17 | LD := gcc-10 18 | 19 | LIBTL2 := libtl2.a 20 | 21 | SRCS := \ 22 | tl2.c \ 23 | tmalloc.c \ 24 | # 25 | OBJS := ${SRCS:.c=.o} 26 | 27 | AR := ar 28 | RANLIB := ranlib 29 | 30 | RM := rm -f 31 | 32 | 33 | # ============================================================================== 34 | # Rules 35 | # ============================================================================== 36 | 37 | .PHONY: default 38 | default: lazy 39 | 40 | .PHONY: clean 41 | clean: 42 | $(RM) $(LIBTL2) $(OBJS) 43 | 44 | %.o: %.c 45 | $(CC) $(CFLAGS) -c $< -o $@ 46 | 47 | $(LIBTL2): $(OBJS) 48 | $(AR) cru $@ $^ 49 | $(RANLIB) $@ 50 | 51 | .PHONY: lazy 52 | lazy: $(LIBTL2) 53 | 54 | .PHONY: eager 55 | eager: CFLAGS += -DTL2_EAGER 56 | eager: $(LIBTL2) 57 | 58 | .PHONY: lazy-nocm 59 | lazy-nocm: CFLAGS += -DTL2_NOCM 60 | lazy-nocm: $(LIBTL2) 61 | 62 | .PHONY: eager-nocm 63 | eager-nocm: CFLAGS += -DTL2_EAGER 64 | eager-nocm: CFLAGS += -DTL2_NOCM 65 | eager-nocm: $(LIBTL2) 66 | 67 | .PHONY: otm 68 | otm: CFLAGS += -m32 69 | otm: $(LIBTL2) 70 | 71 | 72 | # ============================================================================== 73 | # Dependencies 74 | # ============================================================================== 75 | 76 | %.o: %.h 77 | 78 | 79 | # ============================================================================== 80 | # 81 | # End of Makefile.real 82 | # 83 | # ============================================================================== 84 | -------------------------------------------------------------------------------- /stms/tl2-x86/README: -------------------------------------------------------------------------------- 1 | _____ _ ____ ___ __ 2 | |_ _| | | |___ \ __ __ ( _ ) / /_ 3 | | | | | __) | _____ \ \/ / / _ \ | '_ \ 4 | | | | |___ / __/ |_____| > < | (_) | | (_) | 5 | |_| |_____| |_____| /_/\_\ \___/ \___/ 6 | 7 | 8 | http://stamp.stanford.edu 9 | 10 | 11 | Introduction 12 | ------------ 13 | 14 | TL2-x86 is a port of SUN's TL2 [1] that works on x86. For information on TL2 and 15 | how it works, please refer to RELEASENOTES. TL2-x86 was created by Chi Cao Minh 16 | (caominh@stanford.edu). 17 | 18 | 19 | Building STAMP with TL2-x86 20 | --------------------------- 21 | 22 | 1) In tl2-x86, build libtl2 using the command "make -f Makefile.real". 23 | 24 | 2) In STAMP/common/Defines.common.mk, edit the variable "STM" to point to tl2-x86. 25 | 26 | 3) Compile a STAMP benchmark using the command "make -f Makefile.stm". 27 | 28 | 29 | Platforms 30 | --------- 31 | 32 | TL2-x86 has been tested on Ubuntu 6, Ubuntu 7, Fedora Core 5, Fedora Core 6, 33 | CentOS 4, and CentOS 5, on both 32-bit i386 and 64-bit x86_64 architectures. 34 | 35 | 36 | References 37 | ---------- 38 | 39 | [1] D. Dice, O. Shalev, and N. Shavit. Transactional Locking II. In the 40 | Proceedings of the 20th International Symposium on Distributed Computing 41 | (DISC), Stockholm, Sweeden, Sept. 2006. 42 | -------------------------------------------------------------------------------- /stms/tl2-x86/VERSIONS: -------------------------------------------------------------------------------- 1 | 0.9.6 (8 Sept 2008) 2 | * Disabling local write barriers (STM_LOCAL_WRITE_*) in stm.h 3 | 4 | 0.9.5 (20 May 2008) 5 | * Support for OpenTM (opentm.stanford.edu) 6 | * Option to disable contention management (-DTL2_NOCM) 7 | * Fixed memory leak in TxFreeThread 8 | 9 | 0.9.4 (18 Mar 2008) 10 | * Option to build eager pessimistic version 11 | * Bug fixes: 12 | - Correctly do post-validation for TxLoad (Takayuki Usui) 13 | 14 | 0.9.3 (1 Dec 2007) 15 | * Restoring randomized backoff after abort 16 | * malloc/free redefinitions moved from STAMP/lib/tm.h to stm.h 17 | 18 | 0.9.2 (2 Oct 2007) 19 | * Fix compilation (mainly for g++) 20 | * Re-enable hashlog option 21 | 22 | 0.9.1 (1 Oct 2007) 23 | * 32/64 bit support 24 | * Reorganized code 25 | - Let compiler judge when to inline 26 | * Support for malloc/free within transactions 27 | * Remove hashlog option 28 | * Added some simple stats 29 | * Preliminary support for SPARC 30 | * Bug fixes: 31 | - Fix restoration of locally modified values (Mojtaba Mehrara) 32 | - Fix TrackLoad 33 | - Fix memory leaks 34 | - Fixes for TryFastUpdate and TxSterilize (Joao Lourenco & Goncalo Cunha) 35 | 36 | 0.9.0 (20 Apr 2007) 37 | * Initial release 38 | -------------------------------------------------------------------------------- /stms/tl2-x86/common.h: -------------------------------------------------------------------------------- 1 | /* ============================================================================= 2 | * 3 | * common.h 4 | * 5 | * Some common defines 6 | * 7 | * ============================================================================= 8 | */ 9 | 10 | 11 | #ifndef COMMON_H 12 | #define COMMON_H 1 13 | 14 | 15 | #define __INLINE__ static __inline__ 16 | #define __ATTR__ __attribute__((always_inline)) 17 | 18 | enum { 19 | NEVER = 0, 20 | ALWAYS = 1, 21 | }; 22 | 23 | 24 | #endif /* COMMON_H */ 25 | 26 | 27 | /* ============================================================================= 28 | * 29 | * End of common.h 30 | * 31 | * ============================================================================= 32 | */ 33 | -------------------------------------------------------------------------------- /stms/tl2-x86/libtl2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/stms/tl2-x86/libtl2.a -------------------------------------------------------------------------------- /stms/tl2-x86/platform.h: -------------------------------------------------------------------------------- 1 | /* ============================================================================= 2 | * 3 | * platform.h 4 | * 5 | * Platform-specific bindings 6 | * 7 | * ============================================================================= 8 | */ 9 | 10 | 11 | #ifndef PLATFORM_H 12 | #define PLATFORM_H 1 13 | 14 | 15 | #if defined(SPARC) || defined(__sparc__) 16 | # include "platform_sparc.h" 17 | #else /* !SPARC (i.e., x86) */ 18 | # include "platform_x86.h" 19 | #endif 20 | 21 | 22 | #define CAS(m,c,s) cas((intptr_t)(s),(intptr_t)(c),(intptr_t*)(m)) 23 | 24 | typedef unsigned long long TL2_TIMER_T; 25 | 26 | 27 | #endif /* PLATFORM_H */ 28 | 29 | 30 | /* ============================================================================= 31 | * 32 | * End of platform.h 33 | * 34 | * ============================================================================= 35 | */ 36 | -------------------------------------------------------------------------------- /stms/tl2-x86/tl2.h: -------------------------------------------------------------------------------- 1 | /* ============================================================================= 2 | * 3 | * tl2.h 4 | * 5 | * Transactional Locking 2 software transactional memory 6 | * 7 | * ============================================================================= 8 | * 9 | * Copyright (C) Sun Microsystems Inc., 2006. All Rights Reserved. 10 | * Authors: Dave Dice, Nir Shavit, Ori Shalev. 11 | * 12 | * TL2: Transactional Locking for Disjoint Access Parallelism 13 | * 14 | * Transactional Locking II, 15 | * Dave Dice, Ori Shalev, Nir Shavit 16 | * DISC 2006, Sept 2006, Stockholm, Sweden. 17 | * 18 | * ============================================================================= 19 | * 20 | * Modified by Chi Cao Minh (caominh@stanford.edu) 21 | * 22 | * See VERSIONS for revision history 23 | * 24 | * ============================================================================= 25 | */ 26 | 27 | #ifndef TL2_H 28 | #define TL2_H 1 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | #include 44 | #include "tmalloc.h" 45 | 46 | 47 | # include 48 | 49 | 50 | 51 | 52 | 53 | 54 | typedef struct _Thread Thread; 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | 61 | 62 | 63 | 64 | # include 65 | # define SIGSETJMP(env, savesigs) sigsetjmp(env, savesigs) 66 | # define SIGLONGJMP(env, val) siglongjmp(env, val); assert(0) 67 | 68 | 69 | 70 | /* 71 | * Prototypes 72 | */ 73 | 74 | 75 | 76 | 77 | void TxStart (Thread*, sigjmp_buf*, int*); 78 | 79 | Thread* TxNewThread (); 80 | 81 | 82 | 83 | 84 | 85 | void TxFreeThread (Thread*); 86 | void TxInitThread (Thread*, long id); 87 | int TxCommit (Thread*); 88 | void TxAbort (Thread*); 89 | intptr_t TxLoad (Thread*, volatile intptr_t*); 90 | void TxStore (Thread*, volatile intptr_t*, intptr_t); 91 | void TxStoreLocal (Thread*, volatile intptr_t*, intptr_t); 92 | void TxOnce (); 93 | void TxShutdown (); 94 | 95 | void* TxAlloc (Thread*, size_t); 96 | void TxFree (Thread*, void*); 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | 109 | #endif /* TL2_H */ 110 | 111 | 112 | /* ============================================================================= 113 | * 114 | * End of tl2.h 115 | * 116 | * ============================================================================= 117 | */ 118 | -------------------------------------------------------------------------------- /stms/tl2-x86/tl2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/stms/tl2-x86/tl2.o -------------------------------------------------------------------------------- /stms/tl2-x86/tmalloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pramalhe/2PLSF/738423b09f7d84363535905e20f708bd26e95f6f/stms/tl2-x86/tmalloc.o -------------------------------------------------------------------------------- /stms/zardoshti/api/constants.h: -------------------------------------------------------------------------------- 1 | /// constants.h provides some common values to use when instantiating TM 2 | /// algorithm templates. An instantiation of a TM algorithm is free to ignore 3 | /// these constants and choose others. These exist primarily to ensure that we 4 | /// have reasonable defaults that are shared across similar instantiations, 5 | /// without hard-coding constants into the instantiations themselves. 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// log_2 of the number of bytes protected by an orec 12 | const int OREC_COVERAGE = 4; 13 | 14 | /// Quiescence benefits from a limit on the number of threads. 4096 is safe 15 | const int MAX_THREADS = 4096; 16 | 17 | /// The number of orecs in the system 18 | const uint32_t NUM_STRIPES = 1048576; 19 | 20 | /// A low threshold for tuning backoff 21 | const uint32_t BACKOFF_MIN = 4; 22 | 23 | /// A high threshold for tuning backoff 24 | const uint32_t BACKOFF_MAX = 16; 25 | 26 | /// A threshold for the number of consecutive aborts before a transaction should 27 | /// become irrevocable. 28 | const uint32_t ABORTS_THRESHOLD = 100; 29 | 30 | /// A threshold for the number of mallocs in a transaction before it should 31 | /// become irrevocable 32 | const uint32_t MALLOC_THRESHOLD = 128; 33 | 34 | /// Our default bytelock implementation constrains to one cache line, with an 35 | /// 8-byte owner field, leaving 56 slots for readers 36 | const int BYTELOCK_MAX_THREADS = 56; 37 | 38 | /// Below are four tuning parameters for TLRW, which seem to provide 39 | /// satisfactory performance in the common case. The second best configuration 40 | /// for most of the applications we studied was (8, 2048, 2, 512) 41 | 42 | /// TLRW deadlock avoidance: times to try reading 43 | const int32_t TLRW_READ_TRIES = 2; 44 | 45 | /// TLRW deadlock avoidance: spin between read attempts 46 | const int32_t TLRW_READ_SPINS = 512; 47 | 48 | /// TLRW deadlock avoidance: times to try writing 49 | const int32_t TLRW_WRITE_TRIES = 8; 50 | 51 | /// TLRW deadlock avoidance: spin between write attempts 52 | const int32_t TLRW_WRITE_SPINS = 2048; 53 | 54 | /// Number of times an HTM transaction aborts before switching to serial 55 | const int32_t NUM_HTM_RETRIES = 8; 56 | 57 | /// RingSTM Ring Size: number of filters in the ring 58 | const int32_t RING_SIZE = 1024; 59 | 60 | /// RingSTM: Number of bits in a filter 61 | const int32_t RING_FILTER_SIZE = 1024; 62 | 63 | /// RingSTM: Granularity of regions that map to ring bits 64 | const int32_t RING_COVERAGE = 5; 65 | 66 | /// Reduced Hardware NOrec: how many postfix fails before fallback to STM 67 | const int32_t NUM_POSTFIX_RETRIES = 8; -------------------------------------------------------------------------------- /stms/zardoshti/common/bytelock_t.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /// BytelockTable is a table of bytelocks, for TLRW-style algorithms. Unlike 6 | /// the published TLRW, our BytelockTable does not allow an unlimited number of 7 | /// threads (albeit via two classes of readers), but instead enforces a fixed 8 | /// maximum number of threads, based on the number of dedicated slots in each 9 | /// bytelock. 10 | template class BytelockTable { 11 | public: 12 | /// bytelock_t is a simplified version of the TLRW bytelock. It consists of a 13 | /// word for storing the ID of the writer (if any) and a byte per visible 14 | /// reader, which stores a 1 or 0 depending on whether the corresponding 15 | /// thread is a reader or not. 16 | /// 17 | /// In the original TLRW, bytelocks had an overflow counter for supporting 18 | /// additional threads. Another option is to have more slots. In our 19 | /// implementation, every reader is slotted, and a template instantiation 20 | /// decides on the maximum number of readers. 21 | /// 22 | /// Note that we leave low-level use of the bytelock up to the TM algorithm. 23 | /// There is no "acquire_for_read" or "release" function in this file. 24 | struct bytelock_t { 25 | /// The thread who owns the bytelock 26 | std::atomic owner; 27 | 28 | /// The slots for readers 29 | std::atomic readers[THREADS]; 30 | }; 31 | 32 | private: 33 | /// The bytelock table 34 | bytelock_t bytelocks[NUM_BYTELOCKS]; 35 | 36 | public: 37 | /// Given an address, return a pointer to the corresponding bytelock table 38 | /// entry 39 | bytelock_t *get(void *addr) { 40 | return &bytelocks[(reinterpret_cast(addr) >> COVERAGE) % 41 | NUM_BYTELOCKS]; 42 | } 43 | 44 | /// Terminate the program if we have more threads than we have available slots 45 | void validate_id(int id) { 46 | if (id >= THREADS) 47 | std::terminate(); 48 | } 49 | }; -------------------------------------------------------------------------------- /stms/zardoshti/common/deferred.h: -------------------------------------------------------------------------------- 1 | /// deferred.h provides support for registering "on commit" handlers, which run 2 | /// after a transaction completes. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include "../../zardoshti/common/minivector.h" 10 | 11 | /// The DeferredActionHandler stores a list of actions to perform, and when a 12 | /// transaction commits, it performs those actions in the order they were 13 | /// registered. 14 | class DeferredActionHandler { 15 | /// a list of all actions to perform upon transaction commit 16 | MiniVector> actions; 17 | 18 | public: 19 | /// Register a function to run after the transaction commits 20 | void registerHandler(void (*func)(void *), void *args) { 21 | actions.push_back({func, args}); 22 | } 23 | 24 | /// Execute all deferred actions upon transaction commit, and then clear the 25 | /// list of actions 26 | void onCommit() { 27 | for (auto i : actions) { 28 | i.first(i.second); 29 | } 30 | actions.clear(); 31 | } 32 | 33 | /// Clear the list of pending actions when a transaction aborts 34 | void onAbort() { actions.clear(); } 35 | }; -------------------------------------------------------------------------------- /stms/zardoshti/common/minivector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | /// MiniVector is a self-growing array, like std::vector, but with less overhead 8 | template class MiniVector { 9 | /// The maximum number of things this MiniVector can store without triggering 10 | /// a resize 11 | unsigned long capacity; 12 | 13 | /// The number of items currently stored in the MiniVector 14 | unsigned long count; 15 | 16 | /// Storage for the items in the array 17 | T *items; 18 | 19 | /// Resize the array of items, and move current data into it 20 | void expand() { 21 | T *temp = items; 22 | capacity *= 2; 23 | items = static_cast(malloc(sizeof(T) * capacity)); 24 | memcpy(items, temp, sizeof(T) * count); 25 | free(temp); 26 | } 27 | 28 | public: 29 | /// Construct an empty MiniVector with a default capacity 30 | MiniVector(const unsigned long _capacity = 64) 31 | : capacity(_capacity), count(0), 32 | items(static_cast(malloc(sizeof(T) * capacity))) {} 33 | 34 | /// Reclaim memory when the MiniVector is destructed 35 | ~MiniVector() { free(items); } 36 | 37 | /// We assume that T does not have a destructor, and thus we can fast-clear 38 | /// the MiniVector 39 | void clear() { count = 0; } 40 | 41 | /// Return whether the MiniVector is empty or not 42 | bool empty() { return count == 0; } 43 | 44 | /// MiniVector insert 45 | /// 46 | /// We maintain the invariant that when insert() returns, there is always room 47 | /// for one more element to be added. This means we may expand() after 48 | /// insertion, but doing so is rare. 49 | void push_back(T data) { 50 | items[count++] = data; 51 | 52 | // If the list is full, double it 53 | if (count == capacity) 54 | expand(); 55 | } 56 | 57 | /// Getter to report the array size (to test for empty) 58 | unsigned long size() const { return count; } 59 | 60 | /// MiniVector's iterator is just a T* 61 | typedef T *iterator; 62 | 63 | /// Get an iterator to the start of the array 64 | iterator begin() const { return items; } 65 | 66 | /// Get an iterator to one past the end of the array 67 | iterator end() const { return items + count; } 68 | 69 | /// MiniVector's reverse iteration is based on std::reverse_iterator, because 70 | /// this is not performance-critical 71 | typedef std::reverse_iterator reverse_iterator; 72 | 73 | /// Get the starting point for a reverse iterator 74 | reverse_iterator rbegin() { return reverse_iterator(end()); } 75 | 76 | /// Get the ending point for a reverse iterator 77 | reverse_iterator rend() { return reverse_iterator(begin()); } 78 | }; -------------------------------------------------------------------------------- /stms/zardoshti/common/orec_t.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "../../zardoshti/common/pad_word.h" 6 | #include "../../zardoshti/common/timesource.h" 7 | 8 | /// local_orec_t is a way of looking at a 64-bit int and telling if it indicates 9 | /// a lock or a version number. Set 'all' by copying from an atomic 10 | /// 11 | /// Warning: this is only good for little endian (e.g., x86) 12 | union local_orec_t { 13 | struct { 14 | uintptr_t id : (8 * sizeof(uintptr_t)) - 1; 15 | uintptr_t lock : 1; 16 | } fields; 17 | uintptr_t all; 18 | }; 19 | 20 | /// The ownership record type is used by orec-based STMs to protect regions of 21 | /// memory. 22 | struct orec_t { 23 | /// curr is either a lock word, or a version number 24 | std::atomic curr; 25 | 26 | /// When a thread acquires the orec, it can store the previous version number 27 | /// in prev, so that it can use it to clean up in the case of aborts. 28 | uintptr_t prev; 29 | }; 30 | 31 | /// OrecTable is a table of orecs, and a timestamp. It is useful in TM 32 | /// algorithms that use a global "clock" to determine the non-locked values of 33 | /// orecs. 34 | template class OrecTable { 35 | /// The orec table 36 | orec_t orecs[NUM_ORECS]; 37 | 38 | public: 39 | typedef typename TIMESOURCE::time_snapshot_t time_snapshot_t; 40 | 41 | /// The global timestamp, for assigning commit orders and reducing 42 | /// validation 43 | TIMESOURCE timestamp; 44 | 45 | /// Map addresses to orec table entries 46 | orec_t *get(void *addr) { 47 | return &orecs[(reinterpret_cast(addr) >> COVERAGE) % NUM_ORECS]; 48 | } 49 | 50 | /// Get the current value of the clock 51 | uintptr_t get_time() { return timestamp.get_time(); } 52 | 53 | /// Get the current value of the clock. This version implies some stronger 54 | /// fencing behavior than the regular get_time. 55 | uintptr_t get_time_strong_ordering() { 56 | return timestamp.get_time_strong_ordering(); 57 | } 58 | 59 | /// Increment the clock, and return the value it was incremented *to* 60 | uint64_t increment_get() { return timestamp.increment_get(); } 61 | 62 | /// Increment the clock, and ignore the new value. This is useful when doing 63 | /// abort-time bumping in undo-based STM. 64 | void increment() { timestamp.increment(); } 65 | 66 | /// Create a locked orec from an id, so that a thread knows what value to use 67 | /// as its lock word 68 | static uintptr_t make_lockword(int id) { 69 | local_orec_t tmp; 70 | tmp.all = id; 71 | tmp.fields.lock = 1; 72 | return tmp.all; 73 | } 74 | }; -------------------------------------------------------------------------------- /stms/zardoshti/common/pad_word.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "../../zardoshti/common/platform.h" 6 | 7 | /// pad_word_t is an atomic uintptr_t that is padded out to a cache line 8 | struct pad_word_t { 9 | /// The value 10 | std::atomic val; 11 | 12 | /// Some padding 13 | char pad[CACHELINE_BYTES - sizeof(uintptr_t)]; 14 | 15 | /// Construct by zeroing the value 16 | pad_word_t() { val = 0; } 17 | }; 18 | 19 | /// pad_dword_t is an atomic uintptr_t that is padded out to two cache lines 20 | struct pad_dword_t { 21 | /// The value 22 | std::atomic val; 23 | 24 | /// Some padding 25 | char pad[2 * CACHELINE_BYTES - sizeof(uintptr_t)]; 26 | 27 | /// Construct by zeroing the value 28 | pad_dword_t() { val = 0; } 29 | }; -------------------------------------------------------------------------------- /stms/zardoshti/common/platform.h: -------------------------------------------------------------------------------- 1 | /// platform.h provides some platform details and platform-specific functions, 2 | /// so that we can avoid inline assembly or platform-specific code in our 3 | /// implementations 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | /// A constant to help us with padding things to a cache line. 11 | const int CACHELINE_BYTES = 64; 12 | 13 | /// Yield the CPU 14 | inline void yield_cpu() { pthread_yield(); } 15 | 16 | /// The cheapest Linux clock with good enough resolution to manage backoff 17 | inline uint64_t getElapsedTime() { 18 | struct timespec t; 19 | clock_gettime(CLOCK_REALTIME, &t); 20 | return (((long long)t.tv_sec) * 1000000000L) + ((long long)t.tv_nsec); 21 | } 22 | 23 | /// Spin briefly 24 | void spin64() { 25 | for (int i = 0; i < 64; ++i) 26 | __asm__ volatile("nop"); 27 | } 28 | 29 | /// Spin for a user-specified number of instructions 30 | void spinX(int x) { 31 | for (int i = 0; i < x; ++i) 32 | __asm__ volatile("nop"); 33 | } 34 | 35 | /// use rdtscp for high-precision tick counter with pipeline stall 36 | inline uint64_t tickp() { 37 | uint32_t tmp[2]; 38 | asm volatile("rdtscp" : "=a"(tmp[1]), "=d"(tmp[0]) : "c"(0x10) : "memory"); 39 | return (((uint64_t)tmp[0]) << 32) | tmp[1]; 40 | } 41 | 42 | /// Produce a random number using a simple PRNG 43 | inline int rand_r_32(unsigned int *seed) { 44 | unsigned int next = *seed; 45 | int result; 46 | 47 | next *= 1103515245; 48 | next += 12345; 49 | result = (unsigned int)(next / 65536) % 2048; 50 | 51 | next *= 1103515245; 52 | next += 12345; 53 | result <<= 10; 54 | result ^= (unsigned int)(next / 65536) % 1024; 55 | 56 | next *= 1103515245; 57 | next += 12345; 58 | result <<= 10; 59 | result ^= (unsigned int)(next / 65536) % 1024; 60 | 61 | *seed = next; 62 | return result; 63 | } 64 | 65 | /// Perform randomized exponential backoff. We wait for a random number of CPU 66 | /// ticks, so that preemption during backoff is handled cleanly 67 | void exp_backoff(uint32_t consec_aborts, uint32_t &seed, uint32_t MIN, 68 | uint32_t MAX) { 69 | // how many bits should we use to pick an amount of time to wait? 70 | uint32_t bits = consec_aborts + MIN - 1; 71 | bits = (bits > MAX) ? MAX : bits; 72 | // get a random amount of time to wait, bounded by an exponentially 73 | // increasing limit 74 | int32_t delay = rand_r_32(&seed); 75 | delay &= ((1 << bits) - 1); 76 | // wait until at least that many ns have passed 77 | // unsigned long long start = getElapsedTime(); 78 | unsigned long long start = tickp(); 79 | unsigned long long stop_at = start + delay; 80 | while (tickp() < stop_at) { 81 | spin64(); 82 | } 83 | } -------------------------------------------------------------------------------- /stms/zardoshti/common/timesource.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include 6 | 7 | #include "../../zardoshti/common/orec_t.h" 8 | 9 | /// CounterTimesource uses a monotonically increasing shared memory counter as 10 | /// the timesource 11 | class CounterTimesource { 12 | /// The value of the global clock when this transaction started/validated 13 | pad_dword_t timestamp; 14 | 15 | public: 16 | typedef uint64_t time_snapshot_t; 17 | 18 | /// Runs the orec_t.h implemntation to get the current time 19 | uint64_t get_time() { return timestamp.val; } 20 | 21 | /// get_time_strong_ordering is the same for CounterTimesource 22 | uint64_t get_time_strong_ordering() { return timestamp.val; } 23 | 24 | /// Runs the orec_t.h implementation of increment_get() 25 | uint64_t increment_get() { return 1 + timestamp.val.fetch_add(1); } 26 | 27 | /// Increment the clock, and ignore the new value. This is useful when doing 28 | /// abort-time bumping in undo-based STM. 29 | void increment() { timestamp.val++; } 30 | }; 31 | 32 | /// RdtscpTimesource uses the hardware clock cycle counter with rdtscp as the 33 | /// timesource 34 | class RdtscpTimesource { 35 | 36 | public: 37 | typedef std::atomic time_snapshot_t; 38 | 39 | /// Use rdtscp to get the hardware clock cycle count 40 | uint64_t get_time() { 41 | unsigned int dummy; 42 | return __rdtscp(&dummy); 43 | } 44 | 45 | /// Use rdtscp to get the hardware clock cycle count, but enforces strong 46 | /// ordering with an atomic add 47 | uint64_t get_time_strong_ordering() { return get_time(); } 48 | 49 | /// Not needed for RdtscpTimesource. Instead we do the same thing as 50 | /// get_time() 51 | uint64_t increment_get() { return get_time_strong_ordering(); } 52 | 53 | /// No-op for RdtscpTimesource 54 | void increment() {} 55 | }; --------------------------------------------------------------------------------