一、 演示 There are three general strategies for queuing: 排队有三种通用策略: 直接提交。工作队列的默认选项是 SynchronousQueue,它将任务直接提交给线程而不保持它们。在此,如果不存在可用于立即运行任务的线程,则试图把任务加入队列将失败 Read More
一、结构 Lock的实现类其实都是构建在AbstractQueuedSynchronizer上,每个Lock实现类都持有自己内部类Sync的实例 二、LockSupport Basic thread blocking primitives for creating locks and other s Read More
Servlet Threading ModelThe scalability issues of Java servlets are caused mainly by the server threading model:Thread per connectionThe traditional IO... Read More
一。thread-per-connectionThe thread-per-connection approach uses an exclusive worker thread foreach connection. Within the handling loop, a worker threa... Read More
The terms asynchronous and non-blocking are closely related and are often used interchangeably, but they are not quite the same thing. Blocking A func Read More
一。传统数据传输1.user mode &kernel mode2.context switchThe steps involved are:1.The read() call causes a context switch (see Figure 2) from user mode to kern... Read More
一、ThreadLocal的原理以及存在的问题 a. 每个线程内部维护了一个ThreadLocal.ThreadLocalMap类型的变量 b. ThreadLocalMap 的 key 为 ThreadLocal,value为对应的变量 c. 对ThreadLocal进行get/set操作时,会先 Read More