Git Product home page Git Product logo

l4's Introduction

L4 HashTable

L4 (Lock-Free on Read) Hashtable is a C++ library that provides a fixed-size hashtable, where keys and values are arbitrary bytes.

L4 HashTable is optimized for lookup operations. It uses Epoch Queue (deterministic garbage collector) to achieve lock-free lookup operations.

L4 HashTable supports caching based on memory size and time. It uses Clock algorithm for an efficient cache eviction.

L4 HashTable is built with interprocess communication in mind and its shared memory implementation (multiple-readers-single-writer model at process level) is coming soon.

Installation

Visual C++ (Windows)

This library is developed and maintained with Visual Studio 2019. Visual Studio 2019 Community is available for free here.

To get started, open the L4.sln file and build the solution. Initially, it will automatically start downloading boost NuGet package before build starts.

GCC

This library is tested with GCC 6.2. You can run the following commands to get started:

cmake -DBOOST_ROOT=<boost root directory> CMakeLists.txt
make
make test

Getting Started

Start with a simple example.

Check out the wiki.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

Code licensed under the MIT License.

l4's People

Contributors

fish2000 avatar imback82 avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

l4's Issues

Add vcpkg package

ITNOA

Please add vcpkg and update readme to helping install this library by vcpkg

Question: Big-endian support

In Metadata.h#L68 the most significant byte of the uint32_t metadatum is accessed by interpreting it as an array of uint8_t and indexing it at the fixed index 3.

As the comment in line 75 of the same file points out, this obviously will only work on little endian machines. I am assuming that this means L4 will not work on big endian machines (e.g. IBM's AIX).

Is this the only issue preventing big endian support or are there other parts (e.g. MurmurHash3.cpp) that would also need to be adapted to support big endian?

Question: Allocation of RecordBuffer in shared memory context

I am trying to use the hash table in a scenario where the hash table and its records are placed in a fixed size, pre-allocated chunk of shared memory accessed by multiple processes. Allocations in this chunk of shared memory would be managed by a custom allocator.

Adding a key-value pair to a hash table via WritableHashTable::Add causes WritableHashTable::CreateRecordBuffer to be called internally, which allocates a buffer of sufficient size. As far as I can see the allocation does not happen in the critical section of the Add method, thus the custom allocator mentioned above would have to take care of executing these allocations serially.

The README mentions a shared memory implementation, but it is unclear to me how far this shared memory implementation has progressed.
Am I missing something here or is making the custom allocator "multiprocess aware" the only option?

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.