Code Monkey home page Code Monkey logo

shm_container's Introduction

SHM-Container Documentation

Introduction

Shared-memory is best known as an effective IPC method, moreover, it is a powerful design pattern in server architecture with some notable features:

  • process restart without memory data lost
  • achieve modularity with decoupled processes
  • keep service HA even with failure in one process
  • almost no performance cost for inter process communication

Many popular high-volume internet services (such as QQ server) have benefit from usage of shared-memory techniques. However it is not as easy as using in-process libraries (such as STL) when working with OS shm interface, because you have to manage memory pages directly. So what this project is valuable is that it offers a collection of shared-memory containers with familiar interface for you, and also with the following features:

  • provide a unified interface for different underlying shm mechanism (SYSV, SYSV_HugeTLB, POSIX, ANON, HEAP)
  • provide useful container such as hash-map, fifo-queue, broadcast-queue(sync-buf), etc
  • efficient C++11 lock-free implemenation aimed to offer extreme high performance
  • designed for robust and fast, sufficient unit-tests, production ready and verified
  • compact and clean code, only consist of C++ headers with no external dependency

See document of classes in namespace shmc for detail.

Limitation

Currently only Linux/x86 platform is supported. Moreover, its design goal is all for server side application.

HowToUse

The library consists only C++ headers, so importing it in your project is very easy (just add -I dir). It also provides a bazel BUILD file so just set deps on it if you are using bazel.

If you want to build unit-tests, install bazel and gtestx first.

Document

You can find document online here: SHM-Container Documentation

Also you can generate doc from source: 1) install cldoc 2) cd doc; make

shm_container's People

Contributors

mikewei avatar

Watchers

James Cloos 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.