How crr004/bowling-game works
Main components
• Process Manager: The central process “A” which initiates the game and spawns child processes.
• Child Processes: Each pin in the bowling game is represented as a process (e.g., B, C, D, etc.). The README provides two different trees: one representing the actual process tree and another representing the “logical” pyramid of pins.
• Signal Handling Module: The mechanism by which SIGTERM is sent to a chosen process (pin) to trigger downstream propagation.
• User Interaction: The terminal interface that starts the game (executing “./bolos”) and then the user’s subsequent use of system utilities (ps, kill) to interact with the processes.
Relationships and interactions
• How the signal is sent from the user to process A (or one of its children, based on PID lookup) and then how each process conditionally propagates that signal down to one or both of its children.
Architectural patterns/design principles
• Process Tree Structure: The use of a hierarchical process tree is central—both the actual system process tree (parent-child relationships) and the logical gameplay pyramid.
• Asynchronous Event Handling: The reliance on system signals (SIGTERM) for inter-process communication leverages asynchronous event handling.
• Modularity: Even though the implementation is in a single C file, the logical separation (initialization, process creation, signal handling) should be clearly represented.
Relevant technologies and system calls
• C Programming Language
• System Calls (fork, kill, signal handling functions)
• Standard Unix/Linux utilities (ps for listing processes) and signal sending.