SimpleProducerConsumer Sample

This sample demonstrates synchronization and data verification across processes and CPU cores. It builds two applications:

Source Files

File Description
SimpleIPCConsumer.c The main source file for Consumer.
SimpleIPCProducer.c The main source file for Producer.
SimpleIPCConsumer.h The header file for Consumer.
SimpleIPCProducer.h The header file for Producer.
ProducerConsumer.h The header file shared between the two applications.

Building the Sample

Build SimpleIPCProducer and SimpleIPCConsumer using any of the supported build configurations.

Running the Sample

  1. Run the producer application (SimpleIPCProducer) as either an EXE or RTSS.
  2. Run the consumer application (SimpleIPCConsumer) as either an EXE or RTSS.

Expected Results

Unexpected Results

Remarks

APIs Referenced

RTAPI

Windows-Supported

  • RtCreateSharedMemory
  • RtOpenSharedMemory
  • RtCreateEvent
  • RtWaitForMultipleObjects
  • RtSetEvent
  • QueryPerformanceCounter
  • QueryPerformanceFrequency