1 / 14

Operating System Transactions

Geoffrey Trujillo CSE 430. Operating System Transactions. Problem. POSIX system calls do not handle concurrency well Only one system call can be guaranteed to execute atomically System cannot remain consistent when multiple system calls are made

xue
Télécharger la présentation

Operating System Transactions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Geoffrey Trujillo CSE 430 Operating System Transactions

  2. Problem • POSIX system calls do not handle concurrency well • Only one system call can be guaranteed to execute atomically • System cannot remain consistent when multiple system calls are made • No simple implementation can be made with locks

  3. Problem • Time-of-check-to-time-of-use • Securty risk • Race condition • Consistency of file system • Updates • Installations

  4. Operating System Transaction • Easier to use than locking mechanism • Eliminate race condition • Time-of-check-to-time-of-use • Able to maintain consistency • Use of concurrent application • Software installation • Software update • Isolated from system until commit

  5. System Transaction Use • Commands • sys_xbegin, sys_xend, sys_xabort • Use • sys_xbegin(); • //stuff • sys_xend();

  6. Race Condition Locks if ( access (‘foo’) { symlin(‘secret’, ‘foo’); fd = open(‘foo’); write(fd); }

  7. Race Condition Transaction sys_xbegin(); if ( access (‘foo’) { symlink(‘secret’, ‘foo’); fd = open(‘foo’); write(fd); } sys_xend(); symlink(‘secret’, ‘foo’);

  8. Install/Update Consistency sys_xbegin(); //install or //update sys_xend(); • Will have comlete install or update else will have original system

  9. How Transactions Work • Broken into two segments • Header • The stable part that holds the pointer to data • Data • The part the hold the private copy of the data in the system header Data

  10. How Transactions Work Header Lock Private Copy Data

  11. How Transactions Work Header Data

  12. System Call Supported

  13. System Call Not Supported

  14. Performance • 500,000 renames

More Related