Skip to content

Commit

Permalink
Formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Jan 10, 2024
1 parent bcb05a3 commit cefa5c4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions examples/C/src/shared-memory/SharedMemory.lf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/**
* The POSIX Realtime Extension includes a mechanism for processes on a single machine
* to share memory. A writer opens a "file" using `shm_open` and then uses `mmap` to
* map a sequence of memory addresses to the contents of this in-memory file. The `mmap`
* function returns a pointer to this memory, which the writer can then use to store data.
*
* A reader needs only the file name to open the file using `shm_open`, which it can then
* also map to memory locations using `mmap`.
*
* This example shows how you can safely use this mechanism to exchange large chunks of
* data between LF federates without serializing, streaming, and then deserializing the
* data. The Sender reactor creates a file name using the current logical time (to ensure
* uniqueness, assuming no use of microsteps). It populates the shared memory with data
* and then sends the filename to the Reader. The Reader will only receive the file name
* after the Sender has finished writing to it, so precedence constraints are satisfied.
*
* The POSIX Realtime Extension includes a mechanism for processes on a single machine to share
* memory. A writer opens a "file" using `shm_open` and then uses `mmap` to map a sequence of memory
* addresses to the contents of this in-memory file. The `mmap` function returns a pointer to this
* memory, which the writer can then use to store data.
*
* A reader needs only the file name to open the file using `shm_open`, which it can then also map
* to memory locations using `mmap`.
*
* This example shows how you can safely use this mechanism to exchange large chunks of data between
* LF federates without serializing, streaming, and then deserializing the data. The Sender reactor
* creates a file name using the current logical time (to ensure uniqueness, assuming no use of
* microsteps). It populates the shared memory with data and then sends the filename to the Reader.
* The Reader will only receive the file name after the Sender has finished writing to it, so
* precedence constraints are satisfied.
*
* @author Edward A. Lee
*/
target C {
Expand Down

0 comments on commit cefa5c4

Please sign in to comment.