C# JAVAMemory model
http://www.cl.cam.ac.uk/~pes20/weakmemory/index.html
http://preshing.com/20120913/acquire-and-release-semantics/
Memory Model
http://preshing.com/20120625/memory-ordering-at-compile-time/
http://blogs.msdn.com/b/cbrumme/archive/2003/05/17/51445.aspx
http://www.cs.umd.edu/~pugh/java/memoryModel/
The following five references give you an introduction on out-of-order execution on modern CPUs:
[1] Instruction Pipeline by Wikipedia
[2] Out-of-Order Execution by Wikipedia
[3] Speculative Execution by Wikipedia
[4] CPU Cache by Wikipedia
[5] Release Consistency by Wikipedia
This reference tells you the current memory model development in Java and other mainstream languages:
[6] Memory Barriers: a Hardware View for Software Hackers by Paul E. McKenney
This reference tells you how mainstream processors handle out-of-order memory references:
[7] Memory Models: A Case for Rethinking Parallel Languages and Hardware by Sarita V. Adve et al.
This reference tells you an important compiler reorder mechanism:
[8] Instruction scheduling By Wikipedia
The following four references tell you everything about Java memory model (JMM) JSR-133:
[9] The JSR-133 Cookbook by Doug Lea
[10] The Java Memory Model by William Pugh
[11] Chapter 17 “Thread and Locks” in the Java Language Specification, Third Edition
[12] Chapter 8 “Threads and Locks” in the Java Virtual Machine Specification, Second Edition
This reference introduces you some of Sun’s current JIT compiler optimizations:
[13] The Java HotSpot Performance Engine Architecture
The following two references introduce you Java thread executor and fork-join frameworks:
[14] Concurrency JSR-166 Interest Site
[15] A Java Fork/Join Framework by Doug Lea
This reference introduces you distributed computing by actor model:
[16] Actor Model by Wikipedia
C# - The C# Memory Model in Theory and Practice
https://msdn.microsoft.com/en-us/magazine/jj863136.aspx
https://msdn.microsoft.com/magazine/jj863136
https://msdn.microsoft.com/en-us/magazine/jj883956.aspx
http://igoro.com/archive/volatile-keyword-in-c-memory-model-explained/
http://igoro.com/archive/gallery-of-processor-cache-effects/
http://joeduffyblog.com/2006/10/26/concurrency-and-the-impact-on-reusable-libraries/
What Every Multithread eDde Av pMpusst
Understand the Impact of Low-Lock Techniques in Multithreaded Apps
re 1: check out this document: http://www.oracle.com/technetwork/java/javase/memorymanagement-whitepaper-150215.pdf
re 2: this is covered in the JVM Specification, Chapter 3: http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html
re 3: not sure what you are asking, but it sounds like Chapter 5 of the VM spec is what you are looking for: http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html
You probably want to read the whole VM spec actually: http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
Ali-Reza Adl-Tabatabai, Intel
Trishul Chilimbi, Microsoft Research
Chen Ding, Univ. of Rochester
Ben Zorn, Microsoft Research
Emery Berger, UMass Amherst
Cliff Click, Azul Systems
Bruce Jacob, Univ. of Maryland
Jeremy Manson, Google
Sally McKee, Cornell University
Trevor Mudge, Univ. of Michigan
Onur Mutlu, Microsoft Research
Erez Petrank, Technion
Valentina Salapura, IBM Research
Michael Swift, Univ. of Wisconsin
The Java Memory Model
https://docs.oracle.com/javase/specs/jls/se9/html/jls-17.html#jls-17.4
http://www.infoq.com/cn/articles/java-memory-model-1
http://gee.cs.oswego.edu/dl/jmm/cookbook.html
http://www.cs.umd.edu/~pugh/java/memoryModel/jsr133.pdf
http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html
https://dzone.com/articles/java-memory-model-programer%E2%80%99s
https://www.ibm.com/developerworks/library/j-jtp02244/index.html
https://www.ibm.com/developerworks/java/library/j-jtp03304/index.html
This web page is a starting point for discussions of and information concerning the Java Memory Model (Chapter 17 of the Java Language Specification). The Java Memory Model defines how threads interact through memory. It used to be somewhat unclear and unnecessarily limiting, and so was revised. This is a reference page for that revision. The official site for JSR 133 - The Java(tm) Memory Model and Thread Specification Revision - is here.
This page is divded up into several sections:
- Primary reference material on the memory model.
- Pointers to the mailing list and archives.
- Additional material on the memory model, including information on double-checked locking.
- Older material on the memory model, now obsolete.
- Pointers to further reading material from other sources.
Reference Material
These reference materials are a good starting point for anyone trying to understand the memory model. Between them, they cover most of the major issues involved.
- For First-Time Visitors
- A JSR-133 FAQ resource for programmers is available. This is a good place to start for those just becoming aware of the issues. (February 11, 2004)
- For JVM and compiler implementors
- Doug Lea's JSR-133 cookbook, which is a guide for compiler writers who wish to implement the Java memory model.
- Sarita Adve and Kourosh Gharachorloo wrote a tutorial on memory models in 1995 that remains an excellent reference and primer. Compaq Research Report 95/7, September 1995, 95.7 -- Shared Memory Consistency Models: A Tutorial.
- For those wishing to understand the memory model in full
- A journal submission about the memory model that combines Jeremy Manson's dissertation, the POPL paper and the CSJP paper. For those interested in a thorough discussion of the memory model issues, this is the best bet. (October 7, 2005).
A paper from PoPL 2005 about the memory model. This is largely
directed at the academic audience. (January, 2005) - Jeremy Manson's
dissertation, which is a comprehensive overview of the
model. (September, 2004)
--> - The JSR-133 specification, as sent to Final Approval Ballot. This is the "official specification" (August 9, 2004). It doesn't contain much in the way of explanation.
- New presentation/description of the semantics of final fields. This is a brief description of the semantics of final fields. (May 12, 2004)
- A journal submission about the memory model that combines Jeremy Manson's dissertation, the POPL paper and the CSJP paper. For those interested in a thorough discussion of the memory model issues, this is the best bet. (October 7, 2005).
Talk Slides
- The slides from the June 2004 JavaOne presentation on JSR-133 are
here.
-->
Mailing list
- To join the Java memory model mailing list, visit this page.
- To post to the list, email javamemorymodel-discussion@mimsy.cs.umd.edu (only subscribers may post to the list).
- The list has migrated. To access the archive of the old list, visit this page. To access the archive of the new list, visit this page.
Additional Information
Double-Checked Locking is Broken
Double-checked locking (also known as the multithreaded singleton pattern) is a widely employed idiom for publishing a singleton object to multiple threads.
- The "Double-Checked Locking is Broken" Declaration
This document describes why the double-checked locking pattern is broken unless you use explicit memory barriers (or make assumptions about your processor and compiler).
- Descriptions of double-check idiom
- Reality Check, Douglas C. Schmidt, C++ Report, SIGS, Vol. 8, No. 3, March 1996.
- Double-Checked Locking: An Optimization Pattern for Efficiently Initializing and Accessing Thread-safe Objects, Douglas Schmidt and Tim Harrison. 3rd annual Pattern Languages of Program Design conference, 1996
- Lazy instantiation, Philip Bishop and Nigel Warren, JavaWorld Magazine
- Programming Java threads in the real world, Part 7, Allen Holub, Javaworld Magazine, April 1999.
Other information
- We presented a paper at CSJP in July of 2004; while it contains
- Causality test cases 1-20
- Informal notes we made about legal and illegal multithreaded patterns are available in this document.
- Volatile spec compliance tests
- AtomicLong.java - Tests for atomic read/writes of volatile Longs
- CoherenceVolatile.java - Tests for illegal compiler optimizations involving volatiles
- ReadAfterWrite.java - Tests for sequential consistency of volatiles
- Here is a tar file containing the tests and more detail about their output.
- Table of number of synchronization operations in Spec benchmarks
much that is useful, it is largely subsumed by the journal
submission above. It can be found
here.
-->
Older Material (for the memory model historians among you)
This is a list of many of the revisions that the memory model underwent over the course of its three years in flight. They are mostly out of date. If you are interested in the model as it stands, your best bet is the reference material above.
Draft Proposals for the Memory Model
- Earlier draft spec, incorporates some minor fixes from Draft Final Spec. (April 23, 2004)
- Proposed Final Draft for JSR-133 (April 12, 2004)
- Documents about the Unified Memory Model Proposal for Java, including additional test cases (March 16, 2004)
- Update of JSR-133 Public Review Document, includes clarifications and minor fixes, does not incorporate a new formalism. (March 16, 2004)
- Writeup of alternative formalism for the JSR-133 memory model (March 16, 2004)
- JSR-133 is in public review (March 16, 2004)
- Experimental version of MP without forbidden executions (February 24, 2004).
- JSR-133 Public Review Document (February 2, 2004).
- The competing models of February 6, 2004.
- October 17, 2003
- August 29, 2003: NEW one page description of the Manson/Pugh core memory model (with a one and a half page appendix)
- August 8, 2003: JSR-133 Community Review Document
- August 4, 2003: Proof that reordering is legal under Manson/Pugh
- July 31, 2003: One page description of the Manson/Pugh core memory model (with a one page appendix)
- The full semantics of normal fields are in A New Approach to the Semantics of Multithreaded Java, by Jeremy Manson and William Pugh, Revised Jan 13, 2003.
- The full semantics of final fields are in Final Field Semantics, by Jeremy Manson and William Pugh, Revised April 7, 2003.
- Multithreaded semantics for Java, a previous version of the semantics. (2001)
- Weak Memory Orders and Object Oriented Programming, draft of the abstract for an OOPSLA poster session submission (PDF) (PS)
- The Java Memory Model is Broken by William Pugh, Journal version of the following paper; cleans up the paper somewhat and removes the naive fixes suggested in that paper.
- Fixing the Java Memory Model by William Pugh, 1999 ACM Java Grande
Talks
- Presentation given at Dagstuhl (October 24th, 2003)
- Multithreaded semantics for Java, (edited version of presentation given at MIT Sept 10th, 2000) Slides (PDF or PS) and handout (PDF or PS)
- JavaOne BOF on revising the Java Thread Spec, with Doug Lea (2000)
- JavaOne Talk, with Doug Lea (2000)
- OOPSLA 2000 workshop page
- Page for JavaOne 2000 BOF on revising the Java Thread Spec
- Slides from 1999 Java Grande Talk
Additional Background Reading
By Doug Lea
- The Java Memory Model, Section 2.2.7 of Concurrent Programming in Java, 2nd edition, Doug Lea, Addison Wesley, 1999
- Proposed revision to Section 17.4, Wait Sets and notification, Doug Lea
By Cenciarelli et al
- An Event-Based Structual Operational Semantics of Multi-Threaded Java, P. Cenciarelli, A. Knapp, B. Reus, M. Wirsing, In Jim Alves-Foss (Ed.) Formal Syntax and Semantics Of Java, LNCS 1523, pp. 157--200, Springer, Berlin, 1999.
- From Sequential To Multi-Threaded Java: An Event-Based Operational Semantics, P. Cenciarelli, A. Knapp, B. Reus, M. Wirsing, In Proc. 6^th Int. Conf. Algebraic Methodology and Software Technology, LNCS 1376, pp. 402--417. Springer Verlag. Berlin 1998.
- Verifying a Compiler Optimization for Multi-Threaded Java, B. Reus, A. Knapp, P. Cenciarelli, M. Wirsing, WADT Workshop 97, LNCS.
By Schuster et al.
- Java Memory Model: Precise Characterizations by Assaf Schuster, Workshop on Java for High-Performance Computing, June 1999, Rhodes.
- Java consistency: nonoperational characterizations for Java memory behavior by Alex Gontmakher and Assaf Schuster, ACM Transactions on Computer Systems Volume 18 , No. 4 (Nov. 2000) Pages 333 - 386.
On other memory models
- CAPSL Technical Memo 16: (148K gzipped Postscript), "Location Consistency -- a new Memory Model and Cache Consistency Protocol," Guang R. Gao, Vivek Sarkar, February 16, 1998.
- TLA and TLA+, Lamport et al.
By Arvind et al.
- Improving the Java Memory Model Using CRF, Jan-Willem Maessen, Arvind, and Xiaowei Shen, OOPSLA 2000
- Commit-Reconcile and Fences (CRF): A New Memory Model for Architects and Compiler Writers, Xiaowei Shen, Arvind and Larry Rudolph, December 1998, To appear in proceedings of the 26th International Symposium on Computer Architecture, May 1999, Atlanta, Georgia., (14 pages).
- Improving the Java Memory Model Using CRF, Jan-Willem Maessen, Arvind, and Xiaowei Shen, OOPSLA 2000
By others
- Preliminary examination of the impact of "reads kill" by Dan Scales, Digital Western Research Laboratories
- Javasoft Bug # 4242244: JLS requires Coherence, Sun's JIT doesn't provide it.
- Investigating Java concurrency using Abstract State Machines, Yuri Gurevich, Wolfram Schulte and Charles Wallace
C# JAVAMemory model的更多相关文章
- JMM(java内存模型)
What is a memory model, anyway? In multiprocessorsystems, processors generally have one or more laye ...
- 全面理解Java内存模型
尊重原创:http://blog.csdn.net/suifeng3051/article/details/52611310 Java内存模型即JavaMemory Model,简称JMM.JMM定义 ...
- Java内存模型(转载)
本文章节: 1.JMM简介 2.堆和栈 3.本机内存 4.防止内存泄漏 1.JMM简介 i.内存模型概述 Java平台自动集成了线程以及多处理器技术,这种集成程度比Java以前诞生的计算机语言要厉害很 ...
- 【深入理解JVM】:Java内存模型JMM
多任务和高并发的内存交互 多任务和高并发是衡量一台计算机处理器的能力重要指标之一.一般衡量一个服务器性能的高低好坏,使用每秒事务处理数(Transactions Per Second,TPS)这个指标 ...
- 深入理解JMM(Java内存模型) --(一)
并发编程模型的分类 在并发编程中,我们需要处理两个关键问题:线程之间如何通信及线程之间如何同步(这里的线程是指并发执行的活动实体).通信是指线程之间以何种机制来交换信息.在命令式编程中,线程之间的通信 ...
- 【java并发】(1)深入理解volatile关键字
volatile这个关键字可能很多朋友都听说过,或许也都用过.在Java 5之前,它是一个备受争议的关键字,因为在程序中使用它往往会导致出人意料的结果.在Java 5之后,volatile关键字才得以 ...
- JMM模型基础知识笔记
概述 内存模型可以理解为在特定的操作协议下,对特定的内存或者高速缓存进行读写访问的过程抽象,不同架构下的物理机拥有不一样的内存模型,Java虚拟机也有自己的内存模型,即Java内存模型(JavaMem ...
- Spring Boot笔记一
Spring Boot 入门 Spring Boot 简介 > 简化Spring应用开发的一个框架:> 整个Spring技术栈的一个大整合:> J2EE开发的一站式解决方案: 微服务 ...
- 【疯狂造轮子-iOS】JSON转Model系列之二
[疯狂造轮子-iOS]JSON转Model系列之二 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇<[疯狂造轮子-iOS]JSON转Model系列之一> ...
随机推荐
- 微信小程序 - 生命周期
生命周期 1.小程序注册完成后,加载页面,触发onLoad方法.(切记,onShow和onLoad的区别,onShow是每当进入这个页面时就会触发,而onload是载入进来时才触发) 2.页面载入后触 ...
- 笔试题之j2ee
j2ee部分 1.BS与CS的联系与区别. C/S是Client/Server的缩写.服务器通常采用高性能的PC.工作站或小型机,并采用大型数据库系统,如Oracle.Sybase.InFORMix或 ...
- iphone openssh
安装openssh 用户名:默认是 root 密码:默认是 alpine 修改登陆密码:passwd
- eclipse tomcat路径更改后启动报错
eclipse tomcat路径更改后启动报错 CreateTime--2018年5月3日14:48:22 Author:Marydon 1.情景还原 2.原因 本地的tomcat路径修改后,ec ...
- idea 设置黑色背景
idea 设置黑色背景 CreateTime--2018年4月26日10:32:38 Author:Marydon 设置-->Appearance-->Theme调为:Darcula- ...
- 改变maven父子项目视图为树状
完毕
- Makefile 中:= ?= += =的区别【转】
转自:http://www.cnblogs.com/wanqieddy/archive/2011/09/21/2184257.html 在Makefile中我们经常看到 = := ?= +=这几个赋值 ...
- 编译 boost
不想深究,只是可以编译出想要的lib文件 1.打开visual studio 2012 命令提示 2.进入 boost目录 3.运行booststrp.bat得到b2.exe.bjam.exe.pro ...
- 彻底理解Python切片
关于list的insert函数 list#insert(ind,value)在ind元素前面插入value 首先对ind进行预处理:如果ind<0,则ind+=len(a),这样一来ind就变成 ...
- JS数据交互:动态从数据库中获取数据填充Select
JavaScript代码: $(document).ready(function () { getIntype(); });function getIntype(){ $.ajax({ type:&q ...