All Projects → zhangshun97 → Lock-free-Red-black-tree

zhangshun97 / Lock-free-Red-black-tree

Licence: Apache-2.0 license
Implementation of lock-free red-black tree using CAS

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to Lock-free-Red-black-tree

Spring Webmvc Pac4j
Security library for Spring Web MVC: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 110 (+423.81%)
Mutual labels:  cas
Ucasthesis
**国科大新版标准** 中国科学院大学学位论文模板,目前遵守2018国科大指导标准。 a LaTeX template for UCAS.
Stars: ✭ 166 (+690.48%)
Mutual labels:  cas
undertow-pac4j
Security library for Undertow: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 35 (+66.67%)
Mutual labels:  cas
Domains
A computational algebra system in Smalltalk.
Stars: ✭ 124 (+490.48%)
Mutual labels:  cas
Spark Pac4j
Security library for Sparkjava: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 154 (+633.33%)
Mutual labels:  cas
Maya
Manage Container Attached Storage (CAS) - Data Engines in Kubernetes
Stars: ✭ 169 (+704.76%)
Mutual labels:  cas
Laravel cas server
A laravel package provides CAS server
Stars: ✭ 83 (+295.24%)
Mutual labels:  cas
go-ringbuf
Lock-free MPMC Ring Buffer (Generic) for SMP, in golang. Some posts in chinese:
Stars: ✭ 43 (+104.76%)
Mutual labels:  lock-free
Study
全栈工程师学习笔记;Spring登录、shiro登录、CAS单点登录和Spring boot oauth2单点登录;Spring data cache 缓存,支持Redis和EHcahce; web安全,常见web安全漏洞以及解决思路;常规组件,比如redis、mq等;quartz定时任务,支持持久化数据库,动态维护启动暂停关闭;docker基本用法,常用image镜像使用,Docker-MySQL、docker-Postgres、Docker-nginx、Docker-nexus、Docker-Redis、Docker-RabbitMQ、Docker-zookeeper、Docker-es、Docker-zipkin、Docker-ELK等;mybatis实践、spring实践、spring boot实践等常用集成;基于redis的分布式锁;基于shared-jdbc的分库分表,支持原生jdbc和Spring Boot Mybatis
Stars: ✭ 159 (+657.14%)
Mutual labels:  cas
Cas sso record
CAS实现SSO单点登录项目示例(基本认证流程,代理认证流程,Iframe实现SSO,Restful API实现SSO,JWT认证流程等等)
Stars: ✭ 242 (+1052.38%)
Mutual labels:  cas
Cas Security Spring Boot Starter
Spring boot starter for Apereo CAS client fully integrated with Spring security
Stars: ✭ 129 (+514.29%)
Mutual labels:  cas
Cas Client Autoconfig Support
Annotation-based configuration support for Apereo CAS Java clients
Stars: ✭ 153 (+628.57%)
Mutual labels:  cas
Php cas server
PHP CAS Server
Stars: ✭ 204 (+871.43%)
Mutual labels:  cas
Cipheridaas
CipherIDaaS —— Open-source IDaaS/IAM product by CipherChina , Hangzhou .
Stars: ✭ 121 (+476.19%)
Mutual labels:  cas
BokkyPooBahsRedBlackTreeLibrary
BokkyPooBah's Red-Black Binary Search Tree Library
Stars: ✭ 117 (+457.14%)
Mutual labels:  red-black-tree
Connect Cas2
NodeJS implement of CAS(Central Authentication Service) client.
Stars: ✭ 91 (+333.33%)
Mutual labels:  cas
Pac4j
Security engine for Java (authentication, authorization, multi frameworks): OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 2,097 (+9885.71%)
Mutual labels:  cas
Kelvin
A powerful language for symbolic computation written in Swift.
Stars: ✭ 23 (+9.52%)
Mutual labels:  cas
MSX devs
MSX develops repository
Stars: ✭ 21 (+0%)
Mutual labels:  cas
Spring Security Pac4j
pac4j security library for Spring Security: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 231 (+1000%)
Mutual labels:  cas

Final project pf course 15618@CMU.

We have implemented a lock-free version of red-black tree acoording to the following paper

Kim J H, Cameron H, Graham P. Lock-free red-black trees using cas

Summary

We found that there are many flaws within this paper and the pseudocodes are inconsistent. We believe that's why there are no experiments in the paper (i.e., the authors didn't manage to implement it) and why it is hard to implement, especially the MoveUpRule.

However, we managed to implement this algorithm with both insert and remove (linear speedup with multi-threads) in branch spacingAndMoveUp. What's more, we found that the two rules proposed by the paper is unnecessary that we introduced a much simpler marker mechanism in our report, which will avoid the double marker problem and thus do not need the two rules. The implementation of the simplified version is in branch master.

Also, feel free to read our final report here for implementation details.

Run test demo

To run tests for lock-free (both insert and remove):

1. go to the root folder of this repository
2. run `python3 src/gen_data.py`, this will generate a `data.txt` containing 100,000 numbers
3. if there's no dir called `build`, then `mkdir build`
4. run `make`
5. run `./test_parallel`, it will automatically run tests on both insert and remove functions
   in the case of {1,2,4,8,16} threads and sleeps {0, 0.000001, 0.00001, 0.0001, 0.001} seconds
   between every two operations to provide different contention scenario.

Sample stdout:

bash-4.2$ ./test_parallel 
total_size: 100000
time taken by insert with 1 threads and sleep 0 seconds: 5.456105sec
time taken by remove with 1 threads and sleep 0 seconds: 5.492099sec
time taken by insert with 2 threads and sleep 0 seconds: 2.761535sec
time taken by remove with 2 threads and sleep 0 seconds: 2.758071sec
time taken by insert with 4 threads and sleep 0 seconds: 1.382796sec
time taken by remove with 4 threads and sleep 0 seconds: 1.389684sec
time taken by insert with 8 threads and sleep 0 seconds: 0.686128sec
time taken by remove with 8 threads and sleep 0 seconds: 0.696240sec
time taken by insert with 16 threads and sleep 0 seconds: 0.358965sec
time taken by remove with 16 threads and sleep 0 seconds: 0.372839sec

time taken by insert with 1 threads and sleep 1e-06 seconds: 5.519208sec
time taken by remove with 1 threads and sleep 1e-06 seconds: 5.554028sec
time taken by insert with 2 threads and sleep 1e-06 seconds: 2.812645sec
time taken by remove with 2 threads and sleep 1e-06 seconds: 2.819834sec
time taken by insert with 4 threads and sleep 1e-06 seconds: 1.414126sec
time taken by remove with 4 threads and sleep 1e-06 seconds: 1.417157sec
time taken by insert with 8 threads and sleep 1e-06 seconds: 0.711227sec
time taken by remove with 8 threads and sleep 1e-06 seconds: 0.708651sec
time taken by insert with 16 threads and sleep 1e-06 seconds: 0.372079sec
time taken by remove with 16 threads and sleep 1e-06 seconds: 0.388966sec

time taken by insert with 1 threads and sleep 1e-05 seconds: 6.415008sec
time taken by remove with 1 threads and sleep 1e-05 seconds: 6.459631sec
time taken by insert with 2 threads and sleep 1e-05 seconds: 3.269116sec
time taken by remove with 2 threads and sleep 1e-05 seconds: 3.256373sec
time taken by insert with 4 threads and sleep 1e-05 seconds: 1.633940sec
time taken by remove with 4 threads and sleep 1e-05 seconds: 1.639143sec
time taken by insert with 8 threads and sleep 1e-05 seconds: 0.810158sec
time taken by remove with 8 threads and sleep 1e-05 seconds: 0.818031sec
time taken by insert with 16 threads and sleep 1e-05 seconds: 0.477665sec
time taken by remove with 16 threads and sleep 1e-05 seconds: 0.435705sec

time taken by insert with 1 threads and sleep 0.0001 seconds: 15.502029sec
time taken by remove with 1 threads and sleep 0.0001 seconds: 15.520141sec
time taken by insert with 2 threads and sleep 0.0001 seconds: 7.765034sec
time taken by remove with 2 threads and sleep 0.0001 seconds: 7.767849sec
time taken by insert with 4 threads and sleep 0.0001 seconds: 3.891609sec
time taken by remove with 4 threads and sleep 0.0001 seconds: 3.895309sec
time taken by insert with 8 threads and sleep 0.0001 seconds: 1.945151sec
time taken by remove with 8 threads and sleep 0.0001 seconds: 1.948949sec
time taken by insert with 16 threads and sleep 0.0001 seconds: 0.998574sec
time taken by remove with 16 threads and sleep 0.0001 seconds: 0.979559sec

time taken by insert with 1 threads and sleep 0.001 seconds: 111.163769sec
time taken by remove with 1 threads and sleep 0.001 seconds: 111.636538sec
time taken by insert with 2 threads and sleep 0.001 seconds: 56.064795sec
time taken by remove with 2 threads and sleep 0.001 seconds: 56.531595sec
time taken by insert with 4 threads and sleep 0.001 seconds: 28.136038sec
time taken by remove with 4 threads and sleep 0.001 seconds: 28.367063sec
time taken by insert with 8 threads and sleep 0.001 seconds: 14.123047sec
time taken by remove with 8 threads and sleep 0.001 seconds: 14.066496sec
time taken by insert with 16 threads and sleep 0.001 seconds: 7.071987sec
time taken by remove with 16 threads and sleep 0.001 seconds: 7.050332sec
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].