Computer Science An Overview _J. Glenn Brookshear _11th Edition

Such communication needs have long been a topic of study among computer scientists, and many newer programming languages reflect various approaches to thread interaction problems. As an example, let us consider the communication problems encountered when two threads manipulate the same data. (This example is presented in more detail in the optional Section 3.4.) If each of two threads that are executing concurrently need to add the value three to a common item of data, a method is needed to ensure that one thread is allowed to complete its transaction before the other is allowed to perform its task. Otherwise they could both start their individual computations with the same initial value,which would mean that the final result would be incremented by only three rather than six. Data that can be accessed by only one thread at a time is said to have mutually exclusive access.

One way to implement mutually exclusive access is to write the program units that describe the threads involved so that when a thread is using shared data, it blocks other threads from accessing that data until such access is safe. (This is the approach described in the optional Section 3.4, where we identified the portion of a process that accesses shared data as a critical region.) Experience has shown that this approach has the drawback of distributing the task of ensuring mutual exclusion throughout various parts of the program—each program unit accessing the data must be properly designed to enforce mutual exclusion, and thus a mistake in a single segment can corrupt the entire system. For this reason many argue that a better solution is to embody the data item with the ability to control access to itself. In short, instead of relying on the threads that access the data to guard against multiple access, the data item itself is assigned this responsibility. The result is that control of access is concentrated at a single point in the program rather than dispersed among many program units. A data item augmented with the ability to control access to itself is often called a monitor.

We conclude that the design of programming languages for parallel processing involves developing ways to express such things as the creation of threads, the pausing and restarting of threads, the identification of critical regions, and the composition of monitors.

embody the data item with the ability to control access to itself的更多相关文章

  1. PowerDesigner提示This data item is already used in a primary identifier.的处理

    原文链接: http://blog.csdn.net/lopper/article/details/5293545 今天同事在编制一个数据库脚本的时候,提示了This data item is alr ...

  2. 远程连接服务器影像文件进行服务发布以及问题解决【the data item is inaccessible】

    场景模拟: 本机安装有arcgis desktop以及arcgis server10.1,server的站点账号为arcgis. 需要发布影像服务并进行切片,使用的影像数据存放在远程服务器上,影像较大 ...

  3. 解决PowerDesigner提示This data item is already used in a primary identifier

    解决PowerDesigner提示This data item is already used in a primary identifier 解决PowerDesigner提示This data i ...

  4. [Blue Prism] Data item 的使用

      1.用于存储各种数据类型的变量,支持的数据类型如下: Binary - 用于存储二进制 blob,例如文本文件. Date - 用于存储日期. 此数据类型与 DateTime 类似,只是 Date ...

  5. Cryptographic method and system

    The present invention relates to the field of security of electronic data and/or communications. In ...

  6. Cross-Domain Security For Data Vault

    Cross-domain security for data vault is described. At least one database is accessible from a plural ...

  7. ListView中item定位

    ListView 实现定位特定 item 最近在项目中需要使 ListView 能跳转到特定的 item,查阅文档后,发现 ListView 有以下几种方法可供使用: smoothScrollToPo ...

  8. Optimizing Performance: Data Binding(zz)

    Optimizing Performance: Data Binding .NET Framework 4.5 Other Versions   Windows Presentation Founda ...

  9. Tri-Training: Exploiting Unlabeled Data Using Three Classifiers

    Abstract – In many practical data mining applications such as web page classification, unlabeled tra ...

随机推荐

  1. loadrunner解决“服务器正在运行中”方法

    问题现象: 这个问题在上家公司遇见过,今天无意中找到了解决办法: 解决方法: 打开任务管理器: 找到这个进程:ThumbProcess.exe,关掉这个进程即可解决. 今天运行lr的vugen报错 解 ...

  2. su和su - 的区别

    Linux中切换用户的命令是su或su -.前天我在使用useradd这个命令时,才体会到这两者的本质区别.如图: 我首先是用su命令切换到root身份的,但是运行useradd时,出现错误:bash ...

  3. Half Sync And Half Async 半同步半异步模式

    如题,这是一个典型的CS结构的模式,至少曾经在CS结构中用过,只是没用好.当年用UDP死活都处理不过来网络命令,用此模式轻松解决. 此模式是典型的三层架构,同步层在一个线程内处理业务逻辑:异步层接受并 ...

  4. protected(C# 参考)

    protected 关键字是一个成员访问修饰符.受保护成员在它的类中可访问并且可由派生类访问.有关 protected 与其他访问修饰符的比较,请参见可访问性级别. 仅当访问通过派生类类型发生时,基类 ...

  5. 一个spring jdbc实例

    一.使用示例 (1)springJdbcContext.xml <?xml version="1.0" encoding="UTF-8"?> < ...

  6. C#的泛型委托Predicate/Func/Action(转)

    Predicate 泛型委托:表示定义一组条件并确定指定对象是否符合这些条件的方法.此委托由 Array 和 List 类的几种方法使用,用于在集合中搜索元素. 类型参数介绍:    T: 要比较的对 ...

  7. 【BZOJ】2330: [SCOI2011]糖果(差分约束+spfa)

    http://www.lydsy.com/JudgeOnline/problem.php?id=2330 差分约束运用了最短路中的三角形不等式,即d[v]<=d[u]+w(u, v),当然,最长 ...

  8. 【Vijos】1431 守望者的逃离

    题目链接:https://vijos.org/p/1431 算法:贪心 描述 恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变.守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒 ...

  9. new在c#方法中的使用

    new在c#中有三种用法: 1.实例化对象 2.泛型约束 3.用在方法前.new和override的区别在于:override用于重写父类的方法:new用于隐藏方法,它调用的方法来自于申明的类,如果申 ...

  10. c#中的partial关键字(转)

    c#中的partial关键字 Partial:      这是C#2.0的新特性 Partial关键字起到把一个class分段组合作用,能用于多个接口或一个继承 代码片断: namespace Com ...