Giter VIP home page Giter VIP logo

shm_hashtable's Introduction

shm_hashtable 基于共享内存的多阶hashtable

实现了一种在共享内存中存取数据的hash表,它采用了多级存储求模取余的方法

image

Why 共享内存

在服务进程因某种原因挂掉的时候,共享内存中的数据仍然存在,相对于内存有优势
注意:在共享内存中的数据结构一定要是连续的,最好不要使用指针成员

Why 多阶

性能+空间利用率,阶数=100的时候空间利用率可以达到95%以上

生成连续素数的筛法

6N±1定侓:任何一个自然数,总是可以表示成如下的形式之一:6N,6N+1,6N+2,6N+3,6N+4,6N+5 (N=0,1,2,3…) 显然,当N>=1时,6N,6N+2,6N+3,6N+4都不是素数,只有形如6N+1和6N+5的自然数有可能是素数(注意:这只是过滤出有可能的数,但未必一定是,比如25=6*4+1,就不是素数)。6N+5又可以表示成6N-1,所以,除了2和3外,所有的素数都可以表示成6n±1的形式。
image

筛选过滤

6n1-and-6n-1-prime-format

shm_hashtable's People

Contributors

pandaychen avatar

Stargazers

 avatar pwanbul avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.