erlang各种有用的函数包括一些有用nif封装,还有一些性能测试case。
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 
SisMaker 59f5ff4f86 ft: 添加未提交的文件 há 3 anos
..
Makefile 代码整理 há 4 anos
README.md 代码整理 há 4 anos
concurrentqueue.h ft: 更新# Allocates more memory if necessary há 3 anos
enlfq.cc 代码整理 há 4 anos
enlfq.h 代码整理 há 4 anos
enlfq_nif.cc 代码整理 há 4 anos
enlfq_nif.h ft: 添加未提交的文件 há 3 anos
nif_utils.cc 代码整理 há 4 anos
nif_utils.h 代码整理 há 4 anos
rebar.config 代码整理 há 4 anos

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).