erlang各种有用的函数包括一些有用nif封装,还有一些性能测试case。
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 
SisMaker 59f5ff4f86 ft: 添加未提交的文件 3 年前
..
Makefile 代码整理 4 年前
README.md 代码整理 4 年前
concurrentqueue.h ft: 更新# Allocates more memory if necessary 3 年前
enlfq.cc 代码整理 4 年前
enlfq.h 代码整理 4 年前
enlfq_nif.cc 代码整理 4 年前
enlfq_nif.h ft: 添加未提交的文件 3 年前
nif_utils.cc 代码整理 4 年前
nif_utils.h 代码整理 4 年前
rebar.config 代码整理 4 年前

README.md

enlfq

A simple NIF lock-free Queue using the library: moodycamel::concurrentqueue

moodycamel::ConcurrentQueue

An industrial-strength lock-free queue for C++.

Features:

  • Knock-your-socks-off blazing fast performance.
  • Single-header implementation. Just drop it in your project.
  • Fully thread-safe lock-free queue. Use concurrently from any number of threads.
  • C++11 implementation -- elements are moved (instead of copied) where possible.
  • Templated, obviating the need to deal exclusively with pointers -- memory is managed for you.
  • No artificial limitations on element types or maximum count.
  • Memory can be allocated once up-front, or dynamically as needed.
  • Fully portable (no assembly; all is done through standard C++11 primitives).
  • Supports super-fast bulk operations.
  • Includes a low-overhead blocking version (BlockingConcurrentQueue).
  • Exception safe.

Build

$ rebar3 compile

Using


    {ok, Q} = enlfq:new().

    T =  {any, term, [], #{}, 1}.

    true = enlfq:push(Q,T).

    {ok, T} = enlfq:pop(Q).

    empty = enlfq:pop(Q).