How amritesh-mishra-15/schedsync works
Purpose and Runtime
SchedSync is an Electron desktop simulator for demonstrating how CPU scheduling and memory paging interact, including configurable page-fault stalls. It runs entirely as a local HTML/CSS/vanilla-JavaScript renderer application; no backend or external runtime services are indicated. Electron 28 is the material platform, launched through main.js, with a renderer bridge at preload.js.
Application Entry and Renderer Composition
Electron creates the desktop window and loads the renderer page. The renderer’s structural entry point is src/index.html; its application bootstrap and UI wiring are in src/js/app.js. The app is organized as an input/configuration sidebar plus visualization and control surfaces, styled by src/styles/base.css, src/styles/input-panel.css, and src/styles/visualization.css.
Process and Configuration Boundary
Process creation, validation, removal, and local process-list state belong to src/js/process-manager.js. Renderer form handling in src/js/app.js collects CPU algorithm, paging algorithm, frame count, fault-stall duration, and scheduling-specific options such as quantum. This is the boundary between user-authored workload/configuration and simulation execution.
Simulation Orchestrator
src/js/simulation-engine.js is the core stateful coordinator. On each simulation tick, it determines process eligibility/running state, invokes the selected scheduler, performs page access, applies hit/fault outcomes, and inserts configured stall ticks for faults. It produces the execution state consumed by visualizations and performance metrics, including waiting/turnaround timing, fault counts, and idle time.
CPU Scheduling Strategy Layer
Scheduling policy is separated into algorithm modules selected by the engine:
• src/js/algorithms/fcfs.js
• src/js/algorithms/sjf.js
• src/js/algorithms/srtf.js
• src/js/algorithms/round-robin.js
• src/js/algorithms/priority.js
These modules define dispatch/preemption behavior while the engine retains integrated time, process, and paging-stall control. This separation allows CPU policy changes without rewriting memory or rendering logic.
Memory Paging Strategy Layer
Page-frame replacement is likewise isolated:
• src/js/algorithms/fifo-paging.js
• src/js/algorithms/lru-paging.js
For a running process’s reference string, the engine asks the chosen policy to identify a hit or fault and update frame contents. Faults feed back into CPU execution through the stall mechanism, rather than being rendered as independent memory-only events.
Controls, Visualization, and Presentation
src/js/controls.js maps Step, Play/Pause, Reset, and speed selection to engine advancement, including timer-driven auto-run. Incremental renderer modules project engine state without owning scheduling decisions:
• src/js/visualization/gantt-chart.js
• src/js/visualization/ready-queue.js
• src/js/visualization/memory-frames.js
The Gantt timeline reflects execution and stalls; ready queue reflects running/waiting state; memory frames show accesses, hits/faults, and page log. src/js/theme.js manages persisted light/dark UI state, with tokens in src/styles/variables.css.
Main entry points: simulation-engine.js Simulation engine · app.js App bootstrap · main.js Electron main process · index.html Renderer page
Components 19
Electron Shell
- Electron main process · Creates the desktop window and loads the renderer.
main.js - Renderer bridge
preload.js
Renderer App
- Renderer page
src/index.html - App bootstrap · Wires configuration, controls, engine, and views.
src/js/app.js - Process manager · Creates, validates, removes, and stores processes.
src/js/process-manager.js - Simulation controls · Maps step, auto-run, reset, and speed actions to engine advancement.
src/js/controls.js - Simulation engine · Coordinates ticks, dispatch, page access, fault stalls, and metrics.
src/js/simulation-engine.js
CPU Scheduling
- FCFS
src/js/algorithms/fcfs.js - SJF
src/js/algorithms/sjf.js - SRTF
src/js/algorithms/srtf.js - Round Robin
src/js/algorithms/round-robin.js - Priority
src/js/algorithms/priority.js
Memory Paging
- FIFO paging
src/js/algorithms/fifo-paging.js - LRU paging
src/js/algorithms/lru-paging.js
Presentation
- Gantt chart · Shows execution intervals and fault stalls.
src/js/visualization/gantt-chart.js - Ready queue · Shows running and waiting processes.
src/js/visualization/ready-queue.js - Memory frames · Shows frames, hit/fault outcomes, and page log.
src/js/visualization/memory-frames.js - Theme state · Persists light/dark renderer state.
src/js/theme.js - UI styles · Defines shared tokens, input panel, and visualization styling.
src/styles/variables.css
Connections 20
- Electron main process → Renderer bridge: attaches
- Electron main process → Renderer page: loads
- Renderer page → App bootstrap: boots
- App bootstrap → Process manager: submits workload
- App bootstrap → Simulation controls: wires actions
- App bootstrap → Simulation engine: configures simulation
- Process manager → Simulation engine: provides processes
- Simulation controls → Simulation engine: advance, reset, auto-run
- Simulation engine → FCFS: selects policy
- Simulation engine → SJF: selects policy
- Simulation engine → SRTF: selects policy
- Simulation engine → Round Robin: selects policy
- Simulation engine → Priority: selects policy
- Simulation engine → FIFO paging: selects policy
- Simulation engine → LRU paging: selects policy
- Simulation engine → Gantt chart: execution and stalls
- Simulation engine → Ready queue: queue state
- Simulation engine → Memory frames: frame and access state
- App bootstrap → Theme state: initializes
- Theme state → UI styles: applies theme tokens