Operating System Synchronization and Scheduling Concepts
CPU Scheduling and Timing Metrics
CPU Scheduling is the process of deciding which of the processes in the ready queue should be allocated to the CPU for execution. It is necessary when a process switches from running to waiting, terminates, or when a new process is created.
Scheduling Criteria (Times)
The performance of a CPU scheduler is measured using several metrics, often expressed in terms of time:
- CPU Utilization: The fraction of time the CPU is busy executing processes. (Goal: Maximize)
- Throughput:
Android Development Essentials: Components, Data, and Deployment
ListView vs. RecyclerView: A Comparison
ListView (Legacy Component)
ListView is an older Android component used to display a simple vertical list. It has limited performance and customization and manually handles view reuse.
ListView Example: Layout (activity_main.xml)
(Layout definition for ListView goes here)
ListView Example: Implementation (MainActivity.java)
ListView listView = findViewById(R.id.listView);
String[] data = {“Apple”, “Banana”, “Mango”};
ArrayAdapter<String> adapter =
new
Essential C Programming Concepts and Syntax
C Programming Fundamentals
Q-1: Structure of a C Program
A C program follows a specific hierarchical structure to ensure the compiler understands how to process the code.
- Documentation Section: Contains comments (e.g.,
/* author name */) explaining the program’s purpose. - Link Section: Includes header files using
#include(e.g.,<stdio.h>) to use built-in functions likeprintf. - Definition Section: Where symbolic constants are defined using
#define. - Global Declaration Section: Variables or functions
Fundamentals of Computers, Hardware, Software & Trends
Fundamentals of Computers
💻 Introduction to the Computer
A computer is an electronic device that is programmed to accept raw data as input, process it according to a set of instructions (a program), and produce a result (output), which can then be saved for future use (storage). The word “computer” comes from the word “compute,” which essentially means “to calculate.”
Key Characteristics of a Computer
- Speed: Computers can process data at extremely high speeds, measured in microseconds, nanoseconds,
Early Programming Languages and Implementation Methods
FORTRAN
FORTRAN: FORmula TRANslation; scientific computing (arrays, loops, floats); Ideas – compiled code for speed; DO loop; subprograms; formatted I/O. Legacy: foundation of scientific programming.
ALGOL 60
ALGOL 60: ALGOrithmic Language; first machine-independent language; Introduced: block structure, recursion, BNF, format types, compound statements (begin…end); Legacy: basis for imperative languages.
COBOL
COBOL: COmmon Business-Oriented Language; business/data processing; English-like syntax,
Read MoreMastering Python Control Flow: Loops and Conditionals
🐍 Python Loop and Branching Statements
Python provides powerful structures for iteration (loops) and flow control (branching statements) that allow you to execute blocks of code repeatedly or conditionally.
Python Loop Statements
Loops are used to execute a block of code multiple times. The main loop types in Python are while and for.
1. The while Loop
The while loop repeatedly executes a block of statements as long as a given condition is True.
- Syntax:
while condition: # statement(s) to be executed
Key
Read More