2018-02-20 10:40:05 +08:00
<!-- GFM - TOC -->
2018-02-22 14:47:54 +08:00
* [<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ](#<23> <> һ <EFBFBD> <D2BB> -<2D> <> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [1. <20> <> <EFBFBD> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> )
* [2. <20> <> <EFBFBD> <EFBFBD> ](#2-<2D> <> <EFBFBD> <EFBFBD> )
* [3. <20> <> <EFBFBD> <EFBFBD> ](#3-<2D> <> <EFBFBD> <EFBFBD> )
* [4. <20> 첽 ](#4-<2D> 첽 )
* [ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD> )
* [<EFBFBD> жϷ<EFBFBD> <EFBFBD> <EFBFBD> ](#<23> жϷ<D0B6> <CFB7> <EFBFBD> )
* [1. <20> <> <EFBFBD> ж<EFBFBD> ](#1-<2D> <> <EFBFBD> ж<EFBFBD> )
* [2. <20> 쳣 ](#2-<2D> 쳣 )
* [3. <20> <> <EFBFBD> <EFBFBD> ](#3-<2D> <> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> ں˺<EFBFBD> <EFBFBD> ں<EFBFBD> ](#<23> <> <EFBFBD> ں˺<DABA> <EFBFBD> ں<EFBFBD> )
* [1. <20> <> <EFBFBD> ں<EFBFBD> ](#1-<2D> <> <EFBFBD> ں<EFBFBD> )
* [2. <> ں<EFBFBD> ](#2-<> ں<EFBFBD> )
* [<EFBFBD> ڶ<EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ̹<EFBFBD> <CCB9> <EFBFBD> ](#<23> ڶ<EFBFBD> <DAB6> <EFBFBD> -<2D> <> <EFBFBD> ̹<EFBFBD> <CCB9> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD> )
* [1. <20> <> <EFBFBD> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> )
* [2. <20> ߳<EFBFBD> ](#2-<2D> ߳<EFBFBD> )
* [3. <20> <> <EFBFBD> <EFBFBD> ](#3-<2D> <> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬<EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> ״̬<D7B4> <CCAC> <EFBFBD> л<EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨 ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> 㷨 )
* [1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD> )
* [1.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> FCFS<46> <53> ](#11-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> fcfs )
* [1.2 <20> <> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <D2B5> <EFBFBD> ȣ <EFBFBD> SJF<4A> <46> ](#12-<2D> <> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <D2B5> <EFBFBD> <EFBFBD> sjf )
* [1.3 <20> <> <EFBFBD> <EFBFBD> ʣ<EFBFBD> <CAA3> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> SRTN<54> <4E> ](#13-<2D> <> <EFBFBD> <EFBFBD> ʣ<EFBFBD> <CAA3> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> srtn )
* [2. <20> <> <EFBFBD> <EFBFBD> ʽ ϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD> ](#2-<2D> <> <EFBFBD> <EFBFBD> ʽ ϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD> )
* [2.1 <20> <> <EFBFBD> <EFBFBD> Ȩ<EFBFBD> <C8A8> <EFBFBD> <EFBFBD> ](#21-<2D> <> <EFBFBD> <EFBFBD> Ȩ<EFBFBD> <C8A8> <EFBFBD> <EFBFBD> )
* [2.2 ʱ<> <CAB1> Ƭ<EFBFBD> <C6AC> ת ](#22-ʱ<> <CAB1> Ƭ<EFBFBD> <C6AC> ת )
* [2.3 <20> ༶<EFBFBD> <E0BCB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#23-<2D> ༶<EFBFBD> <E0BCB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [2.4 <20> ̽<EFBFBD> <CCBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#24-<2D> ̽<EFBFBD> <CCBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [3. ʵʱϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD> ](#3-ʵʱϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> )
* [1. <20> ٽ<EFBFBD> <D9BD> <EFBFBD> ](#1-<2D> ٽ<EFBFBD> <D9BD> <EFBFBD> )
* [2. ͬ<> <CDAC> <EFBFBD> 뻥<EFBFBD> <EBBBA5> ](#2-ͬ<> <CDAC> <EFBFBD> 뻥<EFBFBD> <EBBBA5> )
* [3. <20> ź<EFBFBD> <C5BA> <EFBFBD> ](#3-<2D> ź<EFBFBD> <C5BA> <EFBFBD> )
* [4. <20> ܳ<EFBFBD> ](#4-<2D> ܳ<EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> )
* [1. <20> ܵ<EFBFBD> ](#1-<2D> ܵ<EFBFBD> )
* [2. <20> ź<EFBFBD> <C5BA> <EFBFBD> ](#2-<2D> ź<EFBFBD> <C5BA> <EFBFBD> )
* [3. <20> <> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> ](#3-<2D> <> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> )
* [4. <20> ź<EFBFBD> ](#4-<2D> ź<EFBFBD> )
* [5. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> ](#5-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> )
* [6. <20> <EFBFBD> <D7BD> <EFBFBD> ](#6-<2D> <EFBFBD> <D7BD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [1. <20> <> <EFBFBD> <EFBFBD> -д<> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> -д<> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [2. <20> <> ѧ<EFBFBD> ҽ <EFBFBD> <D2BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#2-<2D> <> ѧ<EFBFBD> ҽ <EFBFBD> <D2BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ĵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> Ĵ<EFBFBD> <C4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [2. <20> <> <EFBFBD> <EFBFBD> Ԥ<EFBFBD> <D4A4> ](#2-<2D> <> <EFBFBD> <EFBFBD> Ԥ<EFBFBD> <D4A4> )
* [2.1 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#21-<2D> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [2.2 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 뱣<EFBFBD> <EBB1A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#22-<2D> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 뱣<EFBFBD> <EBB1A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [2.3 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD> ](#23-<2D> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD> )
* [2.4 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> ·<EFBFBD> ȴ<EFBFBD> ](#24-<2D> ƻ<EFBFBD> <C6BB> <EFBFBD> ·<EFBFBD> ȴ<EFBFBD> )
* [3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#3-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [3.1 <20> <> ȫ״̬ ](#31-<2D> <> ȫ״̬ )
* [3.2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> 㷨 ](#32-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> 㷨 )
* [3.3 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> 㷨 ](#33-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> 㷨 )
* [4. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> ](#4-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> )
* [4.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨 ](#41-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨 )
* [4.2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> ](#42-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> )
* [<EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> ֶ<EFBFBD> ](#<23> <> ҳ<EFBFBD> <D2B3> <EFBFBD> ֶ<EFBFBD> )
* [1. <20> <> ҳ ](#1-<2D> <> ҳ )
* [2. <20> ֶ<EFBFBD> ](#2-<2D> ֶ<EFBFBD> )
* [3. <20> <> ҳʽ ](#3-<2D> <> ҳʽ )
* [4. <20> <> ҳ<EFBFBD> <D2B3> <EFBFBD> ֶ<EFBFBD> <D6B6> <EFBFBD> <EFBFBD> <EFBFBD> ](#4-<2D> <> ҳ<EFBFBD> <D2B3> <EFBFBD> ֶ<EFBFBD> <D6B6> <EFBFBD> <EFBFBD> <EFBFBD> )
* [ҳ<EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> 㷨 ](#ҳ<> <D2B3> <EFBFBD> û<EFBFBD> <C3BB> 㷨 )
* [1. <20> <> <EFBFBD> ѣ<EFBFBD> Optimal<61> <6C> ](#1-<2D> <> <EFBFBD> <EFBFBD> optimal )
* [2. <20> Ƚ<EFBFBD> <C8BD> ȳ<EFBFBD> <C8B3> <EFBFBD> FIFO<46> <4F> ](#2-<2D> Ƚ<EFBFBD> <C8BD> ȳ<EFBFBD> fifo )
2018-02-22 20:11:09 +08:00
* [3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δʹ <CEB4> ã<EFBFBD> LRU, Least Recently Used<65> <64> ](#3-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δʹ <CEB4> <CAB9> lru,-least-recently-used )
2018-02-22 14:47:54 +08:00
* [4. ʱ<> ӣ<EFBFBD> Clock<63> <6B> ](#4-ʱ<> <CAB1> clock )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 豸<EFBFBD> <E8B1B8> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> 豸<EFBFBD> <E8B1B8> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> ̵<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨 ](#<23> <> <EFBFBD> ̵<EFBFBD> <CCB5> <EFBFBD> <EFBFBD> 㷨 )
2018-02-22 20:11:09 +08:00
* [1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> FCFS, First Come First Serverd<72> <64> ](#1-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> fcfs,-first-come-first-serverd )
* [2. <20> <> <EFBFBD> <EFBFBD> Ѱ<EFBFBD> <D1B0> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> SSTF, Shortest Seek Time First<73> <74> ](#2-<2D> <> <EFBFBD> <EFBFBD> Ѱ<EFBFBD> <D1B0> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> sstf,-shortest-seek-time-first )
2018-02-22 14:47:54 +08:00
* [3. ɨ<> <C9A8> <EFBFBD> 㷨<EFBFBD> <E3B7A8> SCAN<41> <4E> ](#3-ɨ<> <C9A8> <EFBFBD> 㷨scan )
* [4. ѭ<> <D1AD> ɨ<EFBFBD> <C9A8> <EFBFBD> 㷨<EFBFBD> <E3B7A8> CSCAN<41> <4E> ](#4-ѭ<> <D1AD> ɨ<EFBFBD> <C9A8> <EFBFBD> 㷨cscan )
* [<EFBFBD> ο <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> ο <EFBFBD> <CEBF> <EFBFBD> <EFBFBD> <EFBFBD> )
2018-02-20 10:40:05 +08:00
<!-- GFM - TOC -->
2018-02-22 14:47:54 +08:00
# <20> <> һ <EFBFBD> <D2BB> <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָͬһ ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҪӲ<EFBFBD> <EFBFBD> ֧<EFBFBD> ֣<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˮ<EFBFBD> <EFBFBD> <EFBFBD> ߶ദ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳͨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̺<EFBFBD> <EFBFBD> ̣߳<EFBFBD> ʹ <EFBFBD> ó<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָϵͳ<EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> Թ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <EFBFBD> ̹<EFBFBD> ͬʹ <EFBFBD> á<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> Ϊ<EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӡ<EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> <EFBFBD> <EFBFBD> ͬһ ʱ<EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̷<EFBFBD> <EFBFBD> ʣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ֶ<EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> ķ<EFBFBD> <EFBFBD> ʡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ⼼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <EFBFBD> ת<EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> 塣<EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⼼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> ָ<EFBFBD> <EFBFBD> ü<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϳ շָ<EFBFBD> <EFBFBD> ü<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϲ <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> ָ<EFBFBD> <EFBFBD> ü<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <EFBFBD> ִֻ<EFBFBD> <EFBFBD> һ С <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> Ƭ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͺ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4. <20> 첽
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> 첽<EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> ̲<EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͣͣ<EFBFBD> <EFBFBD> <EFBFBD> Բ<EFBFBD> <EFBFBD> <EFBFBD> ֪<EFBFBD> <EFBFBD> <EFBFBD> ٶ<EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> ƽ <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> ̬<EFBFBD> <EFBFBD> Ҫ<EFBFBD> õ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> һ Щ<EFBFBD> <EFBFBD> <EFBFBD> ܣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫʹ <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> ôӶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ںˣ<EFBFBD> <EFBFBD> ɲ<EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> ɡ <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ĺ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 豸<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̹<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> š<EFBFBD> <EFBFBD> 洢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> жϷ<D0B6> <CFB7> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> ж<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> CPU ִ<> <D6B4> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> I/O <20> <> <EFBFBD> <EFBFBD> <EFBFBD> жϣ<D0B6> <CFA3> <EFBFBD> ʾ <EFBFBD> 豸<EFBFBD> <E8B1B8> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܹ<EFBFBD> <DCB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F3A1A3B4> <EFBFBD> <E2BBB9> ʱ<EFBFBD> <CAB1> <EFBFBD> жϡ<D0B6> <CFA1> <EFBFBD> <EFBFBD> <EFBFBD> ̨<EFBFBD> жϵȡ<CFB5>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> 쳣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> CPU ִ<> <D6B4> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <DAB2> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 롢<EFBFBD> <EBA1A2> ַԽ<D6B7> 硢<EFBFBD> <E7A1A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> á<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> ں˺<DABA> <EFBFBD> ں<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> ں<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ں<EFBFBD> <EFBFBD> ǽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܽ<EFBFBD> <EFBFBD> ϵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <EFBFBD> ںˣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڸ<EFBFBD> ģ<EFBFBD> 鹲<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> кܸߵ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <> ں<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> ϸ<EFBFBD> <EFBFBD> ӣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˽<EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> ֲ<EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƴ<EFBFBD> <EFBFBD> ںˣ<EFBFBD> <EFBFBD> Ӷ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ں˵ĸ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԡ<EFBFBD> <EFBFBD> Ƴ<EFBFBD> <EFBFBD> IJ<EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> ݷֲ<EFBFBD> <EFBFBD> <EFBFBD> ԭ<EFBFBD> ֳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɷ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҪƵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> ̬<EFBFBD> ͺ <EFBFBD> <EFBFBD> <EFBFBD> ̬֮<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> ڶ<EFBFBD> <DAB6> <EFBFBD> <20> <> <EFBFBD> ̹<EFBFBD> <CCB9> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Dz<EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ̿<EFBFBD> <EFBFBD> ƿ<EFBFBD> (Process Control Block, PCB) <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵Ļ<CCB5> <C4BB> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬<D7B4> <CCAC> <EFBFBD> <EFBFBD> ν <EFBFBD> Ĵ<EFBFBD> <C4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̺ͳ<CCBA> <CDB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <CCA3> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> PCB <20> IJ<EFBFBD> <C4B2> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> ߳<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
һ <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD> <EFBFBD> п<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̣߳<EFBFBD> <EFBFBD> Ƕ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȵĻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <EFBFBD> ͬһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е Ķ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD> ֮<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Բ<EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ӵ<> <D3B5> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> Ļ<EFBFBD> <C4BB> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̲߳<DFB3> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> ߳̿<DFB3> <CCBF> Է<EFBFBD> <D4B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵<EFBFBD> <CCB5> <EFBFBD> Դ<EFBFBD> <D4B4>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> ȣ <EFBFBD> <C8A3> ߳<EFBFBD> <DFB3> Ƕ<EFBFBD> <C7B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȵĻ<C8B5> <C4BB> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> ͬһ <CDAC> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <D0A3> ̵߳<DFB3> <CCB5> л<EFBFBD> <D0BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <D0BB> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <DAB5> ߳<EFBFBD> <DFB3> л<EFBFBD> <D0BB> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> ߳<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <D0BB> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFB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6A4> <EFBFBD> ݵ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> ̼߳<DFB3> <CCBC> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> ֱ<EFBFBD> Ӷ<EFBFBD> /д<> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݶΣ<DDB6> <CEA3> <EFBFBD> ȫ<EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> š<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> QQ <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <CCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> кܶ<D0BA> <DCB6> ̣߳<DFB3> <CCA3> <EFBFBD> <EFBFBD> <EFBFBD> http <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ̡߳<DFB3> <CCA1> ¼<EFBFBD> <C2BC> <EFBFBD> Ӧ<EFBFBD> ̡߳<DFB3> <CCA1> <EFBFBD> Ⱦ<EFBFBD> ̵߳ȵȣ <C8B5> <C8A3> ̵߳IJ<CCB5> <C4B2> <EFBFBD> ִ<EFBFBD> <D6B4> ʹ <EFBFBD> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӴӶ<D3B4> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> http <20> <> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> ״̬<D7B4> <CCAC> <EFBFBD> л<EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/1706ce58-a081-4fed-9b36-c3c0d7e22b3a.jpg)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬<EFBFBD> <EFBFBD> ȱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> Ӷ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬ת<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǹ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> CPU<50> <55> ȱ<EFBFBD> <C8B1> CPU <20> <> <EFBFBD> ý<EFBFBD> <C3BD> ̴<EFBFBD> <CCB4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<CEB5> ȡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 㷨
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> Բ<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ۵ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 1.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> FCFS<46> <53>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
first-come first-serverd<72> <64>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƚ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڳ<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ ֱ<EFBFBD> ȴ<EFBFBD> ǰ<EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> <EFBFBD> <EFBFBD> ҵִ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϲ <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫִ<EFBFBD> кܳ<EFBFBD> ʱ<EFBFBD> 䣬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˶<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> ȴ<EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 1.2 <20> <> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <D2B5> <EFBFBD> ȣ <EFBFBD> SJF<4A> <46>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
shortest job first<73> <74>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ȹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> п<EFBFBD> <EFBFBD> ܻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ ֱ<EFBFBD> ȴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵִ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> ״̬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ ֱ<EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> Զ<EFBFBD> ò<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 1.3 <20> <> <EFBFBD> <EFBFBD> ʣ<EFBFBD> <CAA3> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> SRTN<54> <4E>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
shortest remaining time next<78> <74>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> <> <EFBFBD> <EFBFBD> ʽ ϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.1 <20> <> <EFBFBD> <EFBFBD> Ȩ<EFBFBD> <C8A8> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ˿<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֶ<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B5> <EFBFBD> ܻ<EFBFBD> <DCBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⣬<EFBFBD> <E2A3AC> Ϊ<EFBFBD> <CEAA> <EFBFBD> ŵȴ<C5B5> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> <D3A6> Ҳ<EFBFBD> <D2B2> Խ<EFBFBD> <D4BD> Խ<EFBFBD> ߡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.2 ʱ<> <CAB1> Ƭ<EFBFBD> <C6AC> ת
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̰<EFBFBD> FCFS <20> <> ԭ<EFBFBD> <D4AD> <EFBFBD> ų<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> ÿ<EFBFBD> ε<EFBFBD> <CEB5> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> CPU <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <D7BD> ̣<EFBFBD> <CCA3> ý<EFBFBD> <C3BD> ̿<EFBFBD> <CCBF> <EFBFBD> ִ<EFBFBD> <D6B4> һ <EFBFBD> <D2BB> ʱ<EFBFBD> <CAB1> Ƭ<EFBFBD> <C6AC> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> Ƭ<EFBFBD> <C6AC> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> ɼ<EFBFBD> ʱ<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FBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> Ƭ̫<EFBFBD> ̣<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> ̫Ƶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <EFBFBD> ϾͻỨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> 䡣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.3 <20> ༶<EFBFBD> <E0BCB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/042cf928-3c8e-4815-ae9c-f2780202c68f.png)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> ö<EFBFBD> <C3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <D0A3> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> и<EFBFBD> <D0B8> 費ͬ<E8B2BB> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <C8BC> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <C8BC> <EFBFBD> <EFBFBD> ߣ<EFBFBD> <DFA3> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ȩ<EFBFBD> <C8A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͡<EFBFBD> <CDA1> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <E3B7A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD> ִ<EFBFBD> <D6B4> ʱ<EFBFBD> <CAB1> Ƭ<EFBFBD> Ĵ<EFBFBD> С Ҳ<D0A1> <D2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȨԽ<C8A8> ߵ Ķ<DFB5> <C4B6> <EFBFBD> <EFBFBD> У <EFBFBD> Ϊÿ<CEAA> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 涨<EFBFBD> <E6B6A8> ִ<EFBFBD> <D6B4> ʱ<EFBFBD> <CAB1> Ƭ<EFBFBD> <C6AC> ԽС <D4BD> <D0A1>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> һ <EFBFBD> <D2BB> <EFBFBD> ½<EFBFBD> <C2BD> ̽<EFBFBD> <CCBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƚ<EFBFBD> <C8BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> е <EFBFBD> ĩβ<C4A9> <CEB2> <EFBFBD> <EFBFBD> FCFS ԭ<> <D4AD> <EFBFBD> Ŷӵȴ<D3B5> <C8B4> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> ý<EFBFBD> <C3BD> <EFBFBD> ִ<EFBFBD> <D6B4> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڸ<EFBFBD> ʱ<EFBFBD> <CAB1> Ƭ<EFBFBD> <C6AC> <EFBFBD> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ<CFB5> <CDB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> ʱ<EFBFBD> <CAB1> Ƭ<EFBFBD> <C6AC> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> δ<EFBFBD> <CEB4> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> <EFBFBD> ȳ<EFBFBD> <C8B3> <EFBFBD> <EFBFBD> 㽫<EFBFBD> ý<EFBFBD> <C3BD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> е Ķ<D0B5> β<EFBFBD> <CEB2>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ǰ i -1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> Ż<EFBFBD> <C5BB> <EFBFBD> <EFBFBD> ȵ<EFBFBD> i <20> <> <EFBFBD> <EFBFBD> <EFBFBD> е Ľ<D0B5> <C4BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ŵ㣺ʵʱ<EFBFBD> Ժã<EFBFBD> Ҳ<EFBFBD> ʺ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> ͳ<EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.4 <20> ̽<EFBFBD> <CCBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. ʵʱϵͳ<CFB5> е ĵ<D0B5> <C4B5> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ʵʱϵͳҪһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ȷ<EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> ڵõ<EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ΪӲʵʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵʱ<EFBFBD> <EFBFBD> ǰ<EFBFBD> ߱<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԵĽ<EFBFBD> ֹʱ<EFBFBD> 䣬<EFBFBD> <EFBFBD> <EFBFBD> ߿<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> ʱ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> ٽ<EFBFBD> <D9BD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> з<EFBFBD> <EFBFBD> ʵ<EFBFBD> <EFBFBD> Ƕδ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Ϊ<EFBFBD> ˻<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> ÿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> ֮ǰ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> Ƚ<EFBFBD> <EFBFBD> м<EFBFBD> <EFBFBD> 顣
2018-02-20 10:40:05 +08:00
```html
// entry section
// critical section;
// exit section
```
2018-02-22 14:47:54 +08:00
### 2. ͬ<> <CDAC> <EFBFBD> 뻥<EFBFBD> <EBBBA5>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ͬ<EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̰<EFBFBD> һ <EFBFBD> <EFBFBD> ˳<EFBFBD> <EFBFBD> ִ<EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬһ ʱ<EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵĻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> ͨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. <20> ź<EFBFBD> <C5BA> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> ź<EFBFBD> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD> Samaphore<72> <65> **<2A> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ͱ<EFBFBD> <CDB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> ִ<EFBFBD> <D6B4> down <20> <> up <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD> <D2B2> <EFBFBD> dz<EFBFBD> <C7B3> <EFBFBD> <EFBFBD> <EFBFBD> P <20> <> V <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- **down** : <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0 <20> <> ִ<EFBFBD> <D6B4> - 1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0<> <30> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˯<EFBFBD> ߣ<EFBFBD> <DFA3> ȴ<EFBFBD> <C8B4> ź<EFBFBD> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0<> <30>
- **up**<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ִ<EFBFBD> <D6B4> + 1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> ˯<EFBFBD> ߵ Ľ<DFB5> <C4BD> ̣<EFBFBD> <CCA3> ý<EFBFBD> <C3BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> down <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
down <20> <> up <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> Ƴ<EFBFBD> ԭ<EFBFBD> <EFBFBD> <EFA3AC> <EFBFBD> ɷָͨ<EEA3AC> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> <EFBFBD> <EFBFBD> Щ<EFBFBD> <D0A9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> жϡ<D0B6>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡֵֻ<EFBFBD> <EFBFBD> Ϊ 0 <20> <> <EFBFBD> <EFBFBD> 1<> <31> <EFBFBD> <EFBFBD> ô<EFBFBD> ͳ<EFBFBD> Ϊ<EFBFBD> <CEAA> **<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Mutex<65> <78> **<2A> <> 0 <20> <> ʾ <EFBFBD> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1 <20> <> ʾ <EFBFBD> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```c
typedef int samaphore;
samaphore mutex = 1;
void P1() {
down(mutex);
2018-02-22 14:47:54 +08:00
// <20> ٽ<EFBFBD> <D9BD> <EFBFBD>
2018-02-20 10:40:05 +08:00
up(mutex);
}
void P2() {
down(mutex);
2018-02-22 14:47:54 +08:00
// <20> ٽ<EFBFBD> <D9BD> <EFBFBD>
2018-02-20 10:40:05 +08:00
up(mutex);
}
```
2018-02-22 14:47:54 +08:00
**ʹ <> <CAB9> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ʹ <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> mutex <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <D9BD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> з<EFBFBD> <D0B7> ʣ<EFBFBD> empty <20> <> ¼<EFBFBD> ջ<EFBFBD> <D5BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> full <20> <> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ע<EFBFBD> ⣬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <EFBFBD> down <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȶ<EFBFBD> <C8B6> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȼ<EFBFBD> <C8BB> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> down <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD> <DFB6> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> down(empty) <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> empty = 0<> <30> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˯<EFBFBD> ߡ<EFBFBD> <DFA1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߴ <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> ܽ<EFBFBD> <DCBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD> <DFB6> ٽ<EFBFBD> <D9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˣ<EFBFBD> Ҳ<EFBFBD> <D2B2> <EFBFBD> <EFBFBD> <DEB7> <EFBFBD> ִ<EFBFBD> <D6B4> up(empty) <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> <C3B4> <EFBFBD> <EFBFBD> <EFBFBD> ߺ <EFBFBD> <DFBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߾ͻ<DFBE> һ ֱ<D2BB> ȴ<EFBFBD> <C8B4> <EFBFBD> ȥ<EFBFBD> <C8A5>
2018-02-20 10:40:05 +08:00
```c
#define N 100
typedef int samaphore;
samaphore mutex = 1;
samaphore empty = N;
samaphore full = 0;
void producer() {
while(TRUE){
int item = produce_item;
down(empty);
down(mutex);
insert_item(item);
up(mutex);
up(full);
}
}
void consumer() {
while(TRUE){
down(full);
down(mutex);
int item = remove_item(item);
up(mutex);
up(empty);
consume_item(item);
}
}
```
2018-02-22 14:47:54 +08:00
### 4. <20> ܳ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ʹ <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ֵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> ͻ<EFBFBD> <EFBFBD> ˴ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̰ܳѿ<EFBFBD> <EFBFBD> ƵĴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ׳ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҳʹ <EFBFBD> ÿͻ<EFBFBD> <EFBFBD> ˴ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ø<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ס <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
c <20> <> <EFBFBD> Բ<EFBFBD> ֧<EFBFBD> ֹ̣ܳ<DCB3> <CCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Pascal <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̡ܳ<DCB3> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е Ĺܳ<C4B9> <DCB3> ṩ<EFBFBD> <E1B9A9> insert() <20> <> remove() <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͻ<EFBFBD> <CDBB> ˴ <EFBFBD> <CBB4> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⡣
2018-02-20 10:40:05 +08:00
```html
monitor ProducerConsumer
integer i;
condition c;
procedure insert();
begin
end;
procedure remove();
begin
end;
end monitor;
```
2018-02-22 14:47:54 +08:00
<EFBFBD> ܳ<EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> ԣ<EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> ù̡ܳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> е <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ ֱռ <EFBFBD> ụ̀ܳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 뽫<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> ù̡ܳ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ܳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ** <20> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> صIJ<D8B5> <C4B2> <EFBFBD> <EFBFBD> <EFBFBD> **wait()** <20> <> **signal()** <20> <> ʵ<EFBFBD> <CAB5> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> wait() <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ᵼ<EFBFBD> µ<EFBFBD> <C2B5> ý<EFBFBD> <C3BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѹܳ<D1B9> <DCB3> ó<EFBFBD> <C3B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ̳<EFBFBD> <CCB3> С <EFBFBD> signal() <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڻ<EFBFBD> <DABB> ѱ<EFBFBD> <D1B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <C4BD> ̡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**ʹ <> ùܳ<C3B9> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
```html
monitor ProducerConsumer
condition full, empty;
integer count := 0;
condition c;
procedure insert(item: integer);
begin
if count = N then wait(full);
insert_item(item);
count := count + 1;
if count = 1 ten signal(empty);
end;
function remove: integer;
begin
if count = 0 then wait(empty);
remove = remove_item;
count := count - 1;
if count = N -1 then signal(full);
end;
end monitor;
procedure producer
begin
while true do
begin
item = produce_item;
ProducerConsumer.insert(item);
end
end;
procedure consumer
begin
while true do
begin
item = ProducerConsumer.remove;
consume_item(item);
end
end;
```
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> ſ <EFBFBD> <EFBFBD> Կ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Dz<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> ̼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD> ͨ<EFBFBD> ţ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵߳<EFBFBD> ͨ<EFBFBD> ŷ<EFBFBD> ʽ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫʹ <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ơ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> ܵ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ܵ<EFBFBD> <EFBFBD> ǵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ġ<EFBFBD> <EFBFBD> Ƚ<EFBFBD> <EFBFBD> ȳ<EFBFBD> <EFBFBD> ġ<EFBFBD> <EFBFBD> ṹ<EFBFBD> ġ<EFBFBD> <EFBFBD> ̶<EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> ֽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڹܵ<EFBFBD> <EFBFBD> <EFBFBD> β<EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <EFBFBD> <EFBFBD>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FBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼд<EFBFBD> ܵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̴ӹܵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֮ǰ<EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> ̽<EFBFBD> һ ֱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Linux <20> йܵ<D0B9> <DCB5> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> ʵ<EFBFBD> ֡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ܵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֣<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> ͨ<EFBFBD> ܵ<EFBFBD> <DCB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> һ <EFBFBD> <D2BB> ֻ֧<D6BB> ְ<EFBFBD> ˫<EFBFBD> <CBAB> ͨ<EFBFBD> ŷ<EFBFBD> ʽ <EFBFBD> <CABD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> ܵ<EFBFBD> <DCB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䣻<EFBFBD> <E4A3BB> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> <EFBFBD> ڸ<EFBFBD> <DAB8> ӽ<EFBFBD> <D3BD> <EFBFBD> ֮<EFBFBD> <D6AE> ʹ <EFBFBD> ã<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> ܵ<EFBFBD> <DCB5> <EFBFBD> ȥ<EFBFBD> <C8A5> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> ֧<EFBFBD> <D6A7> ˫<EFBFBD> <CBAB> <EFBFBD> <EFBFBD> <EFBFBD> 䣻
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ܵ<EFBFBD> <DCB5> <EFBFBD> ȥ<EFBFBD> <C8A5> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> <C6A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> ؽ<EFBFBD> <D8BD> <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> š<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> ź<EFBFBD> <C5BA> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ź<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFB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00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ϣ<EFBFBD> <EFBFBD> <EFBFBD> п˷<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> źŴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> ١ <EFBFBD> <EFBFBD> ܵ<EFBFBD> ֻ<EFBFBD> ܳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ <EFBFBD> ֽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Լ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȱ<EFBFBD> 㡣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4. <20> ź<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ź<EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> ֱȽϸ<EFBFBD> <EFBFBD> ӵ<EFBFBD> ͨ<EFBFBD> ŷ<EFBFBD> ʽ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֪ͨ<EFBFBD> <EFBFBD> <EFBFBD> ս <EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <EFBFBD> Ѿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 5. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EF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5BB> ƣ<EFBFBD> <C6A3> <EFBFBD> <EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> ã<EFBFBD> <C3A3> <EFBFBD> ʵ<EFBFBD> ֽ<EFBFBD> <D6BD> ̼<EFBFBD> <CCBC> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> ͨ<EFBFBD> š<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 6. <20> <EFBFBD> <D7BD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> һ <EFBFBD> ֽ<EFBFBD> <EFBFBD> ̼<EFBFBD> ͨ<EFBFBD> Ż<EFBFBD> <EFBFBD> ƣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> Ż<EFBFBD> <EFBFBD> Ʋ<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> ǣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> š<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߺ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ۹<EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> <EFBFBD> -д<> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݽ<EFBFBD> <EFBFBD> ж<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Dz<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> Լ<EFBFBD> д<EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͱ<EFBFBD> <EFBFBD> <EFBFBD> count <20> <> ¼<EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> ݽ<EFBFBD> <DDBD> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <C4BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> count_mutex <20> <> <EFBFBD> ڶ<EFBFBD> count <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> data_mutex <20> <> <EFBFBD> ڶԶ<DAB6> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```c
typedef int semaphore;
semaphore count_mutex = 1;
semaphore data_mutex = 1;
int count = 0;
void reader() {
while(TRUE) {
down(count_mutex);
count++;
2018-02-22 14:47:54 +08:00
if(count == 1) down(data_mutex); // <20> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> ݽ<EFBFBD> <DDBD> м<EFBFBD> <D0BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֹд<D6B9> <D0B4> <EFBFBD> ̷<EFBFBD> <CCB7> <EFBFBD>
2018-02-20 10:40:05 +08:00
up(count_mutex);
read();
down(count_mutex);
count--;
if(count == 0) up(data_mutex);
up(count_mutex);
}
}
void writer() {
while(TRUE) {
down(data_mutex);
write();
up(data_mutex);
}
}
```
2018-02-22 14:47:54 +08:00
### 2. <20> <> ѧ<EFBFBD> ҽ <EFBFBD> <D2BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/a9077f06-7584-4f2b-8c20-3a8e46928820.jpg)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EF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FBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱߵ Ŀ<EFBFBD> <EFBFBD> ӣ<EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱߵ Ŀ<EFBFBD> <EFBFBD> ӣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```c
#define N 5
#define LEFT (i + N - 1) % N
#define RIGHT (i + N) % N
typedef int semaphore;
semaphore chopstick[N];
void philosopher(int i) {
while(TURE){
think();
down(chopstick[LEFT[i]]);
down(chopstick[RIGHT[i]]);
eat();
up(chopstick[RIGHT[i]]);
up(chopstick[LEFT[i]]);
}
}
```
2018-02-22 14:47:54 +08:00
Ϊ<EFBFBD> ˷<EFBFBD> ֹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ķ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Լ<EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ Ŀ<EFBFBD> <EFBFBD> ӣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> <EFBFBD> Ƕδ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```c
semaphore mutex = 1;
void philosopher(int i) {
while(TURE){
think();
down(mutex);
down(chopstick[LEFT[i]]);
down(chopstick[RIGHT[i]]);
up(mutex);
eat();
down(mutex);
up(chopstick[RIGHT[i]]);
up(chopstick[LEFT[i]]);
up(mutex);
}
}
```
2018-02-22 14:47:54 +08:00
# <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/c037c901-7eae-4e31-a1e4-9d41329e5c3e.png)
2018-02-22 14:47:54 +08:00
1. <20> <> <EFBFBD> <EFBFBD>
2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 뱣<EFBFBD> ֣<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ѻ<EFBFBD> <D1BB> õ<EFBFBD> <C3B5> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> ֲ<EFBFBD> <D6B2> š<EFBFBD>
3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ
4. <20> <> ·<EFBFBD> ȴ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ĵ<EFBFBD> <C4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ͷ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⡣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ֲ<EFBFBD> <EFBFBD> Բ<EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> <> <EFBFBD> <EFBFBD> Ԥ<EFBFBD> <D4A4>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ڳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֮ǰԤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.1 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѻ<EFBFBD> <EFBFBD> <EFBFBD> ӡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɸ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ψһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӡ<EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǵ<EFBFBD> ӡ<EFBFBD> <EFBFBD> <EFBFBD> ػ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.2 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 뱣<EFBFBD> <EBB1A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
һ <EFBFBD> <EFBFBD> ʵ<EFBFBD> ַ<EFBFBD> ʽ <EFBFBD> ǹ涨<EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڿ<EFBFBD> ʼ ִ<EFBFBD> <EFBFBD> ǰ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> ȫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.3 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 2.4 <20> ƻ<EFBFBD> <C6BB> <EFBFBD> ·<EFBFBD> ȴ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դͳһ <EFBFBD> <EFBFBD> <EFBFBD> ţ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> ܰ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˳<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ڳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> ⷢ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 3.1 <20> <> ȫ״̬
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/ed523051-608f-4c3f-b343-383e2d194470.png)
2018-02-22 14:47:54 +08:00
ͼ a <20> ĵڶ<C4B5> <DAB6> <EFBFBD> has <20> <> ʾ <EFBFBD> <CABE> ӵ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> max <20> <> ʾ <EFBFBD> ܹ<EFBFBD> <DCB9> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> free <20> <> ʾ <EFBFBD> <CABE> <EFBFBD> п<EFBFBD> <D0BF> <EFBFBD> ʹ <EFBFBD> õ<EFBFBD> <C3B5> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ a <20> <> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> B ӵ<> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> B<> <42> <EFBFBD> <EFBFBD> ʱ free <20> <> Ϊ 4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> ķ<EFBFBD> ʽ <EFBFBD> <CABD> <EFBFBD> <EFBFBD> C <20> <> A<> <41> ʹ <EFBFBD> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> ̶<EFBFBD> <CCB6> ܳɹ<DCB3> <C9B9> <EFBFBD> <EFBFBD> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> ˿<EFBFBD> <CBBF> Գ<EFBFBD> ͼ a <20> <> ʾ <EFBFBD> <CABE> ״̬ʱ<CCAC> <CAB1> ȫ<EFBFBD> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> 壺<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҽ<EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <EFBFBD> <EFBFBD> ͻȻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> Ȼ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> ֵ<EFBFBD> <EFBFBD> ȴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܹ<EFBFBD> ʹ <EFBFBD> <EFBFBD> ÿһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƹ<EFBFBD> ״̬<EFBFBD> ǰ<EFBFBD> ȫ<EFBFBD> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 3.2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> 㷨
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
һ <EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> мң<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ Ⱥ<EFBFBD> ͻ<EFBFBD> <EFBFBD> ֱ<EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> Ĵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> <EFBFBD> 㷨Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ж϶<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 벻<EFBFBD> <EFBFBD> ȫ״̬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǣ<EFBFBD> <EFBFBD> ; ܾ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Է<EFBFBD> <EFBFBD> 䡣
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/d160ec2e-cfe2-4640-bda7-62f53e58b8c0.png)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ͼ c Ϊ<> <CEAA> <EFBFBD> <EFBFBD> ȫ״̬<D7B4> <CCAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <E3B7A8> <EFBFBD> ܾ<EFBFBD> ֮ǰ<D6AE> <C7B0> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<F3A3ACB4> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ c <20> е <EFBFBD> ״̬<D7B4> <CCAC>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 3.3 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> 㷨
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/62e0dd4f-44c3-43ee-bb6e-fedb9e068519.png)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ͼ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <EFBFBD> ĸ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> ͼ<EFBFBD> <EFBFBD> ʾ <EFBFBD> Ѿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> ұߵ <EFBFBD> ͼ<EFBFBD> <EFBFBD> ʾ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ұߵ <EFBFBD> E<> <45> P <20> Լ<EFBFBD> A <20> ֱ<EFBFBD> <D6B1> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> ѷ<EFBFBD> <D1B7> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǿ<EFBFBD> <C7BE> <EFBFBD> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> A=(1020)<29> <> <EFBFBD> <EFBFBD> ʾ 4 <20> <> <EFBFBD> <EFBFBD> Դ<EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> ʣ<EFBFBD> <CAA3> 1/0/2/0<> <30>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ״̬<EFBFBD> Ƿ<EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <EFBFBD> <EFBFBD> £<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ұߵ ľ<DFB5> <C4BE> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> С <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> A<> <41> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <D0A3> <EFBFBD> ôϵͳ<CFB5> <CDB3> <EFBFBD> ᷢ<EFBFBD> <E1B7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬<D7B4> Dz<EFBFBD> <C7B2> <EFBFBD> ȫ<EFBFBD> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <D2B5> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> ý<EFBFBD> <C3BD> ̱<EFBFBD> <CCB1> <EFBFBD> Ϊ<EFBFBD> <CEAA> ֹ<EFBFBD> <D6B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѷ<EFBFBD> <D1B7> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> ӵ<EFBFBD> A <20> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> ظ<EFBFBD> <D8B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> ̶<EFBFBD> <CCB6> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ֹ<EFBFBD> <D6B9> <EFBFBD> <EFBFBD> ״̬ʱ<CCAC> <CAB1> ȫ<EFBFBD> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <EFBFBD> ֯<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <EFBFBD> ʩ<EFBFBD> <EFBFBD> <EFBFBD> лָ<EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 4.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ļ<EFBFBD> <EFBFBD> <EFBFBD> ˼<EFBFBD> <EFBFBD> <EFBFBD> ǣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> ܹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㣬<EFBFBD> <EFBFBD> ô<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> У <EFBFBD> <EFBFBD> ͷ<EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> Ȼ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/e1eda3d5-5ec8-4708-8e25-1a04c5e11f48.png)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ͼ<EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> ÿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> £<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
E <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD>
A <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դʣ<D4B4> <CAA3> <EFBFBD> <EFBFBD>
C <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿһ <C3BF> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
R <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> P< sub > 1< / sub > <20> <> P< sub > 2< / sub > <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> ò<EFBFBD> <C3B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㣬ֻ<E3A3AC> н<EFBFBD> <D0BD> <EFBFBD> P< sub > 3< / sub > <20> <> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> P< sub > 3< / sub > ִ<> У <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> ͷ<EFBFBD> P< sub > 3< / sub > ӵ<> е <EFBFBD> <D0B5> <EFBFBD> Դ<EFBFBD> <D4B4> <EFBFBD> <EFBFBD> ʱ A = (2 2 2 0)<29> <> P< sub > 1< / sub > <20> <> <EFBFBD> <EFBFBD> ִ<EFBFBD> У <EFBFBD> ִ<EFBFBD> к<EFBFBD> <D0BA> ͷ<EFBFBD> P< sub > 1< / sub > ӵ<> е <EFBFBD> <D0B5> <EFBFBD> Դ<EFBFBD> <D4B4> A = (4 2 2 2) <20> <> P< sub > 2< / sub > Ҳ<> <D2B2> <EFBFBD> <EFBFBD> ִ<EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> ̶<EFBFBD> <CCB6> <EFBFBD> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> ִ<EFBFBD> У <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> 㷨<EFBFBD> ܽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> £<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ÿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʼ ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǣ<EFBFBD> ִ<EFBFBD> й<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> п<EFBFBD> <EFBFBD> ܱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> κ<EFBFBD> û<EFBFBD> б <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǵĽ<EFBFBD> <EFBFBD> ̶<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ѱ<> <D1B0> һ <EFBFBD> <D2BB> û<EFBFBD> б <EFBFBD> <D0B1> ǵĽ<C7B5> <C4BD> <EFBFBD> P< sub > i< / sub > <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԴС <EFBFBD> ڵ<EFBFBD> <EFBFBD> <EFBFBD> A<> <41>
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <D2B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <CCA3> <EFBFBD> ô<EFBFBD> <C3B4> C <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> i <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> A <20> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> Ǹý<C7B8> <C3BD> ̣<EFBFBD> <CCA3> <EFBFBD> ת<EFBFBD> <D7AA> <20> ١ <EFBFBD>
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <CCA3> 㷨<EFBFBD> <E3B7A8> ֹ<EFBFBD> <D6B9>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
#### 4.2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ <EFBFBD> ָ<EFBFBD>
<EFBFBD> <EFBFBD> ɱ<> <C9B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ÿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> <EFBFBD> <EFBFBD> Լ<EFBFBD> <EFBFBD> ĵ<EFBFBD> ַ<EFBFBD> ռ 䣬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> ռ 䱻<EFBFBD> ָ<EFBFBD> <EFBFBD> ɶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 飬ÿһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊһ ҳ<> <D2B3> <EFBFBD> <EFBFBD> Щҳ<D0A9> <D2B3> ӳ<EFBFBD> 䵽<EFBFBD> <E4B5BD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ棬<DAB4> <E6A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫӳ<D2AA> 䵽<EFBFB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D> <EFBFBD> <EFBFBD> ȱʧ<EFBFBD> IJ<EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ沢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <EFBFBD> ʧ<EFBFBD> ܵ<EFBFBD> ָ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> ҳ<EFBFBD> <D2B3> <EFBFBD> ֶ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> ҳ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ַ<EFBFBD> ռ 䱻<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> ɹ̶<EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> أ<EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> ռ <EFBFBD> <EFBFBD> ֳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɸ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 飬ҳ<EFBFBD> Ϳ <EFBFBD> <EFBFBD> Ĵ<EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <EFBFBD> ɽ<EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> ʵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɢ<EFBFBD> <EFBFBD> <EFBFBD> 䣬<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ά<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֮<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> ֶ<EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/22de0538-7c6e-4365-bd3b-8ce3c5900216.png)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ͼΪһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ķ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 4 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ƕ<EFBFBD> ̬<EFBFBD> <CCAC> <EFBFBD> <EFBFBD> <EFBFBD> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> ÷<EFBFBD> ҳϵͳ<CFB5> <CDB3> һ ά<D2BB> <CEAC> ַ<EFBFBD> ռ 䣬<D5BC> <E4A3AC> ̬<EFBFBD> <CCAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ص<EFBFBD> <D8B5> ᵼ<EFBFBD> ¸ <EFBFBD> <C2B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> <C4B3> ֡<EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/e0900bb2-220a-43b7-9aa9-1d5cd55ff56e.png)
2018-02-22 14:47:54 +08:00
<EFBFBD> ֶε<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> ÿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֳɶΣ<EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> ι <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ַ<EFBFBD> ռ 䡣ÿ<EFBFBD> <EFBFBD> <EFBFBD> εij<EFBFBD> <EFBFBD> ȿ<EFBFBD> <EFBFBD> Բ<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> ̬<EFBFBD> ı 䡣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ÿ<EFBFBD> <EFBFBD> <EFBFBD> ζ<EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ա<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. <20> <> ҳʽ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ÷ֶη<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 洢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ַ<EFBFBD> ռ 䰴<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ֳɻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĶΣ<EFBFBD> <EFBFBD> <EFBFBD> ÿһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Լ<EFBFBD> <EFBFBD> Ķ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٰ<EFBFBD> ÿ<EFBFBD> ηֳɹ̶<EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ÷<EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> 档<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> ȵĴ洢<EFBFBD> 飬<EFBFBD> <EFBFBD> װ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> κ<EFBFBD> һ ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> ĵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> е ġ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֿɰ<EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ֹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4. <20> <> ҳ<EFBFBD> <D2B3> <EFBFBD> ֶ<EFBFBD> <D6B6> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <20> Գ<EFBFBD> <D4B3> <EFBFBD> Ա<EFBFBD> <D4B1> <EFBFBD> <CDB8> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> ҳ<D2B3> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿֶ<C7B7> <D6B6> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> Ա<EFBFBD> <D4B1> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> Ρ <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFB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> ռ 䲢<D5BC> <E4B2A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڹ<EFBFBD> <DAB9> <EFBFBD> <EFBFBD> ͱ<EFBFBD> <CDB1> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## ҳ<> <D2B3> <EFBFBD> û<EFBFBD> <C3BB> 㷨
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ڳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> й<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ҳ<EFBFBD> 治<EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ棬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> пռ <EFBFBD> ʱ<EFBFBD> <EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ҳ<EFBFBD> 浽<EFBFBD> <EFBFBD> <EFBFBD> ̶Ի<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҽ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> С <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> 㷨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҪĿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ ҳ<EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> Ƶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͣ<EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵ȱҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͣ<EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1. <20> <> <EFBFBD> ѣ<EFBFBD> Optimal<61> <6C>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> <EFBFBD> ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> 潫<EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <EFBFBD> ٱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʣ<EFBFBD> ͨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ա<EFBFBD> ֤<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵<EFBFBD> ȱҳ<EFBFBD> ʡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <EFBFBD> 㷨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> ֪<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> ᱻ<EFBFBD> ٷ<EFBFBD> <EFBFBD> ʵ<EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> ϵͳΪij<EFBFBD> <EFBFBD> <EFBFBD> ̷<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 飬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
7<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 1<EFBFBD> <EFBFBD> 2<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 3<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 4<EFBFBD> <EFBFBD> 2<EFBFBD> <EFBFBD> 3<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 3<EFBFBD> <EFBFBD> 2<EFBFBD> <EFBFBD> 1<EFBFBD> <EFBFBD> 2<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 1<EFBFBD> <EFBFBD> 7<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 1
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> Ƚ<EFBFBD> 7,0,1 <20> <> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <D2B3> װ<EFBFBD> <D7B0> <EFBFBD> ڴ档<DAB4> <E6A1A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <D2B3> 2 ʱ<> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȱҳ<C8B1> жϣ<D0B6> <CFA3> Ὣҳ<E1BDAB> <D2B3> 7 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊҳ<CEAA> <D2B3> 7 <20> ٴα <D9B4> <CEB1> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EEB3A4>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 2. <20> Ƚ<EFBFBD> <C8BD> ȳ<EFBFBD> <C8B3> <EFBFBD> FIFO<46> <4F>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƚ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> 档
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> 㷨<EFBFBD> Ὣ<EFBFBD> <EFBFBD> Щ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ҳ<EFBFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> ʹ ȱҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 20:11:09 +08:00
### 3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δʹ <CEB4> ã<EFBFBD> LRU, Least Recently Used<65> <64>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ȼ<EFBFBD> <EFBFBD> ֪<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫʹ <EFBFBD> õ<EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǿ<EFBFBD> <EFBFBD> <EFBFBD> ֪<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȥʹ <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> LRU <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δʹ <CEB4> õ<EFBFBD> ҳ<EFBFBD> 滻<EFBFBD> <E6BBBB> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 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D> <EFBFBD> <EFBFBD> ջ<EFBFBD> ס <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
4<EFBFBD> <EFBFBD> 7<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 7<EFBFBD> <EFBFBD> 1<EFBFBD> <EFBFBD> 0<EFBFBD> <EFBFBD> 1<EFBFBD> <EFBFBD> 2<EFBFBD> <EFBFBD> 1<EFBFBD> <EFBFBD> 2<EFBFBD> <EFBFBD> 6
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/eb859228-c0f2-4bce-910d-d9f76929352b.png)
2018-02-22 14:47:54 +08:00
### 4. ʱ<> ӣ<EFBFBD> Clock<63> <6B>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Clock ҳ<> <D2B3> <EFBFBD> û<EFBFBD> <C3BB> 㷨<EFBFBD> <E3B7A8> Ҫ<EFBFBD> õ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> ҳ<EFBFBD> 汻<EFBFBD> <E6B1BB> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> Ϊ 1<> <31>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӳ<EFBFBD> һ <EFBFBD> <EFBFBD> ѭ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> ȱҳ<EFBFBD> жϷ<EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 鵱ǰָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> ҳ<EFBFBD> <EFBFBD> <EFBFBD> ķ<EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λΪ 0<> <30> <EFBFBD> ͽ<EFBFBD> <CDBD> <EFBFBD> ҳ<EFBFBD> 滻<EFBFBD> <E6BBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> ķ<EFBFBD> <C4B7> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> Ϊ 0<> <30> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <D2B3> <EFBFBD> ڶ<EFBFBD> <DAB6> εĻ<CEB5> <C4BB> ᣬ<EFBFBD> ƶ<EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 顣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 豸<EFBFBD> <E8B1B8> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## <20> <> <EFBFBD> ̵<EFBFBD> <CCB5> <EFBFBD> <EFBFBD> 㷨
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʴ<EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> ̵<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԴ<EFBFBD> <EFBFBD> ̵ķ<EFBFBD> <EFBFBD> ʡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̵<EFBFBD> <EFBFBD> ȵ<EFBFBD> <EFBFBD> <EFBFBD> ҪĿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> ̵<EFBFBD> ƽ <EFBFBD> <EFBFBD> Ѱ<EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ١ <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 20:11:09 +08:00
### 1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> FCFS, First Come First Serverd<72> <64>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ݽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʴ<EFBFBD> <EFBFBD> ̵<EFBFBD> <EFBFBD> Ⱥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> ȡ<EFBFBD> <EFBFBD> ŵ<EFBFBD> <EFBFBD> ǹ<EFBFBD> ƽ <EFBFBD> ͼ<EFBFBD> ȱ<EFBFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԣ<EFBFBD> <EFBFBD> <EFBFBD> Ϊδ<EFBFBD> <EFBFBD> Ѱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> κ<EFBFBD> <EFBFBD> Ż<EFBFBD> <EFBFBD> <EFBFBD> ʹ ƽ <EFBFBD> <EFBFBD> Ѱ<EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܽϳ <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 20:11:09 +08:00
### 2. <20> <> <EFBFBD> <EFBFBD> Ѱ<EFBFBD> <D1B0> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> SSTF, Shortest Seek Time First<73> <74>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵĴŵ<EFBFBD> <EFBFBD> 뵱ǰ<EFBFBD> <EFBFBD> ͷ<EFBFBD> <EFBFBD> <EFBFBD> ڴŵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƚ<EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> ȡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܱ<EFBFBD> ֤ƽ <EFBFBD> <EFBFBD> Ѱ<EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DZ<EFBFBD> FCFS <20> úܶࡣ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3. ɨ<> <C9A8> <EFBFBD> 㷨<EFBFBD> <E3B7A8> SCAN<41> <4E>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
SSTF <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ֽ<EFBFBD> <D6BD> м<EFBFBD> <D0BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F3A1A3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <C2BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵĴŵ<C4B4> <C5B5> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> ڴŵ<DAB4> <C5B5> ľ<EFBFBD> <C4BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DZ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> ڵȴ<DAB5> <C8B4> Ľ<EFBFBD> <C4BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ľ<EFBFBD> <C4BD> <EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> ȴ<EFBFBD> <C8B4> Ľ<EFBFBD> <C4BD> ̻<EFBFBD> һ ֱ<D2BB> ȴ<EFBFBD> <C8B4> <EFBFBD> ȥ<EFBFBD> <C8A5>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
SCAN <20> 㷨<EFBFBD> <E3B7A8> SSTF <20> 㷨֮<E3B7A8> Ͽ<EFBFBD> <CFBF> <EFBFBD> <EFBFBD> ˴ <EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> ƶ<EFBFBD> <C6B6> <EF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<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <EFBFBD> Ĺ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <EFBFBD> ݵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֳ<EFBFBD> <EFBFBD> <EFBFBD> SCAN <20> 㷨Ϊ<E3B7A8> <CEAA> <EFBFBD> ݵ<EFBFBD> <DDB5> <EFBFBD> <EFBFBD> 㷨<EFBFBD> <E3B7A8>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4. ѭ<> <D1AD> ɨ<EFBFBD> <C9A8> <EFBFBD> 㷨<EFBFBD> <E3B7A8> CSCAN<41> <4E>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
CSCAN <20> <> SCAN <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ˸ Ķ<CBB8> <C4B6> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ͷʼ <CDB7> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> ο <EFBFBD> <CEBF> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
- Tanenbaum A S, Bos H. Modern operating systems[M]. Prentice Hall Press, 2014.
2018-02-22 14:47:54 +08:00
- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> ܷ<EFBFBD> <DCB7> <EFBFBD> , <20> <> С <EFBFBD> <D0A1> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ[M]. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӿƼ <D3BF> <C6BC> <EFBFBD> ѧ<EFBFBD> <D1A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , 2001.
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- Bryant, R. E., & O<> <4F> Hallaron, D. R. (2004). <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵͳ.
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- [С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˢ<EFBFBD> <EFBFBD> <EFBFBD> ʼ <EFBFBD> ](http://wdxtub.com/interview/index.html )
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- [<EFBFBD> <EFBFBD> <EFBFBD> ̼<EFBFBD> <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> ŷ<EFBFBD> ʽ ](http://blog.csdn.net/yufaw/article/details/7409596 )