Chapter 20 of Inside the Java Virtual Machine
Thread Synchronization
1.Java's monitor supports two kinds of thread synchronization: mutual exclusion
and cooperation.
2.. On a Java virtual machine implementation that doesn't time slice,
however, a higher priority thread that is never blocked will interfere
with any lower priority threads, even if none of the threads share data.
3.The form of monitor used by the Java virtual machine is called a "Wait and Notify" monitor.
4.
5.The Java virtual machine offers two kinds of notify commands: "notify"
and "notify all." A notify command selects one thread arbitrarily from
the wait set and marks it for eventual resurrection. A notify all
command marks all threads currently in the wait set for eventual
resurrection.
6.To a great extent, the manner in which a Java virtual machine
implementation selects the next thread from the wait or entry sets is a
decision of individual implementation designers.平台不同性
7.Java programs need to coordinate multi-threaded access to two kinds of
data:
o instance variables, which are stored on the heap
o class variables, which are stored in the method area
Programs never need to coordinate access to local variables, which
reside on Java stacks, because data on the Java stack is private to the
thread to which the Java stack belongs.
8. In Java, there are two kinds of monitor regions: synchronized statements and synchronized methods.
9.Note that as a Java programmer, you never explicitly lock an object. Object locks are internal to the Java virtual machine
分享到:
相关推荐
多线程学习笔记,好资源。包括线程基础等知识多线程学习笔记,好资源。包括线程基础等知识
马士兵多线程训练营上课笔记
Java线程的知识点总结。doc
多线程笔记,包含线程创建,线程开启,线程命名,线程同步
深圳华清远见学习的时候做的进程线程笔记,很有用,比较详细
C#多线程笔记 每个窗体都有自己的都在不同的线程上运行,如果需要在窗体之间交互,就需要在线程之间交互。
C# 多线程 笔记 适合 初学者 共含所有7个word文档,转载
C#多线程笔记学习指南
java多线程笔记分享
详细的Java多线程笔记,一共17章,能够让你更加了解多线程.线程是程序中的一个执行流,每个线程都有自己的专有寄存器(栈指针、程序计数器等),但代码区是共享的,即不同的线程可以执行同样的函数。
进程线程笔记.c
java线程笔记.docx
java中的多线程笔记
使用java.lang.Thread类或者java.lang.Runnable接口编写代码来定义、实例化和启动新线程。 一个Thread类实例只是一个对象,像Java中的任何其他对象一样,具有变量和方法,生死于堆上。 Java中,每个线程都有一个...
线程笔记之(1)问题汇总: 1.Interrupt这个方法会抛出异常,所以要捕获,原书中没有. 2.Thread的Sleep方法已经是static的,直接使用Thread.Sleep()代替实例方法 3.TryEnter方法的使用,是否需要Monitor.Exit()搭配使用 P...
多线程笔记,学习多线程的可以看看,希望对你有帮助。
Python3 多线程
马士兵多线程训练营笔记