{"id":32985699,"url":"https://github.com/Neopallium/lua-llthreads","last_synced_at":"2025-11-16T03:01:41.934Z","repository":{"id":46593766,"uuid":"1520060","full_name":"Neopallium/lua-llthreads","owner":"Neopallium","description":"Low-Level threads(pthreads or WIN32 threads) for Lua.","archived":false,"fork":false,"pushed_at":"2024-10-02T10:05:59.000Z","size":61,"stargazers_count":150,"open_issues_count":5,"forks_count":37,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-07-30T09:46:05.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neopallium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2011-03-24T08:26:47.000Z","updated_at":"2025-07-17T17:38:02.000Z","dependencies_parsed_at":"2024-10-23T02:50:57.047Z","dependency_job_id":null,"html_url":"https://github.com/Neopallium/lua-llthreads","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Neopallium/lua-llthreads","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neopallium%2Flua-llthreads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neopallium%2Flua-llthreads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neopallium%2Flua-llthreads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neopallium%2Flua-llthreads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neopallium","download_url":"https://codeload.github.com/Neopallium/lua-llthreads/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neopallium%2Flua-llthreads/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284654194,"owners_count":27041729,"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","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-11-13T08:00:33.767Z","updated_at":"2025-11-16T03:01:41.922Z","avatar_url":"https://github.com/Neopallium.png","language":"C","readme":"About\n=====\n\n[![travis-ci status](https://secure.travis-ci.org/Neopallium/lua-llthreads.png?branch=master)](http://travis-ci.org/Neopallium/lua-llthreads/builds)\n\nA simple Lua wrapper for pthreads \u0026 WIN32 threads.\n\nEach thread gets it's own `lua_State` and there is no shared global state.\nThe parent thread can pass data to a child thread only as parameters when creating\nthe child thread.  The child threads can return data back to the parent thread only\nwhen it return (i.e. ends).  The parent needs to call child:join() to get the return\nvalues from a child thread, this call will block until the child thread ends.\n\nThe design goals of this module is only provide support for creating new `lua_State`\nand running them in a different thread.  This module will not provide any\nmethods of thread-to-thread data passing between running threads (i.e. no locks, no shared state).\n\nThread to Thread communication methods\n======================================\n\n* The recommend method of passing data between threads is to use [ZeroMQ](http://github.com/Neopallium/lua-zmq).\n\n* Another method is to use sockets library like [LuaSocket](http://w3.impa.br/~diego/software/luasocket) or [Nixio](http://neopallium.github.com/nixio/).\n\nInstallation\n============\n\nRelease 1.2\n-----------\n\nlua-llthread 1.2 release:\n\n\t$ sudo luarocks install lua-llthreads\n\nLastest Git Revision\n--------------------\n\nWith LuaRocks 2.0.4.1:\n\n\t$ sudo luarocks install https://github.com/Neopallium/lua-llthreads/raw/master/rockspecs/lua-llthreads-scm-0.rockspec\n\nWith CMake:\n\n\t$ git clone git://github.com/Neopallium/lua-llthreads.git\n\t$ cd lua-llthreads ; mkdir build ; cd build\n\t$ cmake ..\n\t$ make\n\t$ sudo make install\n\n\nExample usage\n=============\n\n\tlocal llthreads = require\"llthreads\"\n\n\tlocal thread_code = [[\n\t\t-- print thread's parameter.\n\t\tprint(\"CHILD: received params:\", ...)\n\t\t-- return all thread's parameters back to the parent thread.\n\t\treturn ...\n\t]]\n\t\n\t-- create detached child thread.\n\tlocal thread = llthreads.new(thread_code, \"number:\", 1234, \"nil:\", nil, \"bool:\", true)\n\t-- start non-joinable detached child thread.\n\tassert(thread:start(true))\n\t-- Use a detatched child thread when you don't care when the child finishes.\n\n\t-- create child thread.\n\tlocal thread = llthreads.new(thread_code, \"number:\", 1234, \"nil:\", nil, \"bool:\", true)\n\t-- start joinable child thread.\n\tassert(thread:start())\n\t-- Warning: If you don't call thread:join() on a joinable child thread, it will be called\n\t-- by the garbage collector, which may cause random pauses/freeze of the parent thread.\n\tprint(\"PARENT: child returned: \", thread:join())\n\n\tlocal socket = require\"socket\"\n\tsocket.sleep(2) -- give detached thread some time to run.\n\n\n","funding_links":[],"categories":["C","Resources","Processes and Threads"],"sub_categories":["Multitasking","Concurrency and Multithreading"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNeopallium%2Flua-llthreads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNeopallium%2Flua-llthreads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNeopallium%2Flua-llthreads/lists"}