Skip to content

Adds map_shm to open and mmap a region of POSIX shared memory.#3

Open
jnfeinstein wants to merge 4 commits into
geocar:masterfrom
jnfeinstein:dev_shm
Open

Adds map_shm to open and mmap a region of POSIX shared memory.#3
jnfeinstein wants to merge 4 commits into
geocar:masterfrom
jnfeinstein:dev_shm

Conversation

@jnfeinstein
Copy link
Copy Markdown

This series of commits adds the capability to use a shared memory region instead of a file. This functionality can be used to quickly transmit large amounts of data between local processes, including instances of nodeJS.

The first commit contains all functional changes. The other commits are for documentation.

The map_shm function takes a name variable instead of an fd or file.
First, map_shm creates and/or attaches to a region of shared memory, which
returns an fd.  It then calls the usual mmap function with the fd.
Finally, it adds an unlink function to the returned buffer.  The unlink
function marks the shared memory region for deletion, once all processes
have detached using unmap (which can be called explicitly or implicitly
during destruction as usual).

All other functionality of the returned buffer remains the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant