pull/6/head
yuanguangxin 4 years ago
parent 30b2af7afe
commit 7e69818e7d

@ -261,14 +261,7 @@
<workItem from="1588302756697" duration="3701000" />
<workItem from="1588749661816" duration="451000" />
<workItem from="1589857792404" duration="221000" />
<workItem from="1591254276718" duration="1288000" />
</task>
<task id="LOCAL-00017" summary="update md">
<created>1581704713975</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1581704713975</updated>
<workItem from="1591254276718" duration="1552000" />
</task>
<task id="LOCAL-00018" summary="update q10/q746">
<created>1581705212871</created>
@ -606,7 +599,14 @@
<option name="project" value="LOCAL" />
<updated>1591254334745</updated>
</task>
<option name="localTasksCounter" value="66" />
<task id="LOCAL-00066" summary="update">
<created>1591262493149</created>
<option name="number" value="00066" />
<option name="presentableId" value="LOCAL-00066" />
<option name="project" value="LOCAL" />
<updated>1591262493149</updated>
</task>
<option name="localTasksCounter" value="67" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -691,16 +691,16 @@
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="458" y="204" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1440.900@0.0.1440.900" timestamp="1587221348872" />
<state x="404" y="60" key="CommitChangelistDialog2" timestamp="1591254334575">
<state x="404" y="60" key="CommitChangelistDialog2" timestamp="1591262493032">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state x="303" y="50" key="CommitChangelistDialog2/0.0.1440.900@0.0.1440.900" timestamp="1588749779133" />
<state x="404" y="60" key="CommitChangelistDialog2/0.0.1920.1080@0.0.1920.1080" timestamp="1591254334575" />
<state x="191" y="94" width="1152" height="720" key="DiffContextDialog" timestamp="1591254332165">
<state x="404" y="60" key="CommitChangelistDialog2/0.0.1920.1080@0.0.1920.1080" timestamp="1591262493032" />
<state x="191" y="94" width="1152" height="720" key="DiffContextDialog" timestamp="1591262490778">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state x="143" y="78" width="1152" height="720" key="DiffContextDialog/0.0.1440.900@0.0.1440.900" timestamp="1588749770793" />
<state x="191" y="94" key="DiffContextDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1591254332165" />
<state x="191" y="94" key="DiffContextDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1591262490778" />
<state x="144" y="78" width="1152" height="720" key="DiffContextDialog/0.23.1440.793@0.23.1440.793" timestamp="1582714686712" />
<state x="143" y="78" width="1152" height="720" key="DiffContextDialog/0.23.1440.797@0.23.1440.797" timestamp="1588303139733" />
<state width="1398" height="204" key="GridCell.Tab.0.bottom" timestamp="1587225087588">
@ -747,11 +747,11 @@
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="221" y="63" key="SettingsEditor/0.0.1440.900@0.0.1440.900" timestamp="1585223890241" />
<state x="427" y="228" key="Vcs.Push.Dialog.v2" timestamp="1591254336079">
<state x="427" y="228" key="Vcs.Push.Dialog.v2" timestamp="1591262494365">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state x="320" y="190" key="Vcs.Push.Dialog.v2/0.0.1440.900@0.0.1440.900" timestamp="1588749781144" />
<state x="427" y="228" key="Vcs.Push.Dialog.v2/0.0.1920.1080@0.0.1920.1080" timestamp="1591254336079" />
<state x="427" y="228" key="Vcs.Push.Dialog.v2/0.0.1920.1080@0.0.1920.1080" timestamp="1591262494365" />
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1587219014962">
<screen x="0" y="23" width="1440" height="797" />
</state>

@ -165,7 +165,7 @@ Read View就是事务进行快照读操作的时候生产的读视图在该
### Next-Key Lock
InnoDB 采用 Next-Key Lock 解决幻读问题。在`insert into test(xid) values (1), (3), (5), (8), (11);`后由于xid上是有索引的该算法总是会去锁住索引记录。现在该索引可能被锁住的范围如下(-∞, 1], (1, 3], (3, 5], (5, 8], (8, 11], (11, +∞)。Session A执行后会锁住的范围(5, 8], (8, 11]。除了锁住8所在的范围还会锁住下一个范围所谓Next-Key。
InnoDB 采用 Next-Key Lock 解决幻读问题。在`insert into test(xid) values (1), (3), (5), (8), (11);`后由于xid上是有索引的该算法总是会去锁住索引记录。现在该索引可能被锁住的范围如下(-∞, 1], (1, 3], (3, 5], (5, 8], (8, 11], (11, +∞)。Session A`select * from test where id = 8 for update`执行后会锁住的范围:(5, 8], (8, 11]。除了锁住8所在的范围还会锁住下一个范围所谓Next-Key。
### Mysql的逻辑结构
@ -515,6 +515,13 @@ AQS有两个队列同步对列和条件队列。同步队列依赖一个双
6. threadFactory线程工厂用于创建线程一般用默认的即可。
7. handler拒绝策略。当任务太多来不及处理如何拒绝任务。
### 线程池都有哪几种工作队列
1. ArrayBlockingQueue底层是数组有界队列如果我们要使用生产者-消费者模式,这是非常好的选择。
2. LinkedBlockingQueue底层是链表可以当做无界和有界队列来使用所以大家不要以为它就是无界队列。
3. SynchronousQueue本身不带有空间来存储任何元素使用上可以选择公平模式和非公平模式。
4. PriorityBlockingQueue无界队列基于数组数据结构为二叉堆数组第一个也是树的根节点总是最小值。
### 线程池的拒绝策略
1. ThreadPoolExecutor.AbortPolicy:丢弃任务并抛出RejectedExecutionException异常。

Loading…
Cancel
Save