embody the data item with the ability to control access to itself
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的更多相关文章
- PowerDesigner提示This data item is already used in a primary identifier.的处理
原文链接: http://blog.csdn.net/lopper/article/details/5293545 今天同事在编制一个数据库脚本的时候,提示了This data item is alr ...
- 远程连接服务器影像文件进行服务发布以及问题解决【the data item is inaccessible】
场景模拟: 本机安装有arcgis desktop以及arcgis server10.1,server的站点账号为arcgis. 需要发布影像服务并进行切片,使用的影像数据存放在远程服务器上,影像较大 ...
- 解决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 ...
- [Blue Prism] Data item 的使用
1.用于存储各种数据类型的变量,支持的数据类型如下: Binary - 用于存储二进制 blob,例如文本文件. Date - 用于存储日期. 此数据类型与 DateTime 类似,只是 Date ...
- Cryptographic method and system
The present invention relates to the field of security of electronic data and/or communications. In ...
- Cross-Domain Security For Data Vault
Cross-domain security for data vault is described. At least one database is accessible from a plural ...
- ListView中item定位
ListView 实现定位特定 item 最近在项目中需要使 ListView 能跳转到特定的 item,查阅文档后,发现 ListView 有以下几种方法可供使用: smoothScrollToPo ...
- Optimizing Performance: Data Binding(zz)
Optimizing Performance: Data Binding .NET Framework 4.5 Other Versions Windows Presentation Founda ...
- Tri-Training: Exploiting Unlabeled Data Using Three Classifiers
Abstract – In many practical data mining applications such as web page classification, unlabeled tra ...
随机推荐
- loj 1407(2-sat + 枚举 + 输出一组可行解 )
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=27115 思路:有一个trick要注意:当情况为 2 x y 时,可 ...
- MATLAB学习笔记(二)——主要是MATLAB的矩阵知识
PS:主要是讲解矩阵的相应的实现方法,其实MATLAB的很大一部分的优势,就是集成了矩阵级别的运算,并以此为特点,可以进行多维空间上的验证. 让我们懂得了原来线性代数如此有用= - =. (一)MAT ...
- Servlet跳转方式
servlet之间的跳转,有两种方式: 1.redirect方式,是新的请求,数据不相同 2.forward方式是同一个请求,数据相同
- Android Studio 获取 sha1-wangfeng520@
WIN+R 打开“运行” 输入 CMD 回车 2 CD C:\Program Files\Java\jdk1.7.0_71\bin (JDK安装路径) keytool -list -v ...
- BZOJ1105 : [POI2007]石头花园SKA
考虑把所有石头翻到直线y=x同侧,此时可以保证篱笆长度最短. 这种最短的篱笆一共有4种可能,枚举每种可能然后$O(n)$检验求出答案即可. #include<cstdio> const i ...
- 套题整理 Orz DXY
弱弱的DXY 题目描述 DXY太弱了,以至于他已经不知道要如何解决调整一个数列的使得他变成一个严格上升序列. 输入格式 第 1 行,1 个整数 N 第 2 行,N 个整数 A1,A2,...,AN 输 ...
- Remove Duplicates from Sorted List II leetcode java
题目: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct ...
- Sublime Text 2配置
gedit用了很久,终于换编辑器了T_T Sublime Text 自行百度谷歌. 一开始我在官网下载的压缩包,然后自己配置.搞了半天后果断删掉...还是用源的自动安装吧.T_T 恩.下面的命令 su ...
- Android 并行自动化测试系统 实现总结
一: 总体架构 系统工程架构源码:https://github.com/UDLD/UIAUTOMATORTEST 整个系统基于: UiAutomator + 自编Python交互库 + Robo ...
- 李洪强 - C语言8-Scanf函数
C语言的scanf函数 一.变量的内存分析 (一)字节与地址 ①. 内存以字节为单位 每个字节都有自己的内存地址,根据地址就可以找到该字节.整个内存相当于一整个酒店,而酒店以房间为单位,在这里每个房间 ...