Commit 6343dc83 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Documentation about channel synchronization

parent c4b82911
......@@ -5,7 +5,7 @@ BLC channel
- Author : [Arnaud Blanchard](http://arnaudblanchard.thoughtsheet.com)
- Licence : [CeCILL v2.1](http://www.cecill.info/licences/Licence_CeCILL_V2-en.html)
Functions to easily share data through shared memory (shm_... functions). The advantage is that it is the fastest and the more econom in memory ( no copy in each process ) way to share informtation between processes. At this moment it only works in asynchronous mode.
Functions to easily share data through shared memory (shm_... functions). It is the fastest, and the more econom in memory ( no copy in each process ), way to share informtation between processes. At this moment it only works in asynchronous mode.
The idea is that you have a structure blc_channel which is like a blc_array ( https://framagit.org/blaar/blc_core/blob/master/t_array/main.cpp ) but has a name starting with '/' to identificate it on your system.
......@@ -50,6 +50,24 @@ You will see all the existing blc_channels, the process reading or writing and t
On Linux we can see and manipulate a virtual file containing this memory in /run/shm/<name of your shared memory>, on OSX you cannot but anyway it is only used for debug.
Synchronisation
===============
Two semaphores associated to the shared memory are created:
- `blc_channle<id>_new_data0` which indicates that new data is available on the shared memory
- `blc_channle<id>_ack_data0` which acknowledges that the data has been read
Proccesses which do not consider synchronisation use starting char '/'
`[writer]/->[reader]` means no synchronization
`[writer].->[reader]` means the reader waits for new data from the writer
`[writer]^->[reader]` means the writer waits for the reader to read and acknowledge the data
`[writer]:->[reader]` means both direction synchronization. The writer waits for acknowledgement and the reader wait for new data from the writer.
C/C++ documentation
===================
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment