55

线程安全策略-zero菌

 5 years ago
source link: http://blog.51cto.com/zero01/2304422
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.
四个线程安全策略线程限制:一个被线程限制的对象,由线程独占,并且只能被占有它的线程修改共享只读:一个共享只读的对象,在没有额外同步的情况下,可以被多个线程并发访问,但是任何线程都不能修改它线程安全对象:一个线程安全的对象或者容器,在内部通过同步机制来保证线程安全,所以其他线程无需额外的同步就可以通过公共接口随意访问它被守护对象:被守护对象只能通过获取特定的锁来访问不可变对象有一种对象发布了就是安全

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK