Skip to content

feat: stabilize shop simulation and add CI demo#1

Merged
Yurii-Kor merged 8 commits into
mainfrom
feature/shop-simulation-demo
Jun 15, 2026
Merged

feat: stabilize shop simulation and add CI demo#1
Yurii-Kor merged 8 commits into
mainfrom
feature/shop-simulation-demo

Conversation

@Yurii-Kor

Copy link
Copy Markdown
Owner

Summary

This pull request turns the original Shop Simulator into a reliable, runnable concurrency demo.

Changes

  • corrected interprocess readers-writers synchronization;
  • introduced a turnstile-based locking scheme using System V semaphores;
  • moved shared reader counters into shared memory;
  • added graceful shutdown for child and manager processes;
  • fixed concurrent sales-agent order revalidation;
  • removed obsolete writer counters, semaphores, and IPC key files;
  • added runtime IPC token-file creation;
  • improved argument validation and error handling;
  • added a GitHub Actions pipeline with separate build and simulation jobs;
  • uploaded the compiled binary and simulation log as workflow artifacts.

Validation

  • compiled with GCC using -Wall, -Wextra, -Wpedantic, and -Werror;
  • tested locally with normal and maximum configurations;
  • verified manual interruption with Ctrl+C;
  • verified automatic completion without deadlocks;
  • confirmed successful GitHub Actions build and simulation runs.

Validate parsed argument values and allocate child PID storage based on the final customer and sales agent counts.
Store reader and waiting-writer counters in shared memory.
Use blocking System V semaphore operations, initialize semaphore values explicitly, and allow child processes to finish active operations before terminating.
Use a turnstile-based locking scheme with shared reader state and blocking System V semaphores. Revalidate concurrent order updates and support graceful shutdown for child and manager processes.
Remove unused waiting-writer counters, writer semaphores, and obsolete request parameters after adopting the turnstile-based readers-writers scheme.
@Yurii-Kor
Yurii-Kor merged commit e1c2ad8 into main Jun 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant