go-lockfree-queue
Lock-free FIFO queue library supporting generic enqueue and dequeue operations.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.7%) to scientific vocabulary
Keywords
Repository
Lock-free FIFO queue library supporting generic enqueue and dequeue operations.
Basic Info
Statistics
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 4
Topics
Metadata Files
README.md
🚀 go-lockfree-queue
A Lock Free Queue library for Go, providing a high-performance FIFO structure with operations to enqueue and dequeue generic values.
| CI / CD | Quality & Security | Docs & Meta | Community |
|---|---|---|---|
|
|
|
|
|
🗂️ Table of Contents
- What's Inside
- Installation
- Documentation
- Examples & Tests
- Benchmarks
- Code Standards
- AI Compliance
- Maintainers
- Contributing
- License
🧩 What's Inside
Library for Lock Free Queue capabilities. A Lock Free Queue is a FIFO structure with operations to enqueue and dequeue generic values.
📦 Installation
go-lockfree-queue requires a supported release of Go.
shell script
go get -u github.com/bsv-blockchain/go-lockfree-queue
📚 Documentation
- API Reference – Dive into the godocs at pkg.go.dev/github.com/bsv-blockchain/go-lockfree-queue
- Usage Examples – Browse practical patterns either the examples directory
- Benchmarks – Check the latest numbers in the benchmark results
- Test Suite – Review both the unit tests and fuzz tests (powered by
testify)
Good to know:
go-lockfree-queueships with zero runtime dependencies.
The only external package we use istestify—and that's strictly for tests.
Repository Features
* **Continuous Integration on Autopilot** with [GitHub Actions](https://github.com/features/actions) – every push is built, tested, and reported in minutes. * **Pull‑Request Flow That Merges Itself** thanks to [auto‑merge](.github/workflows/auto-merge-on-approval.yml) and hands‑free [Dependabot auto‑merge](.github/workflows/dependabot-auto-merge.yml). * **One‑Command Builds** powered by battle‑tested [Make](https://www.gnu.org/software/make) targets for linting, testing, releases, and more. * **First‑Class Dependency Management** using native [Go Modules](https://github.com/golang/go/wiki/Modules). * **Uniform Code Style** via [gofumpt](https://github.com/mvdan/gofumpt) plus zero‑noise linting with [golangci‑lint](https://github.com/golangci/golangci-lint). * **Confidence‑Boosting Tests** with [testify](https://github.com/stretchr/testify), the Go [race detector](https://blog.golang.org/race-detector), crystal‑clear [HTML coverage](https://blog.golang.org/cover) snapshots, and automatic uploads to [Codecov](https://codecov.io/). * **Hands‑Free Releases** delivered by [GoReleaser](https://github.com/goreleaser/goreleaser) whenever you create a [new Tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). * **Relentless Dependency & Vulnerability Scans** via [Dependabot](https://dependabot.com), [Nancy](https://github.com/sonatype-nexus-community/nancy), and [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck). * **Security Posture by Default** with [CodeQL](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning), [OpenSSF Scorecard](https://openssf.org), and secret‑leak detection via [gitleaks](https://github.com/gitleaks/gitleaks). * **Automatic Syndication** to [pkg.go.dev](https://pkg.go.dev/) on every release for instant godoc visibility. * **Polished Community Experience** using rich templates for [Issues & PRs](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository). * **All the Right Meta Files** (`LICENSE`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SUPPORT.md`, `SECURITY.md`) pre‑filled and ready. * **Code Ownership** clarified through a [CODEOWNERS](.github/CODEOWNERS) file, keeping reviews fast and focused. * **Zero‑Noise Dev Environments** with tuned editor settings (`.editorconfig`) plus curated *ignore* files for [VS Code](.editorconfig), [Docker](.dockerignore), and [Git](.gitignore). * **Label Sync Magic**: your repo labels stay in lock‑step with [.github/labels.yml](.github/labels.yml). * **Friendly First PR Workflow** – newcomers get a warm welcome thanks to a dedicated [workflow](.github/workflows/pull-request-management.yml). * **Standards‑Compliant Docs** adhering to the [standard‑readme](https://github.com/RichardLitt/standard-readme/blob/master/spec.md) spec. * **Instant Cloud Workspaces** via [Gitpod](https://gitpod.io/) – spin up a fully configured dev environment with automatic linting and tests. * **Out‑of‑the‑Box VS Code Happiness** with a preconfigured [Go](https://code.visualstudio.com/docs/languages/go) workspace and [`.vscode`](.vscode) folder with all the right settings. * **Optional Release Broadcasts** to your community via [Slack](https://slack.com), [Discord](https://discord.com), or [Twitter](https://twitter.com) – plug in your webhook. * **AI Compliance Playbook** – machine‑readable guidelines ([AGENTS.md](.github/AGENTS.md), [CLAUDE.md](.github/CLAUDE.md), [.cursorrules](.cursorrules), [sweep.yaml](.github/sweep.yaml)) keep ChatGPT, Claude, Cursor & Sweep aligned with your repo’s rules. * **Pre-commit Hooks for Consistency** powered by [pre-commit](https://pre-commit.com) and the [.pre-commit-config.yaml](.pre-commit-config.yaml) file—run the same formatting, linting, and tests before every commit, just like CI. * **Automated Hook Updates** keep the [.pre-commit-config.yaml](.pre-commit-config.yaml) current via a weekly [workflow](.github/workflows/update-pre-commit-hooks.yml). * **DevContainers for Instant Onboarding** – Launch a ready-to-code environment in seconds with [VS Code DevContainers](https://containers.dev/) and the included [.devcontainer.json](.devcontainer.json) config.
Library Deployment
This project uses [goreleaser](https://github.com/goreleaser/goreleaser) for streamlined binary and library deployment to GitHub. To get started, install it via: ```bash brew install goreleaser ``` The release process is defined in the [.goreleaser.yml](.goreleaser.yml) configuration file. To generate a snapshot (non-versioned) release for testing purposes, run: ```bash make release-snap ``` Then create and push a new Git tag using: ```bash make tag version=x.y.z ``` This process ensures consistent, repeatable releases with properly versioned artifacts and citation metadata.
Makefile Commands
View all `makefile` commands ```bash script make help ``` List of all current commands: ```text bench ## Run all benchmarks in the Go application build-go ## Build the Go application (locally) citation ## Update version in CITATION.cff (use version=X.Y.Z) clean-mods ## Remove all the Go mod cache coverage ## Show test coverage diff ## Show git diff and fail if uncommitted changes exist fumpt ## Run fumpt to format Go code generate ## Run go generate in the base of the repo godocs ## Trigger GoDocs tag sync govulncheck-install ## Install govulncheck (pass VERSION= to override) govulncheck ## Scan for vulnerabilities help ## Display this help message install-go ## Install using go install with specific version install-releaser ## Install GoReleaser install-stdlib ## Install the Go standard library for the host platform install-template ## Kick-start a fresh copy of go-template (run once!) install ## Install the application binary lint-version ## Show the golangci-lint version lint ## Run the golangci-lint application (install if not found) loc ## Total lines of code table mod-download ## Download Go module dependencies mod-tidy ## Clean up go.mod and go.sum pre-build ## Pre-build all packages to warm cache release-snap ## Build snapshot binaries release-test ## Run release dry-run (no publish) release ## Run production release (requires github_token) tag-remove ## Remove local and remote tag (use version=X.Y.Z) tag-update ## Force-update tag to current commit (use version=X.Y.Z) tag ## Create and push a new tag (use version=X.Y.Z) test-ci-no-race ## CI test suite without race detector test-ci ## CI test runs tests with race detection and coverage (no lint - handled separately) test-cover-race ## Runs unit tests with race detector and outputs coverage test-cover ## Unit tests with coverage (no race) test-fuzz ## Run fuzz tests only (no unit tests) test-no-lint ## Run only tests (no lint) test-parallel ## Run tests in parallel (faster for large repos) test-race ## Unit tests with race detector (no coverage) test-short ## Run tests excluding integration tests (no lint) test ## Default testing uses lint + unit tests (fast) uninstall ## Uninstall the Go binary update-linter ## Upgrade golangci-lint (macOS only) update-releaser ## Reinstall GoReleaser update ## Update dependencies vet-parallel ## Run go vet in parallel (faster for large repos) vet ## Run go vet only on your module packages ```
GitHub Workflows
### 🎛️ The Workflow Control Center All GitHub Actions workflows in this repository are powered by a single configuration file: [**.env.shared**](.github/.env.shared) – your one-stop shop for tweaking CI/CD behavior without touching a single YAML file! 🎯 This magical file controls everything from: - **🚀 Go version matrix** (test on multiple versions or just one) - **🏃 Runner selection** (Ubuntu or macOS, your wallet decides) - **🔬 Feature toggles** (coverage, fuzzing, linting, race detection) - **🛡️ Security tool versions** (gitleaks, nancy, govulncheck) - **🤖 Auto-merge behaviors** (how aggressive should the bots be?) - **🏷️ PR management rules** (size labels, auto-assignment, welcome messages) > **Pro tip:** Want to disable code coverage? Just flip `ENABLE_CODE_COVERAGE=false` in [.env.shared](.github/.env.shared) and push. No YAML archaeology required!
| Workflow Name | Description | |------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| | [auto-merge-on-approval.yml](.github/workflows/auto-merge-on-approval.yml) | Automatically merges PRs after approval and all required checks, following strict rules. | | [codeql.yml](.github/workflows/codeql-analysis.yml) | Analyzes code for security vulnerabilities using [GitHub CodeQL](https://codeql.github.com/). | | [dependabot-auto-merge.yml](.github/workflows/dependabot-auto-merge.yml) | Automatically merges [Dependabot](https://github.com/dependabot) PRs that meet all requirements. | | [fortress.yml](.github/workflows/fortress.yml) | Runs the GoFortress security and testing workflow, including linting, testing, releasing, and vulnerability checks. | | [pull-request-management.yml](.github/workflows/pull-request-management.yml) | Labels PRs by branch prefix, assigns a default user if none is assigned, and welcomes new contributors with a comment. | | [scorecard.yml](.github/workflows/scorecard.yml) | Runs [OpenSSF](https://openssf.org/) Scorecard to assess supply chain security. | | [stale.yml](.github/workflows/stale-check.yml) | Warns about (and optionally closes) inactive issues and PRs on a schedule or manual trigger. | | [sync-labels.yml](.github/workflows/sync-labels.yml) | Keeps GitHub labels in sync with the declarative manifest at [`.github/labels.yml`](./.github/labels.yml). | | [update-python-dependencies.yml](.github/workflows/update-python-dependencies.yml) | Updates Python dependencies for pre-commit hooks in the repository. | | [update-pre-commit-hooks.yml](.github/workflows/update-pre-commit-hooks.yml) | Automatically update versions for [pre-commit](https://pre-commit.com/) hooks |
Updating Dependencies
To update all dependencies (Go modules, linters, and related tools), run: ```bash make update ``` This command ensures all dependencies are brought up to date in a single step, including Go modules and any tools managed by the Makefile. It is the recommended way to keep your development environment and CI in sync with the latest versions.
Pre-commit Hooks
Set up the optional [pre-commit](https://pre-commit.com) hooks to run the same formatting, linting, and tests defined in [AGENTS.md](.github/AGENTS.md) before every commit: ```bash pip install pre-commit pre-commit install ``` The hooks are configured in [.pre-commit-config.yaml](.pre-commit-config.yaml) and mirror the CI pipeline.
🧪 Examples & Tests
All unit tests and examples run via GitHub Actions and use Go version 1.24.x. View the configuration file.
Run all tests (fast):
bash script
make test
Run all tests with race detector (slower):
bash script
make test-race
⚡ Benchmarks
Run the Go benchmarks:
bash script
make bench
Benchmark Results
| Benchmark | Iterations | ns/op | B/op | allocs/op | |-------------------------------------------------------|------------|------:|-----:|----------:| | LockFreeQueue | 24752019 | 79.73 | 16 | 1 | | NewLockFreeQ | 1000000000 | 0.29 | 0 | 0 | | LockFreeQEnqueue | 25041442 | 49.18 | 16 | 1 | | LockFreeQDequeue | 338000521 | 11.14 | 0 | 0 | | LockFreeQIsEmpty | 1000000000 | 0.60 | 0 | 0 |
These benchmarks reflect fast, allocation-free lookups for most retrieval functions, ensuring optimal performance in production environments. Performance benchmarks for the core functions in this library, executed on a 13th Gen Intel i7-1360P (AMD64).
🛠️ Code Standards
Read more about this Go project's code standards.
🤖 AI Compliance
This project documents expectations for AI assistants using a few dedicated files:
- AGENTS.md — canonical rules for coding style, workflows, and pull requests used by Codex.
- CLAUDE.md — quick checklist for the Claude agent.
- .cursorrules — machine-readable subset of the policies for Cursor and similar tools.
- sweep.yaml — rules for Sweep, a tool for code review and pull request management.
Edit AGENTS.md first when adjusting these policies, and keep the other files in sync within the same pull request.
👥 Maintainers
|
|
|:--------------------------------------------------------------------------------------------------:|
| Siggi |
🤝 Contributing
View the contributing guidelines and please follow the code of conduct.
How can I help?
All kinds of contributions are welcome :raisedhands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speechballoon:. You can also support this project by becoming a sponsor on GitHub :clap:
📝 License
Owner
- Name: BSV Blockchain
- Login: bsv-blockchain
- Kind: organization
- Location: Switzerland
- Website: https://www.bsvblockchain.org/
- Repositories: 1
- Profile: https://github.com/bsv-blockchain
GitHub Events
Total
- Release event: 3
- Watch event: 1
- Delete event: 8
- Member event: 1
- Issue comment event: 28
- Push event: 6
- Pull request review event: 3
- Pull request event: 9
- Create event: 9
Last Year
- Release event: 3
- Watch event: 1
- Delete event: 8
- Member event: 1
- Issue comment event: 28
- Push event: 6
- Pull request review event: 3
- Pull request event: 9
- Create event: 9
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 6
- Average time to close issues: N/A
- Average time to close pull requests: 3 minutes
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.67
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 6
Past Year
- Issues: 0
- Pull requests: 6
- Average time to close issues: N/A
- Average time to close pull requests: 3 minutes
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.67
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 6
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (6)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
proxy.golang.org: github.com/bsv-blockchain/go-lockfree-queue
- Homepage: https://github.com/bsv-blockchain/go-lockfree-queue
- Documentation: https://pkg.go.dev/github.com/bsv-blockchain/go-lockfree-queue#section-documentation
- License: other
-
Latest release: v1.0.3
published 8 months ago
Rankings
Dependencies
- actions/github-script 60a0d83039c74a4aee543508d2ffcb1c3799cdea composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- gitleaks/gitleaks-action ff98106e4c7b2bc287b24eaf42907196329070c7 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- github/codeql-action/analyze 181d5eefc20863364f96762470ba6f862bdef56b composite
- github/codeql-action/autobuild 181d5eefc20863364f96762470ba6f862bdef56b composite
- github/codeql-action/init 181d5eefc20863364f96762470ba6f862bdef56b composite
- actions/github-script 60a0d83039c74a4aee543508d2ffcb1c3799cdea composite
- actions/github-script 60a0d83039c74a4aee543508d2ffcb1c3799cdea composite
- hmarr/auto-approve-action f0939ea97e9205ef24d872e76833fa908a770363 composite
- pascalgn/automerge-action 7961b8b5eec56cc088c140b56d864285eabd3f67 composite
- actions/github-script 60a0d83039c74a4aee543508d2ffcb1c3799cdea composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/setup-go d35c59abb061a4a6fb18e82ac0862c26744d6ab5 composite
- goreleaser/goreleaser-action 9c156ee8a17a598857849441385a2041ef570552 composite
- actions/cache 5a3ec84eff668545956fd18022155c47e93e2684 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/setup-go d35c59abb061a4a6fb18e82ac0862c26744d6ab5 composite
- codecov/codecov-action 18283e04ce6e62d37312384ff67231eb8fd56d24 composite
- sonatype-nexus-community/nancy-github-action 726e338312e68ecdd4b4195765f174d3b3ce1533 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
- github/codeql-action/upload-sarif 181d5eefc20863364f96762470ba6f862bdef56b composite
- ossf/scorecard-action 05b42c624433fc40578a4040d5cf5e36ddca8cde composite
- actions/stale 5bef64f19d7facfb25b37b414482c7164d639639 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- micnncim/action-label-syncer 3abd5ab72fda571e69fffd97bd4e0033dd5f495c composite
- actions/cache 9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/setup-python a26af69be951a213d495a4c3e4e4022e16d87065 composite
- peter-evans/create-pull-request 271a8d0340265f705b14b6d32b9829c1cb33d45e composite
- actions/cache 9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/setup-python a26af69be951a213d495a4c3e4e4022e16d87065 composite
- peter-evans/create-pull-request 271a8d0340265f705b14b6d32b9829c1cb33d45e composite
- scratch latest build
- github.com/davecgh/go-spew v1.1.1
- github.com/pmezard/go-difflib v1.0.0
- github.com/stretchr/testify v1.10.0
- gopkg.in/yaml.v3 v3.0.1
- github.com/davecgh/go-spew v1.1.1
- github.com/pmezard/go-difflib v1.0.0
- github.com/stretchr/testify v1.10.0
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/yaml.v3 v3.0.1
- PyYAML ==6.0.2
- cfgv ==3.4.0
- distlib ==0.3.9
- filelock ==3.18.0
- identify ==2.6.12
- nodeenv ==1.9.1
- platformdirs ==4.3.8
- pre-commit ==3.7.0
- virtualenv ==20.31.2