Lec14 - Computer Science Lecture 14, page CS677:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Computer Science Lecture 14, page CS677: Distributed OS Last Class Leader election Distributed mutual exclusion 1 Computer Science Lecture 14, page CS677: Distributed OS Transactions Transactions provide higher level mechanism for atomicity of processing in distributed systems Have their origins in databases Banking example: Three accounts A:$100, B:$200, C:$300 Client 1: transfer $4 from A to B Client 2: transfer $3 from C to B Result can be inconsistent unless certain properties are imposed on the accesses Client 1 Client 2 Read A: $100 Write A: $96 Read C: $300 Write C:$297 Read B: $200 Read B: $200 Write B:$203 Write B:$204 2 Computer Science Lecture 14, page CS677: Distributed OS ACID Properties Atomic: all or nothing Consistent : transaction takes system from one consistent state to another Isolated : Immediate effects are not visible to other (serializable) Durable: Changes are permanent once transaction completes (commits) Client 1 Client 2 Read A: $100 Write A: $96 Read B: $200 Write B:$204 Read C: $300 Write C:$297 Read B: $204 Write B:$207 3 Computer Science Lecture 14, page CS677: Distributed OS Transaction Primitives Example: airline reservation Begin_transaction if(reserve(NY,Paris)==full) Abort_transaction if(reserve(Paris,Athens)==full)Abort_transaction if(reserve(Athens,Delhi)==full) Abort_transaction End_transaction Primitive Description BEGIN_TRANSACTION Make the start of a transaction END_TRANSACTION Terminate the transaction and try to commit ABORT_TRANSACTION Kill the transaction and restore the old values READ Read data from a file, a table, or otherwise WRITE Write data to a file, a table, or otherwise 4 Computer Science...
View Full Document

Page1 / 10

Lec14 - Computer Science Lecture 14, page CS677:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online