{"id":21377237,"url":"https://github.com/dns-oarc/sllq","last_synced_at":"2025-07-13T10:31:26.347Z","repository":{"id":140109610,"uuid":"81208015","full_name":"DNS-OARC/sllq","owner":"DNS-OARC","description":"Semi Lock-Less Queue","archived":false,"fork":false,"pushed_at":"2017-08-17T08:27:03.000Z","size":43,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-07T09:03:38.368Z","etag":null,"topics":["c","library","lock-less","pthreads","queue"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DNS-OARC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-07T12:54:38.000Z","updated_at":"2020-02-25T12:23:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"444df273-1ccf-45a8-9b5a-4c507f474cd0","html_url":"https://github.com/DNS-OARC/sllq","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DNS-OARC/sllq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fsllq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fsllq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fsllq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fsllq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DNS-OARC","download_url":"https://codeload.github.com/DNS-OARC/sllq/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fsllq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265128234,"owners_count":23715621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","library","lock-less","pthreads","queue"],"created_at":"2024-11-22T09:19:42.621Z","updated_at":"2025-07-13T10:31:26.339Z","avatar_url":"https://github.com/DNS-OARC.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semi Lock-Less Queue\n\n[![Build Status](https://travis-ci.org/DNS-OARC/sllq.svg?branch=develop)](https://travis-ci.org/DNS-OARC/sllq) [![Coverity Scan Build Status](https://scan.coverity.com/projects/11847/badge.svg)](https://scan.coverity.com/projects/dns-oarc-sllq)\n\n## About\n\nThis is a helper library for sending data between threads or within the\nsame process between logic layers.\n\n## Queue Modes\n\nCurrent modes for the queues are:\n- `SLLQ_MUTEX`: Use POSIX thread mutexes and conditions\n- `SLLQ_PIPE`: Use UNIX pipes\n\n## Usage\n\nHere is a short example how to use this, see the sllqbench directory\nfor a more complete example.\n\n```c\n#include \"config.h\"\n#include \"sllq/sllq.h\"\n#include \u003cstdlib.h\u003e\n#include \u003cpthread.h\u003e\n\nvoid* push(void* vp) {\n    sllq_t* q = (sllq_t*)vp;\n    size_t n = 10;\n    int err;\n    void* data = 0xdeadbeef;\n\n    while (n--) {\n        err = SLLQ_EAGAIN;\n        while (err == SLLQ_EAGAIN || err == SLLQ_FULL)\n            err = sllq_push(q, data, 0);\n        if (err != SLLQ_OK)\n            exit(1);\n    }\n\n    return 0;\n}\n\nvoid* shift(void* vp) {\n    sllq_t* q = (sllq_t*)vp;\n    size_t n = 10;\n    int err;\n    void* data = 0;\n\n    while (n--) {\n        err = SLLQ_EAGAIN;\n        while (err == SLLQ_EAGAIN || err == SLLQ_FULL)\n            err = sllq_shift(q, \u0026data, 0);\n        if (err != SLLQ_OK)\n            exit(1);\n    }\n\n    return 0;\n}\n\nint main(void) {\n    sllq_t q = SLLQ_T_INIT;\n    pthread_t thrpush, thrshift;\n\n    sllq_set_mode(\u0026q, SLLQ_MUTEX);\n    sllq_set_size(\u0026q, 0x100);\n    sllq_init(\u0026q);\n\n    pthread_create(\u0026thrpush, 0, push, (void*)\u0026q);\n    pthread_create(\u0026thrshift, 0, shift, (void*)\u0026q);\n    pthread_join(thrpush, 0);\n    pthread_join(thrshift, 0);\n\n    return 0;\n}\n```\n\n### git submodule\n\n```shell\ngit submodule init\ngit submodule add https://github.com/DNS-OARC/sllq.git src/sllq\n```\n\n### auto(re)conf\n\n```shell\nautoreconf ... --include=src/sllq/m4\n```\n\n### configure.ac\n\n```m4\nAX_SLLQ\n```\n\n### Top level Makefile.am\n\n```m4\nACLOCAL_AMFLAGS = ... -I src/sllq/m4\n```\n\n### Makefile.am\n\n```m4\nAM_CFLAGS += $(PTHREAD_CFLAGS)\nAM_CPPFLAGS += $(PTHREAD_CFLAGS)\nAM_CXXFLAGS += $(PTHREAD_CFLAGS)\n\nprogram_SOURCES += sllq/sllq.c\ndist_program_SOURCES += sllq/sllq.h\nprogram_LDADD += $(PTHREAD_LIBS)\n```\n\n## Author(s)\n\nJerry Lundström \u003cjerry@dns-oarc.net\u003e\n\n## Copyright\n\nCopyright (c) 2017, OARC, Inc.\nAll rights reserved.\n\nThis file is part of sllq.\n\nsllq is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nsllq is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with sllq.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdns-oarc%2Fsllq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdns-oarc%2Fsllq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdns-oarc%2Fsllq/lists"}