Skip to content

Commit

Permalink
add POSIX shared memory example and note
Browse files Browse the repository at this point in the history
  • Loading branch information
vladak committed Nov 26, 2023
1 parent 11dc049 commit a66d562
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion synchro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@
\begin{itemize}
\item \emsl{POSIX shared memory} accessible via \funnm{shm\_open}()
\item \emsl{POSIX queues} \dots{} \funnm{mq\_open}(),
\funnm{mq\_send}(), \funnm{mq\_receive}(), \dots{}
\funnm{mq\_send}(), \funnm{mq\_receive}(), \dots{}
\item \emsl{System V APIs} for queues, shared memory, and semaphores
\end{itemize}
\item \emsl{sockets} come from the BSD world and allow communication in various
Expand All @@ -692,6 +692,12 @@
same system only. It has some interesting features - not only it can be used for
inter-process communication however it can be used in kernel to request a
service from a userland program.
\item \texttt{shm\_open} returns file descriptor that can be then
mapped into process memory via \texttt{mmap} (see page \pageref{MMAP}).
See \example{shm/shm.c}.
On Linux, the shared segment is visible under \texttt{/dev/shm/} directory,
along with size and permissions. \texttt{shm\_unlink} destroys the shared
memory segment.
\end{itemize}

\hlabel{SYNCHRONIZATIONEND}
Expand Down

0 comments on commit a66d562

Please sign in to comment.