Tutorial¶
Welcome to the ZeroIPC tutorial! This hands-on guide will take you from basics to advanced usage through practical examples.
What You'll Learn¶
This tutorial covers:
- Your First Shared Memory - Create and access shared memory
- Working with Arrays - Store and access array data
- Using Queues and Stacks - FIFO and LIFO data structures
- Reactive Streams - Event-driven programming with streams
- Synchronization Primitives - Semaphores, barriers, and latches
- Advanced Patterns - Real-world usage patterns
Prerequisites¶
Before starting:
- Completed: Installation
- Completed: Quick Start
- Understood: Basic Concepts
Tutorial Structure¶
Each lesson follows this structure:
- Concept - What you'll learn
- Code - Working examples in C++ and Python
- Explanation - How it works
- Exercise - Try it yourself
- Common Pitfalls - What to avoid
Learning Path¶
Beginners¶
Start from the beginning and work through in order: 1. First Shared Memory 2. Working with Arrays 3. Using Queues and Stacks 4. Synchronization Primitives
Intermediate¶
If you're familiar with shared memory: 1. Skim First Shared Memory 2. Focus on Reactive Streams 3. Study Advanced Patterns
Language-Specific¶
C++ Developers: - Focus on template usage - Pay attention to memory ordering - Study lock-free implementations
Python Developers: - Understand NumPy dtype mapping - Focus on duck typing examples - Note type consistency requirements
Example Project¶
Throughout the tutorial, we'll build a complete example: a real-time sensor monitoring system with:
- C++ sensor simulator (producer)
- Python data processor (consumer)
- Real-time visualization
- Alert generation
- Historical data storage
By the end, you'll have a working multi-process application!
Code Examples¶
All examples are available in the repository:
cd examples/tutorial/
ls -la
# lesson01_first_memory/
# lesson02_arrays/
# lesson03_queues_stacks/
# lesson04_streams/
# lesson05_sync/
# lesson06_advanced/
Each lesson includes: - Working C++ code - Working Python code - Build scripts - README with instructions
Tips for Success¶
- Type along - Don't just read, write the code yourself
- Experiment - Modify examples and see what happens
- Use the CLI - Inspect structures with
zeroipcas you go - Read errors - Error messages are helpful, not punishing
- Ask questions - Check GitHub Discussions if stuck
Common Questions¶
Q: Do I need to know both C++ and Python?
A: No! Pick one language and focus on those examples. The concepts apply to both.
Q: Can I skip lessons?
A: Yes, but each lesson builds on previous ones. Skipping may cause confusion.
Q: How long does the tutorial take?
A: About 2-3 hours for all lessons, depending on your pace.
Q: What if I get stuck?
A: Check the Common Pitfalls page and GitHub Issues.
Let's Begin!¶
Ready to start? Head to Your First Shared Memory to begin the tutorial!