ConcurrencyFull

Description

Flashcards on ConcurrencyFull, created by Shez F on 11/05/2017.
Shez F
Flashcards by Shez F, updated more than 1 year ago
Shez F
Created by Shez F almost 7 years ago
16
0

Resource summary

Question Answer
What is 211 A drop out module lol
Define Concurrency 1 - Is a way on how multiple, independent processes behave when running and interacting with each other
How can we use Java Threads 1 - Define a class which Implements Runnable 2 - Create your objects 2 - Implementation of a run() method
What is a Processor 1 - Device that runs instructions and can have multiple processes
What is a Process and where does it reside 1 - Active system entity 2 - Resides in main memory
What is a Program 1 - Literal Application or system 2 - Program may be executed by multiple processes at the same time
What is the Difference between Parallel and Concurrent 1 - Parallel is multiple processes executing simultaneously. All of them execute 2 - Concurrency is that multiple processes are underway and can execute at a given instant
What does a Scheduler guarantee and not guarantee 1 - Guarantees that the code will eventually run. 2 - Doesn't guarantee fairness and timeliness. 3 - Fairness - run at the same time 4 - timeliness - complete in a desirable time frame
What is Safe Concurrency 1 - No shared data or communication 2 - Read only data
What is Risky Concurrency 1 - There is a shared resource and there is no synchronization 2 - A resource which can be modified by 1 or more threads
What is Synchronization 1 - Mechanism to ensure multiple processes or threads do not simultaneously execute
What is Competition 1 - Competing for a variable that 2 processes want to read or update simultaneously 2 - Ensures multiple threads don't execute within the critical section
What is Coordination 1 - One process tells another process that a result is now available
What's the critical section 1 - Region of code that you want protected from shared resource access
What is a Race Condition 1 - When more than 1 thread can access the critical section at the same time 2 - error that occurs when multiple processes are racing in an uncontrolled manner
What is the Difference between indeterminate and deterministic results 1 - Indeterminate - We may get different results everytime 2 - Determinate - We get the same result every time
What is Mutual Exclusion 1 - Where only one thread can run with in the critical section
What is bounded waiting 1 - Threads waiting to enter the section will eventually enter 2 - Threads which are in the section will eventually leave
What is Atomicity and a solution for this 1 - Where person X and Y are writing a novel 2 - Must ensure that they do not work on the same chapter 3 - A solution could be mutual exclusion
What is Conditional Synchronization 1 - Where one thread must finish before another thread starts
Problems and solutions for concurrency management 1 - Competition -> Mutex 2 - Coordination - Cond Sync
Define Locks 1 - Mutual exclusion mechanism that limits resource access in a multi-threaded environment
Name and Describe the 2 states of a Lock 1 - Held - A thread is in the critical section. No one should enter 2 - Not Held - No thread is in the section. Thread can enter
Name and describe 2 operations of the Lock 1 - Acquire - Mark the lock as held 2 - Release - mark the lock as not held
How can you declare a Lock 1 - Like a variable 2 - Lock L
Where do you call Acquire and Release in the Critical section 1 - Call acquire at the start of the section 2 - Call release at the end of the section
What is the Synchronized statement and where is it called 1 - A mutual exclusion in java. 2 - Like an implicit lock 3 - used by the "synchronized" key word. eg public void SYNCHRONIZED
What is Context switching 1 - The idea of switching to threads and processes RE READ THIS TOPIC....
What is the 3 step context switching sequence 1 - De-Schedule current thread 2 - Scheduler selects best ready thread to run using priority, time slicing 3 - Resume new selected thread
What is a Semaphore 1 - Locks provide mutex 2 - Semaphores is the ability to have more than 1 lock. 3 - Allows multiple threads to enter the critical section
Why would be use semaphores and the problems that can occur 1 - may want more threads or place ordering 2 - Problems such as the producer consumer problem
What are the operations of the semaphore 1 - Wait() - Decrements the counter by 1. If the counter is at 0. No more threads can enter. Threads are put into the queue 2 - Signal() - Increments the counter by 1.
What happens when Wait() is called by a thread 1 - If semaphore is open, continue 2 - If semaphore closed, then go to the queue
What happens when Signal() is called 1 - If thread is on queue, then unblock it 2 - If there is no queue, then remember it for next thread
What are the operations of an intrinsic wait queue and what does each one do 1 - Object.wait() - put thread to a stack 2 - Object.Notify() - take threads from stack and make it runnable
What is a Spurious Wakeup 1 - Wake up all threads that you dont want to wake up 2 - Done via the NotifAll() 3 - Doesnt re-check the condition
What is the Producer Consumer Problem 1 - producer creates 2 - Consumer will take 3 - Consumer cant take anything if nothing is there 4 - if full, stop producing 5 - if empty stop consuming
Define what is Message Passing 1 - Type of interprocess communication 2 - Processes communicate by sending and receiving messages using primitives
How does Message Passing work 1 - Processes communicate by sending and receiving message
Define the Different channels of Message Passing 1 - Local memory channel - When interacting processes are located on the same processor 2 - Physical communication - When interacting processes are located on different processors
What are the Primitives of Message passing 1 - Send - Send message to channel - send(msg, chan) 2 - Receive - Receive a value from a channel - var = receive (chan)
What is the Difference between synchronous and asynchronous 1 - synchronous is that the sender and receiver wait for each other 2 - asynchronous is that the sender and receiver do not wait for each other
What happens in a Blocking Operation in Message Passing 1 - Send - blocks until message received by receiver 2 - Receive - Blocks until message is available
What happens in a non-blocking operations 1 - Send - Process resumes with life after message is sent 2 - Receiver retrieves valid message
What are the problems with Synchronous 1 - Reduced concurrency - When 2 processes communicate, one of them will have to block
What are the problems with Asynchronous Acknowledgement - Receiver cannot know anything about state of sender. Sender has no way of knowing if message was sent or received unless receiver replies back
What is a spin lock 1 - Lock that keeps spinning and checking if its free or not 2 - Improves performance and CPU usage
What does Spin locking Violate and possible solutions for this 1 - Violates mutual exclusion as there could be 2 threads with the same lock 2 - Solutions could include disable interrupts
What is disable interrupts 1 - No context switch in critical section 2 - Really bad
What is a Blocking lock and advantage s and disadvantages of it 1 - Scheduler blocks threads while they wait 2 - Good for long sections 3 - bad if locks are accessed a lot of time
What is a Spinning lock and advantage s and disadvantages of it 1 - Loop a lock until acquiring 2 - Good for short section 3 - Costly for long sections
What is a monitor, an example of a monitor and difference between a monitor and a lock 1 - Monitor can perform mutex 2 - Example of a monitor is the synchronized keyword 3 - Monitor is a construct 4 - Lock is a primitive
What is the Thundering Herd Problem 1 - When you do notifyAll() 2 - Stampede to the section, 3 - waste of cpu cycles
What is a Barrier 1 - Processes cannot proceed the barrier until all threads have reached the barrier 2 - How you cooperate
What is a Priority Based Barrier 1 - Allows us to choose which thread with the highest priority can resume and proceed with the barrier
What is a bounded barrier 1 - The limit on the amount of threads in a barrier
What is a User Thread and advantage sna disadvantages of this. What is it most useful for 1 - Supported in user level library 2 - Advantage - No OS Support required - Cheap context switch 3 - Disadvantage - cant execute on a multicore lmao 4 - useful for GUI servers and web servers
What is a Kernel Thread and advantage sna disadvantages of this. What is it most useful for 1 - Only knows about the process, is pre emptible 2 - advantage - more concurrent 3 - disadvantage -
What is a deadlock, how we deal with them 1 - 2 or more threads forever waiting 2 - ABBA - lock lock unlock unlock 3 - PRogram design so circular wait never occurs
What is a livelock 1 - Process cannot make progress 2 - Livelock can be solved,
What is starvation 1 - Process isn't getting regular access to shared resource enough
Show full summary Hide full summary

Similar

BIOLOGY B1 5 AND 6
x_clairey_x
CHEMISTRY C1 2
x_clairey_x
A Level: English language and literature technique = Dramatic terms
Jessica 'JessieB
AQA GCSE Biology B1 unit 1
Olivia Phillips
Summary of Definitions/Key Terms for the PMP Exam
Andrea Leyden
Physics: Energy resources and energy transfer
katgads
Peace and Conflict Flashcards - Edexcel GCSE Religious Studies Unit 8
nicolalennon12
GCSE REVISION TIMETABLE
neharaniga
Introduction to the Atom
Derek Cumberbatch
2PR101 1.test - 4. část
Nikola Truong
1PR101 2.test - Část 20.
Nikola Truong