{"id":13822860,"url":"https://github.com/mersinvald/rust_shm_ipc","last_synced_at":"2025-07-28T23:30:50.038Z","repository":{"id":146334192,"uuid":"82315011","full_name":"mersinvald/rust_shm_ipc","owner":"mersinvald","description":"An example implementatation of synchronized queue for inter-process communication in shared memory","archived":false,"fork":false,"pushed_at":"2017-02-17T16:34:19.000Z","size":8,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-01T12:44:07.611Z","etag":null,"topics":["ipc","linux","posix","pthread","rust","shm","unix"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mersinvald.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}},"created_at":"2017-02-17T16:18:06.000Z","updated_at":"2024-11-19T15:05:47.000Z","dependencies_parsed_at":"2023-06-14T02:15:37.061Z","dependency_job_id":null,"html_url":"https://github.com/mersinvald/rust_shm_ipc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mersinvald%2Frust_shm_ipc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mersinvald%2Frust_shm_ipc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mersinvald%2Frust_shm_ipc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mersinvald%2Frust_shm_ipc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mersinvald","download_url":"https://codeload.github.com/mersinvald/rust_shm_ipc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227962275,"owners_count":17847912,"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":["ipc","linux","posix","pthread","rust","shm","unix"],"created_at":"2024-08-04T08:02:21.203Z","updated_at":"2024-12-03T17:10:47.809Z","avatar_url":"https://github.com/mersinvald.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# SHM IPC example in Rust\n[![Build Status](https://travis-ci.org/mersinvald/rust_shm_ipc.svg?branch=master)](https://travis-ci.org/mersinvald/rust_shm_ipc)\n\nThis is an example implementatation of synchronized queue for inter-process communication in shared memory \nfor UNIX POSIX-complaint operating systems.\n\nMotivation is to try out rust in unix systems programming\n\n### Goals:\n- Safe IPC queue implementation\n- Rusty wrappers for pthread sync primitives\n\n### Non-goals:\n- Fast IPC queue\n- Production-ready code\n- Full-featured wrappers\n\n## Library support\nCurrently this example relies on master branch of rust-lang/libc because of \n\u003chttps://github.com/rust-lang/libc/commit/532d80cdc139ea56351e21685bcfba2d3c93e34d\u003e\n\nRequired bindings will be availible in version 0.2.21\n\n## Usage example\n``` rust\nfn child(queue: Shm\u003cQueue\u003ci32\u003e\u003e) {\n    let pid = process::pid();\n    queue.push(pid).unwrap()\n}\n\nfn main() {    \n    // Create new queue in shm\n    let queue = Shm::new(Queue::pshared())\n        .unwrap();\n\n    // Spawn processes\n    for _ in 0..10 {\n        process::spawn(|| {\n            child(queue.clone());\n        }).unwrap();    \n    }\n\n    while let Ok(Some(pid)) = queue.timed_pop(Duration::from_millis(10)) {\n        println!(\"PID {}\", pid);\n    }   \n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmersinvald%2Frust_shm_ipc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmersinvald%2Frust_shm_ipc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmersinvald%2Frust_shm_ipc/lists"}