1/17
Flashcards about concurrent programming in real-time and embedded systems.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
How does Arduino programming handle concurrency?
Uses a single processor without scheduling and concurrency is with interrupts.
What do more sophisticated systems use instead of Arduino's simple programming?
More sophisticated systems use a RTOS which provides many of the features of operating systems.
What are some potential issues with concurrency?
Deadlocks, race conditions, memory or cache consistency.
What happens in a multithreaded environment when multiple threads access the same resource?
Each thread has its own local thread stack and registers. Accessing the same resource for read and write may result in incorrect values.
What are some methods for synchronizing interrupts?
Disable and enable interrupts, interrupt priorities, and declaring variables to be volatile.
What are the methods for synchronization on different processes?
Event, Mutex, Semaphore
What is the method for synchronization on the same process?
Critical Section
What is a Mutex?
A thread synchronization object that allows only one thread at a time to access a resource.
What are Condition Variables & Monitors?
Code region controlled by a mutex, with wait/notify functionality.
What is a Semaphore?
A thread synchronization object that allows zero to any number of threads access simultaneously.
What are some issues or problems in allowing tasks to send messages to another task?
Representing messages, fixing buffer size, determining who needs to wait, minimizing synchronization and overhead, and efficient implementation.
How can messages be managed?
Fixed size: easy. Variable size: include the length either directly or indirectly.
What does a fixed sized circular buffer use?
Start data pointer and end data pointer in common shared memory.
Why is synchronization needed for read/write operations?
Ordered processing and synchronized (atomic) read/write operation if more than one reader or writer.
How do synchronized threads communicate with each other in Java?
Using wait(), notify(), and notifyAll() methods.
What are the synchronization problems?
Deadlock, Race Conditions, Priority Inversion, Performance
What is priority inversion?
When a higher-priority ready task fails to run when it should.
What are the common methods for fixing Priority Inversion?
Priority inheritance and priority ceiling.