Conversation
…andard in common.h
…on.h to include/ directory for clarity's sake
…PGs to home dir of the project
…with JPGs' localization
…tory, rather than letting it litter the project dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the complete solution for Lab 6 (Operating Systems). It implements a highly concurrent, multi-threaded simulation of a mobile robot's internal operating system, scaling from basic synchronization to Real-Time Operating System (RTOS) concepts.
Key Changes & Features
The project was developed iteratively across three levels, adhering strictly to the DRY (Don't Repeat Yourself) principle using a shared
commonlibrary.Architecture & Build System:
src/,include/,obj/,bin/,output/,scripts/).Makefilefor compiling specific simulation levels (make level1,make level2,make level3)..gitignoreto keep the repository clean from binaries and generated logs.Level 1 (
program1.c): Basic Synchronizationpthread_mutex_tandsem_tto prevent race conditions.Level 2 (
program2.c): Advanced IPC & Graceful Shutdownpthread_cond_t) for microsecond-level thread wake-ups.SIGINT(CTRL+C) interception for graceful shutdown and memory cleanup.Level 3 (
program3.c): RTOS & Lock-Free MonitoringSCHED_FIFO) granting hardware-level priority to the robot state and camera threads.stdatomic.h) for lock-free performance monitoring.Automated Testing:
scripts/run_levelX.sh) to automatically compile, run, simulateSIGINT, and analyze outputs.How to Test
chmod +x scripts/*.sh./scripts/run_level1.sh ./scripts/run_level2.sh sudo ./scripts/run_level3.sh # 'sudo' is required to grant SCHED_FIFO real-time prioritiesoutput/directory contains simulated.jpgfiles and therobot_state.txtlog without memory leaks or race conditions.Checklist:
-Wall -Wextra)pthread_joinand resource destruction