Concurrency vs. Parallelism: Concurrency is about managing multiple tasks at the same time, while parallelism is about executing multiple tasks simultaneously.
Threads and Processes: Threads are the smallest unit of execution within a process, sharing the same memory space. Processes are independent execution units with their own memory space.
Synchronization: Techniques to control the access of multiple threads to shared resources to prevent conflicts.
Critical Section:
Definition: A critical section is a part of the code that accesses shared resources and must not be executed by more than one thread at a time.
Implementation: Use synchronization mechanisms like locks (mutexes), and monitors to ensure that only one thread can enter the critical section at a time.
Threads Synchronization:
Locks (Mutexes): Ensure mutual exclusion by allowing only one thread to access a resource at a time.
Semaphores: Counting mechanisms that control access to a resource by multiple threads.
Monitors: High-level synchronization constructs that combine mutual exclusion and condition variables.
Threads Communication:
Shared Memory: Threads communicate by reading and writing to shared variables. Requires careful synchronization to avoid race conditions.
Message Passing: Threads or processes communicate by sending messages to each other, which can help avoid issues related to shared memory.
Real-Time Programming:
Definition: Real-time programming involves writing software that guarantees response within strict timing constraints.
Types:
Hard Real-Time: Systems where missing a deadline can lead to catastrophic failures (e.g., medical devices, automotive systems).
Soft Real-Time: Systems where deadlines are important but not critical (e.g., video streaming).
Techniques:
Priority Scheduling: Assigning priorities to tasks to ensure critical tasks are executed first.
Deterministic Behavior: Ensuring that the system's behavior is predictable and consistent.
Describe problem
Project structure must be defined
Describe the solution you'd like
Proposed structure:
Fundamentals:
Critical Section:
Threads Synchronization:
Threads Communication:
Real-Time Programming:
List of tasks to be accomplished