{"id":43271470,"url":"https://github.com/yuyang0/pyshm","last_synced_at":"2026-02-01T16:03:23.330Z","repository":{"id":62583430,"uuid":"104988872","full_name":"yuyang0/pyshm","owner":"yuyang0","description":"python share memory library","archived":false,"fork":false,"pushed_at":"2017-09-29T02:40:16.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T20:15:02.648Z","etag":null,"topics":["mempool","python-memory","ring"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuyang0.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-27T07:51:49.000Z","updated_at":"2024-04-09T10:44:36.000Z","dependencies_parsed_at":"2022-11-03T21:57:56.442Z","dependency_job_id":null,"html_url":"https://github.com/yuyang0/pyshm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yuyang0/pyshm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyang0%2Fpyshm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyang0%2Fpyshm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyang0%2Fpyshm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyang0%2Fpyshm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuyang0","download_url":"https://codeload.github.com/yuyang0/pyshm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuyang0%2Fpyshm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28981893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T15:35:50.179Z","status":"ssl_error","status_checked_at":"2026-02-01T15:35:38.075Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["mempool","python-memory","ring"],"created_at":"2026-02-01T16:03:19.959Z","updated_at":"2026-02-01T16:03:23.323Z","avatar_url":"https://github.com/yuyang0.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyshm - Python share memory library\n===================================\n\n|Build Status| |PyPI version| |pyversions| |License|\n\npyshm is a python library that used to pass memory block between\nmultiple processes. it exports three modules:\n\n1. ``shm``: mainly used to create share memory between multiple\n   process(using ``mmap``)\n2. ``mempool``: A memory pool is an allocator of fixed-size memory blocks.\n   In python memory block is represented as a buffer-like object.\n3. ``ring``: lockless FIFO queue in share memory. user can use ``Ring`` to\n   manage the memory blocks allocated from Mempool\n\ninstallation and usage\n----------------------\n\nyou can install pyshm using setuptools or pip:\n\n::\n\n    pip install pyshm\n\nor:\n\n::\n\n    python setup.py install\n\nusage\n-----\n\n1. create share memory\n\n   ::\n\n       from pyshm import ShareMem\n\n       test_shm = ShareMem(64*1024*1024) # 64M\n\n   pls note: these code should execute before ``fork``\n\n2. using ``mempool``\n\n   ::\n\n       from pyshm import mempool\n       count = 4\n       mp = mempool.Mempool(count, 4, shm=test_shm)\n\n       pid = os.fork()\n       if pid == 0:\n           for i in range(count):\n               buf = mp.get()\n               struct.pack_into(\"=i\", buf, 0, i)\n               mp.put(buf)\n       else:\n           cid, status = os.wait()\n           assert pid == cid\n           for i in range(count):\n               buf = mp.get()\n               v, = struct.unpack_from(\"=i\", buf)\n               assert v == i\n           mp.cleanup()\n\n   ``get`` used to get memory block(a buffer-like object), ``put`` returns the\n   memory block to the mempool\n\n3. using ``ring``: ring can used to pass the memory block(get from mempool)\n   to the other process. it proviod ``enqueue`` and ``dequeue``, one\n   process enequeue and the other process ``dequeue``\n\n.. |Build Status| image:: https://travis-ci.org/yuyang0/pyshm.svg?branch=master\n   :target: https://travis-ci.org/yuyang0/pyshm\n.. |PyPI version| image:: https://badge.fury.io/py/pyshm.svg\n   :target: https://pypi.python.org/pypi/pyshm\n.. |pyversions| image:: https://img.shields.io/badge/python-2.7,3.5,3.6,pypy-blue.svg\n   :target: https://pypi.python.org/pypi/pyshm\n.. |License| image:: https://img.shields.io/badge/License-BSD%202--Clause-orange.svg\n   :target: https://opensource.org/licenses/BSD-2-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuyang0%2Fpyshm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuyang0%2Fpyshm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuyang0%2Fpyshm/lists"}