http://download.oracle.com/javase/tutorial/essential/concurrency/locksync.htmlSynchronization is built around an internal entity known as theintrinsic lockormonitor lock. (The API specification often refers to this entity simply as a "monitor.") Intrinsic locks play a role in both aspects Read More
posted @ 2011-03-21 15:27 庚武 Views(296) Comments(0) Diggs(0) Edit
from:http://www.java-samples.com/showtutorial.php?tutorialid=306//Q.java 代表队列,存数据package com.test.threadcooperate;//A correct implementation of a producer and consumer. public class Q { int n; volatile boolean valueSet = false; public synchronized int get() { if (!valueSet) try { wait(); // 无限等待 // Read More
posted @ 2011-03-21 14:23 庚武 Views(275) Comments(0) Diggs(0) Edit
该文被密码保护。 Read More
posted @ 2011-03-21 13:02 庚武 Views(4) Comments(0) Diggs(0) Edit
转自:http://www.ibm.com/developerworks/cn/java/j-jtp06197.html简介:Java™ 语言包含两种内在的同步机制:同步块(或方法)和 volatile 变量。这两种机制的提出都是为了实现代码线程的安全性。其中 Volatile 变量的同步性较差(但有时它更简单并且开销更低),而且其使用也更容易出错。在这期的Java 理论与实践中,Brian Goetz 将介绍几种正确使用 volatile 变量的模式,并针对其适用性限制提出一些建议。Java 语言中的 volatile 变量可以被看作是一种 “程度较轻的synchronized”;与sync Read More
posted @ 2011-03-21 01:50 庚武 Views(210) Comments(0) Diggs(0) Edit
from csdn:http://files.cnblogs.com/wucg/csdn%E4%B8%8B%E8%BD%BDpartitionmagic8%C2%B70.rar确实可用。硬盘分区大小重新调整。 Read More
posted @ 2011-03-21 01:10 庚武 Views(269) Comments(0) Diggs(0) Edit