
\begin{DoxyItemize}
\item infos = Information about the semlock plugin is in keys below
\item infos/author = Kurt Micheli \href{mailto:kurt.micheli@libelektra.org}{\tt kurt.\+micheli@libelektra.\+org}
\item infos/licence = B\+SD
\item infos/needs =
\item infos/provides =
\item infos/placements = pregetstorage postgetstorage presetstorage postcommit postrollback
\item infos/status = unittest global experimental unfinished nodoc -\/10000
\item infos/description = locks files during usage
\end{DoxyItemize}

This global semlock plugin introduces a read lock while {\ttfamily G\+ET} and a read/write lock while {\ttfamily S\+ET}.

A semaphore is used for the synchronisation and the implemented algorithm favors the writer, because updates should be propagated soon as possible.

The algorithm is described \href{https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem#Second_readers-writers_problem}{\tt here}.

The usage of this plugin could lead to deadlocks, due to an ongoing discussion (-\/10000) (\href{https://github.com/ElektraInitiative/libelektra/pull/555}{\tt Link}).

\subsection*{/dev/shm}

Is the location where the semaphores will be saved. {\ttfamily /dev/shm} should be mounted as tempfs, otherwise the semaphores can not be created (this issue only appears on older systems). More information \href{http://stackoverflow.com/questions/270113/how-do-i-stop-sem-open-failing-with-enosys}{\tt here}. 