AHugeApe

导航

随笔分类 -  Java Concurrency

ConCurrent in Practice小记 (4)
摘要:ConCurrent in Practice小记 (4) Executors Callable && Future <T> Callable:此接口有一个call()方法。在这个方法中,必须实现任务的(处理)逻辑。Callable接口是一个参数化的接口。意味着必须指明call()方法返回 阅读全文

posted @ 2018-03-23 10:11 普陀听禅 阅读(228) 评论(0) 推荐(0)

ConCurrent in Practice小记 (3)
摘要:ConCurrent in Practice小记 (3)高级同步技巧SemaphoreSemaphore信号量,据说是Dijkstra大神发明的。内部维护一个许可集(Permits Set),用于发放许可和回收许可,存在内部计数器,主要用来计数能否得到资源(一般用来限制同时访问资源数)。当一个线程拿... 阅读全文

posted @ 2015-08-04 09:59 普陀听禅 阅读(205) 评论(0) 推荐(0)

ConCurrent in Practice小记 (2)
摘要:Java-ConCurrent2.htmlConCurrent in Practice小记 (2)Java7 Concurrency Cookbook裸线程控制(Thread Control)Thread InterruptThread的interrupt()方法使得线程中断,而检测Thread中断... 阅读全文

posted @ 2015-07-27 19:28 普陀听禅 阅读(346) 评论(0) 推荐(0)

ConCurrent in Practice小记 (1)
摘要:#ConCurrent in Practice小记 (1)#杂记,随书自己写的笔记:##综述问题##- 1、线程允许在同一个进程中的资源,包括共享内存,内存句柄,文件句柄。但是每个进程有自己的程序计数器,栈和局部变量。- 2、安全问题:线程不安全本质上是由于单线程在在从共享内存或者文件中取得自己的资... 阅读全文

posted @ 2015-07-26 14:01 普陀听禅 阅读(449) 评论(0) 推荐(0)