Java
aahyhaa
这个作者很懒,什么都没留下…
展开
-
多线程重要概念(一)
All objects automatically contain a single lock (also referred to as a monitor). When you call any synchronized method, that object is locked and no other synchronized method of that object can b...原创 2013-03-25 17:20:09 · 117 阅读 · 0 评论 -
什么时候用到synchronize关键字?
When should you synchronize? Apply Brian’s Rule of Synchronization If you are writing a variable that might next be read by another thread, or reading a variable that might have last been written ...原创 2013-03-26 10:42:52 · 326 阅读 · 0 评论 -
Atomicity and volatility
Atomicity applies to "simple operations" on primitive types except for longs and doubles. Reading and writing primitive variables other than long and double is guaranteed to go to and from memor...原创 2013-03-26 15:52:35 · 174 阅读 · 0 评论 -
Volatile关键字的作用
It is possible for each thread to have a local stack and maintain copies of some variables there. If you define a variable as volatile, it tells the compiler not to do any optimizations that wou...原创 2013-03-27 10:07:54 · 334 阅读 · 0 评论 -
java线程和操作系统进程的关系
One very straightforward way to implement concurrency is at the operating system level, using processes. A process is a self-contained program running within its own address space. A multitasking op...原创 2013-01-06 13:59:21 · 239 阅读 · 0 评论