topic 4: concurrency
DESCRIPTION
Cloud Computing Workshop 2013, ITUTRANSCRIPT
4: Concurrency
Zubair Nabi
April 18, 2013
Zubair Nabi 4: Concurrency April 18, 2013 1 / 22
Outline
1 Introduction
2 Concurrency in Practice
3 Liveness
4 Message passing
5 Transactions
Zubair Nabi 4: Concurrency April 18, 2013 2 / 22
Outline
1 Introduction
2 Concurrency in Practice
3 Liveness
4 Message passing
5 Transactions
Zubair Nabi 4: Concurrency April 18, 2013 3 / 22
Execution
ProcessI Program in execution
I Unit of protection and resource allocationI Private address space and one or more threads
ThreadI An entity managed by the schedulerI Represents an individual execution contextI Runs within the address space of the containing process
Zubair Nabi 4: Concurrency April 18, 2013 4 / 22
Execution
ProcessI Program in executionI Unit of protection and resource allocation
I Private address space and one or more threads
ThreadI An entity managed by the schedulerI Represents an individual execution contextI Runs within the address space of the containing process
Zubair Nabi 4: Concurrency April 18, 2013 4 / 22
Execution
ProcessI Program in executionI Unit of protection and resource allocationI Private address space and one or more threads
ThreadI An entity managed by the schedulerI Represents an individual execution contextI Runs within the address space of the containing process
Zubair Nabi 4: Concurrency April 18, 2013 4 / 22
Execution
ProcessI Program in executionI Unit of protection and resource allocationI Private address space and one or more threads
ThreadI An entity managed by the scheduler
I Represents an individual execution contextI Runs within the address space of the containing process
Zubair Nabi 4: Concurrency April 18, 2013 4 / 22
Execution
ProcessI Program in executionI Unit of protection and resource allocationI Private address space and one or more threads
ThreadI An entity managed by the schedulerI Represents an individual execution context
I Runs within the address space of the containing process
Zubair Nabi 4: Concurrency April 18, 2013 4 / 22
Execution
ProcessI Program in executionI Unit of protection and resource allocationI Private address space and one or more threads
ThreadI An entity managed by the schedulerI Represents an individual execution contextI Runs within the address space of the containing process
Zubair Nabi 4: Concurrency April 18, 2013 4 / 22
Concurrency
Seemingly doing many things at once
With a single processor: Interleaving of different executions1 Process/OS2 Inter-process3 Intra-process
With multiple processorsI True parallelism
Zubair Nabi 4: Concurrency April 18, 2013 5 / 22
Concurrency
Seemingly doing many things at onceWith a single processor: Interleaving of different executions
1 Process/OS2 Inter-process3 Intra-process
With multiple processorsI True parallelism
Zubair Nabi 4: Concurrency April 18, 2013 5 / 22
Concurrency
Seemingly doing many things at onceWith a single processor: Interleaving of different executions
1 Process/OS
2 Inter-process3 Intra-process
With multiple processorsI True parallelism
Zubair Nabi 4: Concurrency April 18, 2013 5 / 22
Concurrency
Seemingly doing many things at onceWith a single processor: Interleaving of different executions
1 Process/OS2 Inter-process
3 Intra-process
With multiple processorsI True parallelism
Zubair Nabi 4: Concurrency April 18, 2013 5 / 22
Concurrency
Seemingly doing many things at onceWith a single processor: Interleaving of different executions
1 Process/OS2 Inter-process3 Intra-process
With multiple processorsI True parallelism
Zubair Nabi 4: Concurrency April 18, 2013 5 / 22
Concurrency
Seemingly doing many things at onceWith a single processor: Interleaving of different executions
1 Process/OS2 Inter-process3 Intra-process
With multiple processorsI True parallelism
Zubair Nabi 4: Concurrency April 18, 2013 5 / 22
Advantages
Overlap computation and I/O
Simplify code structuring
Improve responsiveness
Seamless use of multiple CPUs
Zubair Nabi 4: Concurrency April 18, 2013 6 / 22
Advantages
Overlap computation and I/O
Simplify code structuring
Improve responsiveness
Seamless use of multiple CPUs
Zubair Nabi 4: Concurrency April 18, 2013 6 / 22
Advantages
Overlap computation and I/O
Simplify code structuring
Improve responsiveness
Seamless use of multiple CPUs
Zubair Nabi 4: Concurrency April 18, 2013 6 / 22
Advantages
Overlap computation and I/O
Simplify code structuring
Improve responsiveness
Seamless use of multiple CPUs
Zubair Nabi 4: Concurrency April 18, 2013 6 / 22
Critical sections
Recurring problem: Two (or more) threads trying to solve the sameproblem concurrently
Only one thread should be allowed to access the piece of code thatshould never be concurrently executed
I Known as a critical section
Only one thread should be executing within a critical sectionI Known as mutual exclusion
Zubair Nabi 4: Concurrency April 18, 2013 7 / 22
Critical sections
Recurring problem: Two (or more) threads trying to solve the sameproblem concurrentlyOnly one thread should be allowed to access the piece of code thatshould never be concurrently executed
I Known as a critical section
Only one thread should be executing within a critical sectionI Known as mutual exclusion
Zubair Nabi 4: Concurrency April 18, 2013 7 / 22
Critical sections
Recurring problem: Two (or more) threads trying to solve the sameproblem concurrentlyOnly one thread should be allowed to access the piece of code thatshould never be concurrently executed
I Known as a critical section
Only one thread should be executing within a critical sectionI Known as mutual exclusion
Zubair Nabi 4: Concurrency April 18, 2013 7 / 22
Critical sections
Recurring problem: Two (or more) threads trying to solve the sameproblem concurrentlyOnly one thread should be allowed to access the piece of code thatshould never be concurrently executed
I Known as a critical section
Only one thread should be executing within a critical section
I Known as mutual exclusion
Zubair Nabi 4: Concurrency April 18, 2013 7 / 22
Critical sections
Recurring problem: Two (or more) threads trying to solve the sameproblem concurrentlyOnly one thread should be allowed to access the piece of code thatshould never be concurrently executed
I Known as a critical section
Only one thread should be executing within a critical sectionI Known as mutual exclusion
Zubair Nabi 4: Concurrency April 18, 2013 7 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queue
I Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()
I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronization
I Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Ensuring mutex
Locks: Ability to lock and unlock a critical section (based on an atomicoperation enabled by the hardware)
I Overhead of busy waiting
Semaphores: Implemented as an integer and a queueI Ability to wait() and signal()I Can also provide condition synchronizationI Correct use requires considerable care (forgetting to call wait() orsignal())
Monitors: Explicitly declare variables and tag code as using thosevariables
I Compiler automatically declares and manages underlying primitives formutual exclusion or synchronization
I Related routines are combined together
Zubair Nabi 4: Concurrency April 18, 2013 8 / 22
Outline
1 Introduction
2 Concurrency in Practice
3 Liveness
4 Message passing
5 Transactions
Zubair Nabi 4: Concurrency April 18, 2013 9 / 22
Linux Kernel
Kernel provides spinlocks and semaphores
I Spinlocks busy wait so only hold for short time
Also provides reader-writer spinlock variantsI Allows many readers or a single writer
Zubair Nabi 4: Concurrency April 18, 2013 10 / 22
Linux Kernel
Kernel provides spinlocks and semaphoresI Spinlocks busy wait so only hold for short time
Also provides reader-writer spinlock variantsI Allows many readers or a single writer
Zubair Nabi 4: Concurrency April 18, 2013 10 / 22
Linux Kernel
Kernel provides spinlocks and semaphoresI Spinlocks busy wait so only hold for short time
Also provides reader-writer spinlock variants
I Allows many readers or a single writer
Zubair Nabi 4: Concurrency April 18, 2013 10 / 22
Linux Kernel
Kernel provides spinlocks and semaphoresI Spinlocks busy wait so only hold for short time
Also provides reader-writer spinlock variantsI Allows many readers or a single writer
Zubair Nabi 4: Concurrency April 18, 2013 10 / 22
Java
Inspired by monitors
Through the synchronize primitive
Objects already encapsulate data and methods
Block synchronization is preferred over method synchronization
C# is similar too but requires explicit invocation
Zubair Nabi 4: Concurrency April 18, 2013 11 / 22
Java
Inspired by monitors
Through the synchronize primitive
Objects already encapsulate data and methods
Block synchronization is preferred over method synchronization
C# is similar too but requires explicit invocation
Zubair Nabi 4: Concurrency April 18, 2013 11 / 22
Java
Inspired by monitors
Through the synchronize primitive
Objects already encapsulate data and methods
Block synchronization is preferred over method synchronization
C# is similar too but requires explicit invocation
Zubair Nabi 4: Concurrency April 18, 2013 11 / 22
Java
Inspired by monitors
Through the synchronize primitive
Objects already encapsulate data and methods
Block synchronization is preferred over method synchronization
C# is similar too but requires explicit invocation
Zubair Nabi 4: Concurrency April 18, 2013 11 / 22
Java
Inspired by monitors
Through the synchronize primitive
Objects already encapsulate data and methods
Block synchronization is preferred over method synchronization
C# is similar too but requires explicit invocation
Zubair Nabi 4: Concurrency April 18, 2013 11 / 22
Outline
1 Introduction
2 Concurrency in Practice
3 Liveness
4 Message passing
5 Transactions
Zubair Nabi 4: Concurrency April 18, 2013 12 / 22
Liveness
Want threads to make progress
To make progress need to avoid:1 Deadlock: Threads sleep waiting for each other2 Livelock: Threads execute but make no progress
For good performance also need to ensure:1 No starvation: Each thread must make progress2 Minimality: No unnecessary waiting or signalling
Zubair Nabi 4: Concurrency April 18, 2013 13 / 22
Liveness
Want threads to make progressTo make progress need to avoid:
1 Deadlock: Threads sleep waiting for each other
2 Livelock: Threads execute but make no progress
For good performance also need to ensure:1 No starvation: Each thread must make progress2 Minimality: No unnecessary waiting or signalling
Zubair Nabi 4: Concurrency April 18, 2013 13 / 22
Liveness
Want threads to make progressTo make progress need to avoid:
1 Deadlock: Threads sleep waiting for each other2 Livelock: Threads execute but make no progress
For good performance also need to ensure:1 No starvation: Each thread must make progress2 Minimality: No unnecessary waiting or signalling
Zubair Nabi 4: Concurrency April 18, 2013 13 / 22
Liveness
Want threads to make progressTo make progress need to avoid:
1 Deadlock: Threads sleep waiting for each other2 Livelock: Threads execute but make no progress
For good performance also need to ensure:
1 No starvation: Each thread must make progress2 Minimality: No unnecessary waiting or signalling
Zubair Nabi 4: Concurrency April 18, 2013 13 / 22
Liveness
Want threads to make progressTo make progress need to avoid:
1 Deadlock: Threads sleep waiting for each other2 Livelock: Threads execute but make no progress
For good performance also need to ensure:1 No starvation: Each thread must make progress
2 Minimality: No unnecessary waiting or signalling
Zubair Nabi 4: Concurrency April 18, 2013 13 / 22
Liveness
Want threads to make progressTo make progress need to avoid:
1 Deadlock: Threads sleep waiting for each other2 Livelock: Threads execute but make no progress
For good performance also need to ensure:1 No starvation: Each thread must make progress2 Minimality: No unnecessary waiting or signalling
Zubair Nabi 4: Concurrency April 18, 2013 13 / 22
Deadlock
Set of threads go to sleep and cannot wake up
Can only be woken by another thread who is also asleepDealing with deadlocks:
1 Ensure it never happens: Prevention and avoidance2 Let it happen but recover: Detection and recovery3 Ignore it: Let the programmer deal with it
Zubair Nabi 4: Concurrency April 18, 2013 14 / 22
Deadlock
Set of threads go to sleep and cannot wake up
Can only be woken by another thread who is also asleep
Dealing with deadlocks:1 Ensure it never happens: Prevention and avoidance2 Let it happen but recover: Detection and recovery3 Ignore it: Let the programmer deal with it
Zubair Nabi 4: Concurrency April 18, 2013 14 / 22
Deadlock
Set of threads go to sleep and cannot wake up
Can only be woken by another thread who is also asleepDealing with deadlocks:
1 Ensure it never happens: Prevention and avoidance
2 Let it happen but recover: Detection and recovery3 Ignore it: Let the programmer deal with it
Zubair Nabi 4: Concurrency April 18, 2013 14 / 22
Deadlock
Set of threads go to sleep and cannot wake up
Can only be woken by another thread who is also asleepDealing with deadlocks:
1 Ensure it never happens: Prevention and avoidance2 Let it happen but recover: Detection and recovery
3 Ignore it: Let the programmer deal with it
Zubair Nabi 4: Concurrency April 18, 2013 14 / 22
Deadlock
Set of threads go to sleep and cannot wake up
Can only be woken by another thread who is also asleepDealing with deadlocks:
1 Ensure it never happens: Prevention and avoidance2 Let it happen but recover: Detection and recovery3 Ignore it: Let the programmer deal with it
Zubair Nabi 4: Concurrency April 18, 2013 14 / 22
Livelock
Deadlock is relatively easy to detect by humans
Livelock is less easy to detect as threads continue to run (as opposed toblocking in deadlock) but do nothing usefulPrevalent in code used to detect and handle deadlocks
I Two threads detect a deadlock and try to step aside for each other
Zubair Nabi 4: Concurrency April 18, 2013 15 / 22
Livelock
Deadlock is relatively easy to detect by humans
Livelock is less easy to detect as threads continue to run (as opposed toblocking in deadlock) but do nothing useful
Prevalent in code used to detect and handle deadlocksI Two threads detect a deadlock and try to step aside for each other
Zubair Nabi 4: Concurrency April 18, 2013 15 / 22
Livelock
Deadlock is relatively easy to detect by humans
Livelock is less easy to detect as threads continue to run (as opposed toblocking in deadlock) but do nothing usefulPrevalent in code used to detect and handle deadlocks
I Two threads detect a deadlock and try to step aside for each other
Zubair Nabi 4: Concurrency April 18, 2013 15 / 22
Livelock
Deadlock is relatively easy to detect by humans
Livelock is less easy to detect as threads continue to run (as opposed toblocking in deadlock) but do nothing usefulPrevalent in code used to detect and handle deadlocks
I Two threads detect a deadlock and try to step aside for each other
Zubair Nabi 4: Concurrency April 18, 2013 15 / 22
Outline
1 Introduction
2 Concurrency in Practice
3 Liveness
4 Message passing
5 Transactions
Zubair Nabi 4: Concurrency April 18, 2013 16 / 22
Concurrency without shared data
Only one thread can access any particular piece of data
Different threads can own distinct chunks of data
Ensure concurrency by allowing other threads to ask for operations to bedone on their behalf (Dynamic invocation)
Can be thought of as general message passing (Similar to email)
Can be used to implement RPC
Zubair Nabi 4: Concurrency April 18, 2013 17 / 22
Concurrency without shared data
Only one thread can access any particular piece of data
Different threads can own distinct chunks of data
Ensure concurrency by allowing other threads to ask for operations to bedone on their behalf (Dynamic invocation)
Can be thought of as general message passing (Similar to email)
Can be used to implement RPC
Zubair Nabi 4: Concurrency April 18, 2013 17 / 22
Concurrency without shared data
Only one thread can access any particular piece of data
Different threads can own distinct chunks of data
Ensure concurrency by allowing other threads to ask for operations to bedone on their behalf (Dynamic invocation)
Can be thought of as general message passing (Similar to email)
Can be used to implement RPC
Zubair Nabi 4: Concurrency April 18, 2013 17 / 22
Concurrency without shared data
Only one thread can access any particular piece of data
Different threads can own distinct chunks of data
Ensure concurrency by allowing other threads to ask for operations to bedone on their behalf (Dynamic invocation)
Can be thought of as general message passing (Similar to email)
Can be used to implement RPC
Zubair Nabi 4: Concurrency April 18, 2013 17 / 22
Concurrency without shared data
Only one thread can access any particular piece of data
Different threads can own distinct chunks of data
Ensure concurrency by allowing other threads to ask for operations to bedone on their behalf (Dynamic invocation)
Can be thought of as general message passing (Similar to email)
Can be used to implement RPC
Zubair Nabi 4: Concurrency April 18, 2013 17 / 22
Advantages
Avoids race condition
Provides a flexible APII Batching: Batch X messages togetherI Scheduling: Choose the when, who, and which of message receiptI Broadcast: Send messages to many recipients
Used as the basis for some languages, such as Linda, occam, and Erlang
Zubair Nabi 4: Concurrency April 18, 2013 18 / 22
Advantages
Avoids race conditionProvides a flexible API
I Batching: Batch X messages togetherI Scheduling: Choose the when, who, and which of message receiptI Broadcast: Send messages to many recipients
Used as the basis for some languages, such as Linda, occam, and Erlang
Zubair Nabi 4: Concurrency April 18, 2013 18 / 22
Advantages
Avoids race conditionProvides a flexible API
I Batching: Batch X messages together
I Scheduling: Choose the when, who, and which of message receiptI Broadcast: Send messages to many recipients
Used as the basis for some languages, such as Linda, occam, and Erlang
Zubair Nabi 4: Concurrency April 18, 2013 18 / 22
Advantages
Avoids race conditionProvides a flexible API
I Batching: Batch X messages togetherI Scheduling: Choose the when, who, and which of message receipt
I Broadcast: Send messages to many recipients
Used as the basis for some languages, such as Linda, occam, and Erlang
Zubair Nabi 4: Concurrency April 18, 2013 18 / 22
Advantages
Avoids race conditionProvides a flexible API
I Batching: Batch X messages togetherI Scheduling: Choose the when, who, and which of message receiptI Broadcast: Send messages to many recipients
Used as the basis for some languages, such as Linda, occam, and Erlang
Zubair Nabi 4: Concurrency April 18, 2013 18 / 22
Advantages
Avoids race conditionProvides a flexible API
I Batching: Batch X messages togetherI Scheduling: Choose the when, who, and which of message receiptI Broadcast: Send messages to many recipients
Used as the basis for some languages, such as Linda, occam, and Erlang
Zubair Nabi 4: Concurrency April 18, 2013 18 / 22
Erlang
Functional language from the mid 80s
Cheap, lightweight, language-level processes
Each variable is assigned only once (Immutable afterwards)
Explicit message passing via in order message delivery to local mailbox
Used to implement Facebook Chat
Zubair Nabi 4: Concurrency April 18, 2013 19 / 22
Erlang
Functional language from the mid 80s
Cheap, lightweight, language-level processes
Each variable is assigned only once (Immutable afterwards)
Explicit message passing via in order message delivery to local mailbox
Used to implement Facebook Chat
Zubair Nabi 4: Concurrency April 18, 2013 19 / 22
Erlang
Functional language from the mid 80s
Cheap, lightweight, language-level processes
Each variable is assigned only once (Immutable afterwards)
Explicit message passing via in order message delivery to local mailbox
Used to implement Facebook Chat
Zubair Nabi 4: Concurrency April 18, 2013 19 / 22
Erlang
Functional language from the mid 80s
Cheap, lightweight, language-level processes
Each variable is assigned only once (Immutable afterwards)
Explicit message passing via in order message delivery to local mailbox
Used to implement Facebook Chat
Zubair Nabi 4: Concurrency April 18, 2013 19 / 22
Erlang
Functional language from the mid 80s
Cheap, lightweight, language-level processes
Each variable is assigned only once (Immutable afterwards)
Explicit message passing via in order message delivery to local mailbox
Used to implement Facebook Chat
Zubair Nabi 4: Concurrency April 18, 2013 19 / 22
Outline
1 Introduction
2 Concurrency in Practice
3 Liveness
4 Message passing
5 Transactions
Zubair Nabi 4: Concurrency April 18, 2013 20 / 22
Transactions
Either executes correctly (commits) or has no effect at all
Properties:1 Atomicity: Either all or none of the operations are performed2 Consistency: A transaction transforms the system from one consistent
state to another3 Isolation: Each transaction gives the notion of sandboxing from the
concurrent effects of others4 Durability: The effects of committed transactions survive subsequent
system failures
Zubair Nabi 4: Concurrency April 18, 2013 21 / 22
Transactions
Either executes correctly (commits) or has no effect at allProperties:
1 Atomicity: Either all or none of the operations are performed
2 Consistency: A transaction transforms the system from one consistentstate to another
3 Isolation: Each transaction gives the notion of sandboxing from theconcurrent effects of others
4 Durability: The effects of committed transactions survive subsequentsystem failures
Zubair Nabi 4: Concurrency April 18, 2013 21 / 22
Transactions
Either executes correctly (commits) or has no effect at allProperties:
1 Atomicity: Either all or none of the operations are performed2 Consistency: A transaction transforms the system from one consistent
state to another
3 Isolation: Each transaction gives the notion of sandboxing from theconcurrent effects of others
4 Durability: The effects of committed transactions survive subsequentsystem failures
Zubair Nabi 4: Concurrency April 18, 2013 21 / 22
Transactions
Either executes correctly (commits) or has no effect at allProperties:
1 Atomicity: Either all or none of the operations are performed2 Consistency: A transaction transforms the system from one consistent
state to another3 Isolation: Each transaction gives the notion of sandboxing from the
concurrent effects of others
4 Durability: The effects of committed transactions survive subsequentsystem failures
Zubair Nabi 4: Concurrency April 18, 2013 21 / 22
Transactions
Either executes correctly (commits) or has no effect at allProperties:
1 Atomicity: Either all or none of the operations are performed2 Consistency: A transaction transforms the system from one consistent
state to another3 Isolation: Each transaction gives the notion of sandboxing from the
concurrent effects of others4 Durability: The effects of committed transactions survive subsequent
system failures
Zubair Nabi 4: Concurrency April 18, 2013 21 / 22
References
Operating systems: Concurrent and distributed software design. JeanBacon and Tim Harris, Addison Wesley, 2003
Zubair Nabi 4: Concurrency April 18, 2013 22 / 22