Skip to content

Commit dd82cdc

Browse files
authored
Update README.md
1 parent a186a37 commit dd82cdc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Both for Python (see `prodcon_ipc` package) and C++ (see `*_ipc.{h,cpp}`files in
1313

1414
In the accompanying example applications, the producer "produces" an image by loading them from a file from disk (when the user triggers it) and the consumer "consumes" these images by displaying them in the UI. The C++ application is designed in a threaded fashion so that it spawns a separate thread which waits for the system semaphore to be signaled to not block the UI thread. The Python consumer however (still) blocks (because [threads in Python are a topic on its own](https://realpython.com/python-gil/#the-impact-on-multi-threaded-python-programs)) when the user clicks the button at the bottom of the UI to activate the waiting (blocking). (It blocks until an image was "produced".)
1515

16+
As a further extension, the C++ consumer and the Python producer examples have been extended to exchange structured data via [cppystruct](https://github.com/karkason/cppystruct) and [Python.struct](https://docs.python.org/3/library/struct.html). This way, `struct` like data can be exchanged (written and read from both sides) easily. In this example, the producer increases a counter for every "produced" image and updates/writes the file name of the produced image into the "struct". On the other side, the consumer sets a "stop flag" to `true` if it gets terminated. This way, when the producer produces its next image, it exists as well. The format of the struct is specified as string (here: "`<I?30s`" which means data is stored in little endian order (`<`), a uint32_t first (`I`), followed by a boolean (`?`), and finally a fixed 30 byte string (`30s`)).
17+
1618
# Installation <a name="install"/>
1719
Install Qt5, PyQt5, CMake and a compiler (gcc or clang) on your system. Either compile the sources manually or use the provided `run.sh` script to compile and run it. The compiled C++ application will be placed in `build/shared_memory_cpp`. The Python application is `shared_memory.py`.
1820

0 commit comments

Comments
 (0)