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. android MVC

    Android 的官方建议应用程序的开发采用MVC 模式.何谓MVC? MVC 是Model,View,Controller 的缩写,从上图可以看出MVC 包含三个部分: 模型(Model)对象:是应 ...

  2. [HTTP那些事] JSON数据

    随着Android的发展,各路大神的贡献,我们可用的轮子越来越多.比如HTTP请求框架,有自家的Volley,Square的okhttp, async-http-lib, 还有聚合版的xUtils以及 ...

  3. swift语言注册非免费苹果账号iOS游戏框架Sprite Kit基础教程

    swift语言注册非免费苹果账号iOS游戏框架Sprite Kit基础教程 1.2.3  注册非免费苹果账号swift语言注册非免费苹果账号iOS游戏框架Sprite Kit基础教程 免费的苹果账号在 ...

  4. C++ windows遍历目录

    bool Search(TCHAR *Path,TCHAR *File) { HANDLE hFind; WIN32_FIND_DATA wfd; ZeroMemory(&wfd,sizeof ...

  5. 逆序数 POJ 2299 Ultra-QuickSort

    题目传送门 /* 题意:就是要求冒泡排序的交换次数. 逆序数:在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序. 一个排列中逆序的总数就称为这个排列的逆 ...

  6. quick cocos map使用

    '''lua local MainScene = class("MainScene", function() return display.newScene("MainS ...

  7. BZOJ4389 : ZYB and Trees

    Link-Cut Tree维护. 每个点x维护以下信息: v:这个点的点权 s:实链上的信息和 st:子树信息和(不包括链上) sa:子树+链上的信息和 as:所有虚儿子的sa的和 则有 s[x]=v ...

  8. storm Tutorial 的解读 + 个人理解

    参考链接: Tutorial storm Tutorial 中文解读+分析 导读.摘要: .hadoop有master与slave,Storm与之对应的节点是什么? .Storm控制节点上面运行一个后 ...

  9. wp ApplicationBar

    WP7中的菜单栏 一个应用程序的菜单栏的内容是有限的,最多不超过4个,排列顺序是以菜单栏中间为中心,然后从左往右排列. WP7提供了两种类型的菜单栏,一种是全局的菜单栏,也就是说在所有的页面中都会出现 ...

  10. 配置当前用户使用豆瓣pip源

    配置当前用户使用豆瓣pip源   mkdir ~/.pip/ cat ~/.pip/pip.conf [global] index-url = http://pypi.douban.com/simpl ...