Skip to content

Commit a66d562

Browse files
committed
add POSIX shared memory example and note
1 parent 11dc049 commit a66d562

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

synchro.tex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@
668668
\begin{itemize}
669669
\item \emsl{POSIX shared memory} accessible via \funnm{shm\_open}()
670670
\item \emsl{POSIX queues} \dots{} \funnm{mq\_open}(),
671-
\funnm{mq\_send}(), \funnm{mq\_receive}(), \dots{}
671+
\funnm{mq\_send}(), \funnm{mq\_receive}(), \dots{}
672672
\item \emsl{System V APIs} for queues, shared memory, and semaphores
673673
\end{itemize}
674674
\item \emsl{sockets} come from the BSD world and allow communication in various
@@ -692,6 +692,12 @@
692692
same system only. It has some interesting features - not only it can be used for
693693
inter-process communication however it can be used in kernel to request a
694694
service from a userland program.
695+
\item \texttt{shm\_open} returns file descriptor that can be then
696+
mapped into process memory via \texttt{mmap} (see page \pageref{MMAP}).
697+
See \example{shm/shm.c}.
698+
On Linux, the shared segment is visible under \texttt{/dev/shm/} directory,
699+
along with size and permissions. \texttt{shm\_unlink} destroys the shared
700+
memory segment.
695701
\end{itemize}
696702

697703
\hlabel{SYNCHRONIZATIONEND}

0 commit comments

Comments
 (0)