GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mcpplibs/concurrentqueue-m: moodycamel::ConcurrentQueue as C++23 modules for mcpp: import mcpplibs.mwrap.concurrentqueue

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
include/mwrap/concurrentqueue
include/mwrap/concurrentqueue
 
 
src
src
 
 
templates/pipeline
templates/pipeline
 
 
tests
tests
 
 
tools
tools
 
 
upstream
upstream
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.xlings.json
.xlings.json
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
README.zh.md
README.zh.md
 
 
mcpp.toml
mcpp.toml
 
 

Repository files navigation

concurrentqueue

moodycamel::ConcurrentQueue, the lock-free multi-producer multi-consumer queue, through C++23 modules.

English · 简体中文 · Upstream · Releases · mcpp · Index

C++23 License mcpp-community CI

The upstream API is unchanged: moodycamel::ConcurrentQueue, BlockingConcurrentQueue, ProducerToken, ConsumerToken and LightweightSemaphore are the upstream entities of the three headers, templates over your element and Traits types. The headers are compat.concurrentqueue 1.0.5. The value macros are constants. Upstream's own tests/unittests (all 45 tests) pass on every CI run, built against the module instead of the headers.

Modules

  • import mcpplibs.mwrap.concurrentqueue;: the queues, tokens, traits, semaphore and swap in moodycamel, re-exporting the one below
  • import mcpplibs.mwrap.concurrentqueue.macros;: MOODYCAMEL_EXCEPTIONS_ENABLED, MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED … in mcpplibs::mwrap::concurrentqueue::macros
  • import mcpplibs.mwrap.concurrentqueue.c_api;: the C API (moodycamel_cq_*, moodycamel_bcq_*), with the c-api feature

More Modules API -> Usage and API

Getting started

mcpp new pipeline --template [email protected]
cd pipeline
mcpp run

The default template runs a producer-consumer pipeline. Producer threads enqueue numbers in bulk through their tokens. Consumers wait on a blocking queue with a timeout and count primes.

[dependencies]
"mcpplibs.mwrap.concurrentqueue" = "1.0.5"
import std;
import mcpplibs.mwrap.concurrentqueue;

int main() {
    moodycamel::ConcurrentQueue<std::function<void()>> tasks;
    std::jthread worker([&] { tasks.enqueue([] { std::println("ran on the main thread"); }); });
    worker.join();
    std::function<void()> task;
    while (tasks.try_dequeue(task)) task();
}
Feature Effect
c-api upstream's C API: compat.concurrentqueue's sources and the c_api module
no-thread-local MOODYCAMEL_NO_THREAD_LOCAL: no thread_local, implicit producers not recycled at thread exit

Configuration and macros

Configuration macros must be set before the module is built. The module uses upstream's defaults, with MOODYCAMEL_NOEXCEPT_CTOR / _ASSIGN spelled as the equivalent type traits so that GCC accepts the interface (config.hpp). Per-queue settings (block size, index sizes, allocation) are the Traits argument, as upstream documents. The syntax macros (MOODYCAMEL_NOEXCEPT, MOODYCAMEL_DELETE_FUNCTION, MOODYCAMEL_TRY …) stay in <mwrap/concurrentqueue/macros.hpp>, included before the imports. With GCC, a unit that includes <cxxabi.h> (gtest does) cannot use the queue's thread-exit path: use no-thread-local there. Details: docs/usage.md.

Build and testing

Linux, macOS and Windows CI build the modules and run the tests: multi-producer multi-consumer traffic, tokens, bulk operations, timed waits, user types and traits, the semaphore, the C API and header mixing. CI also runs the export audit (tools/check_exports.py: every declaration exported or listed with its reason, every macro mapped or kept) and upstream's tests/unittests against the module (tools/run_conformance.py). A separate job scaffolds the default template as an installed package and runs it.

License

Apache-2.0 for the wrapper, by mcpp-community (NOTICE). concurrentqueue remains under the Simplified BSD license or the Boost Software License, and its semaphore under zlib (upstream/concurrentqueue/LICENSE.md, README).

About

moodycamel::ConcurrentQueue as C++23 modules for mcpp: import mcpplibs.mwrap.concurrentqueue

Topics

concurrentqueuecpp-modulesmcpp-community

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.