34

线程安全性详解-zero菌

 5 years ago
source link: http://blog.51cto.com/zero01/2300671
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
线程安全性定义:当多个线程访问某个类时,不管运行时环境采用何种调度方式或者这些进程将如何交替执行,并且在主调代码中不需要任何额外的同步或协同,这个类都能表现出正确的行为,那么就称这个类是线程安全的线程安全性主要体现在三个方面:原子性:提供了互斥访问,同一时刻只能有一个线程来对它进行操作可见性:一个线程对主内存的修改可以及时的被其他线程观察到有序性:一个线程观察其他线程中的指令执行顺序,由于指令重排

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK