Slides for Chapter 13 Transactions and Concurrency Control.ppt

Slides for Chapter 13 Transactions and Concurrency Control.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Slides for Chapter 13 Transactions and Concurrency Control.ppt

Slides for Chapter 13: Transactions and Concurrency Control From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, ? Addison-Wesley 2005 Introduction to transactions The goal of transactions the objects managed by a server must remain in a consistent state when they are accessed by multiple transactions and in the presence of server crashes Recoverable objects can be recovered after their server crashes objects are stored in permanent storage Failure model transactions deal with crash failures of processes and omission failures of communication Designed for an asynchronous system Figure 13.1 Operations of the Account interface Figure 13.2 A client’s banking transaction Atomic operations at server when a server uses multiple threads it can perform several client operations concurrently if we allowed deposit and withdraw to run concurrently we could get inconsistent results objects should be designed for safe concurrent access e.g. in Java use synchronized methods, e.g. public synchronized void deposit(int amount) throws RemoteException atomic operations are free from interference from concurrent operations in other threads. use any available mutual exclusion mechanism (e.g. mutex) Client cooperation by means of synchronizing server operations servers with multiple threads require atomic objects but in some applications, clients depend on one another to progress e.g. one is a producer and another a consumer e.g. one sets a lock and the other waits for it to be released it would not be a good idea for a waiting client to poll the server to see whether a resource is yet available it would also be unfair (later clients might get earlier turns) Java wait and notify methods allow threads to communicate with one another and to solve these problems e.g. when a client requests a resource, the server thread waits until it is notified that the resource is available Figure 13.3 Operations in Coordinator interface Figure 13.4 Trans

文档评论(0)

gshshxx + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档