【正文】
外文翻譯: Electric circuit exchange work and vb transfer database The result of the connection setup with circuit switching is the reservation of bandwidth all the way from the sender to the receiver. All packets follow this path. Among other properties, having all packets follow the same path means that they cannot arrive out of order. With packet switching there is no path , so different packets can follow different paths, depending on work conditions at the time they are sent. They may arrive out of order. Packet switching is more fault tolerant than circuit switching. In fact, that is why it was invented. If a switch goes down, all of the circuits using it are terminated and no more traffic can be sent on any of them. With Packet switching, packets can be routed around dead switches. Setting up a path in advance also opens up the possibility of reserving bandwidth in advance. If bandwidth is reserved, then when a packet arrives, it can be sent out immediately over the reserved bandwidth. With packet switching, no bandwidth is reserved, so packets may have to wait their turn to be forwarded. Having bandwidth reserved in advance means that no congestion can occur when a packet shows up (unless more packets show up than expected).On the other hand, when an attempt is made to establish a circuit, the attempt can fail due to congestion. Thus, congestion can occur at different times with circuit switching(at setup time) and packet switching(when packets are sent). If a circuit has been reserved for a particular user and there is no traffic to send, the bandwidth of that circuit is wasted. It cannot be used for other traffic. Packet switching does not waste bandwidth and thus is more efficient form a systemwide perspective. Understanding this tradeoff is crucial for prehending the difference between circuit switching and packet switching. The tradeoff is between guaranteed service and wasting resources versus not guaranteeing service and not wasting resources. Packet switching uses storeandforward transmission. A packet is accumulated. in a router’s memory, then sent on to the next router. With circuit switching, the bits just flow through the wire continuously. The storeandforward technique adds delay. Another difference is that circuit switching is pletely transparent. The sender and receiver can use any bit rate, format, or framing method they want to. The carrier does not know or care. With packet switching, the carrier determines the basic parameters. A rough analogy is a road versus a railroad. In the former, the user determines the size, speed, and nature of the vehicle。 浙江林學院天目學院本科生畢業(yè)設(shè)計(論文) 24 參考文獻 [1] 楊貴和 . 操作系統(tǒng)課中進程調(diào)度的可視化設(shè)計 [J]. 中國科教創(chuàng)新導刊 , 2020, 07 [2] 謝印寶 ,田愛奎 ,謝印智 . 關(guān)于操作系統(tǒng)生產(chǎn)者消費者問題 [J]. 淄博學院學報 (自然科學與工程版 ), 2020,03 [3] 宋新麗 ,何永強 . 用信號量機制與 PV 操作解決進程同步互斥問題的方法 [J]. 河南紡織高等專科學校學報 ,2020 [4] 張賢達 . 現(xiàn)代信號處理 (第二版 )[M].北京 :清華大學出版社 ,2020. [5] 胡小龍 ,等 . Windows 操作系統(tǒng)進程通信機制 [J].計算機應用研究 ,2020 ,19 (12) [6] 賈廣雷 .多線程技術(shù)及其在串口通信中的應用 [J].計算機工程 ,2020 ,29 (1) [7] 陳周造 .精通 C ++ Builder 5 程序設(shè)計高級教程 [M].中國青年出版社 ,2020. [8] 帖 軍 ,陳幼均 .進程同步中的生產(chǎn)者 — 消費者模型分析 [J].武漢科技學院學 報 2020,04 [9] 帖軍 . 同步 互斥機制中的讀者 寫者模型 [J].中南民族大學學報(自然科學版), 2020 24( 3) [10] 陸松年 .作系統(tǒng)教程(第 2版) [M].電子工業(yè)出版社 ,2020 [11] 胡明慶 ,高巍 ,鐘梅 .操作系統(tǒng)教程與實驗 .清華大學出版社 [M].2020 [12] 曹聰 ,范廉明 .操作系統(tǒng)原理與分析 .科學出版社 [M].2020,09 [13] [美 ] David Chappell. 華中科技大學出版社 [M]. [14] 彭民德 .計算機操作系統(tǒng)網(wǎng)絡教學課件 [M].清華大學出版社 ,2020,09 [15] Lamport L: On Interprocess Communications: I. Basic Formalism. Distributed Computing, 1: 7785 (1986) [16] 戴樹貴 .利用 P, V操作實現(xiàn)進程同步與互斥 [J]. 滁州師專學報 , 浙江林學院天目學院本科生畢業(yè)設(shè)計(論文) 25 致謝 本次畢業(yè)設(shè)計以及論文是在汪杭軍老師的精心指導和大力支持下,順利完成的,汪老師認真負責的工作態(tài)度,嚴謹?shù)闹螌W精神和大膽創(chuàng)新的進去精神,對我產(chǎn)生了重要影響。 系統(tǒng)準確的模擬了在多緩沖區(qū)下的單生產(chǎn)者 單消費者及多生產(chǎn)者 多消費者問題的模擬情況,停止按紐的功能讓模擬系統(tǒng)實時的反映生產(chǎn)者 消費者模擬的情況,實 現(xiàn)了教學演示的要求。 多生產(chǎn)者 多消費者模擬 : 當循環(huán)緩沖區(qū)隊列空時 ,消費者線程阻塞 。 浙江林學院天目學院本科生畢業(yè)設(shè)計(論文) 21 圖 3 個生產(chǎn)者生產(chǎn)情況 圖 4個消費者消費的 4個緩沖池內(nèi)的產(chǎn)品 浙江林學院天目學院本科生畢業(yè)設(shè)計(論文) 22 系統(tǒng)演示 結(jié)論 單生產(chǎn)者 單消費者模擬 : 從結(jié)果可以看出 ,生產(chǎn)者和消費者線程是在并發(fā)的執(zhí)行。消費者也可以從緩沖區(qū)中已存有數(shù)據(jù)的緩沖 區(qū)塊中取數(shù)消費。反之 ,生產(chǎn)者就可以把生產(chǎn)出來的數(shù)據(jù)放入該緩沖區(qū)塊中 ,然后判斷當前阻塞隊列中是否有消費者進程阻塞 ,如果有則將其喚醒。 1. 單生產(chǎn)者 單消費者問題模型 。消費者則在生產(chǎn)者后面 , 消費掉消費者指針當前位置緩沖區(qū)內(nèi)的產(chǎn)品 , 方框重新改變?yōu)榘咨?,然后浙江林學院天目學院本科生畢業(yè)設(shè)計(論文) 18 消費者指針也順時針前進一格 , 指向下一個存放了產(chǎn)品的緩沖區(qū) 。因此 , 用了 11個正方形方框代表 11個緩沖區(qū) 。 } 系統(tǒng) 功能的實現(xiàn) 程序中共有 6 個線程 , 兩個生產(chǎn)者線程 , 兩個消費者線程 ,另外兩個線程則根據(jù)相同概率改變身份來模擬生產(chǎn)者或者消費者 , 以便構(gòu)建任意多個生產(chǎn)者 消費者的可視化環(huán)境。 } Invalidate()。 m_CArray[i]=0。iSIZE_OF_BUFFER。 thism_CT[i]ResumeThread()。i++) { (C%d,i)。thism_nc11) { (false)。 } 2. 啟動消費者按紐的代碼: void CPCDlg::OnStartc() { UpdateData(true)。 thism_PT[i]CreateThread(CREATE_SUSPENDED)。 for( unsigned i=0。 if( thism_np0amp。實現(xiàn)這種功能的基礎(chǔ)是 C++對繼承的支持,對虛擬函數(shù)的支持,以及 MFC實現(xiàn)的消息映射機制 [13]。 MFC提供了一個 Windows應用 程序開發(fā)模式,對程序的控制主要是由 MFC框架完成的,而且 MFC也完成了大部分的功能,預定義或?qū)崿F(xiàn)了許多事件和消息處理,等等。又如,為了實現(xiàn)對 DLL編程的支持和多線程編程的支持, MFC內(nèi)部使用了特別的處理方法,使用模塊狀態(tài)、線程狀態(tài)等來管理一些重要信息。針對不同的應用和目的,程序員采用不同的模板。 MFC 編程框架將在適當?shù)臅r候、適當?shù)牡胤絹碚{(diào)用程序的代碼。如果這些函數(shù)都設(shè)計成虛擬函數(shù),由于數(shù)量太浙江林學院天目學院本科生畢業(yè)設(shè)計(論文) 14 多,實現(xiàn)起來不現(xiàn)實。 程序員將結(jié)合自己的實際,從適當?shù)?MFC 類中派生出自己的類,實現(xiàn)特定的功能,達到自己的編程目的。 CCmdTarget 通過封裝一些屬性和方法,提供了消息處理的架構(gòu)。這些類中,最重要的類是 CObject 和 CCmdTarget。 ( 3)對 COM/OLE 特性的封裝 OLE 建立在 COM 模型之上,由于支持 OLE 的應用程序必須實現(xiàn)一系列的接口( Interface),因而相當繁瑣。 ( 2)對應用程序概念的封裝 使用 SDK編寫 Windows 應用程序時,總要定義窗口過程,登記 Windows Class,創(chuàng)建窗口,等等。 MFC 類庫是 C++類庫。 } MFC 界面的設(shè)計 MFC 的介紹 MFC (Microsoft Foundation Class Library)中的各種類結(jié)合起來構(gòu)成了一個應用程序框架,它的目的就是讓程序員在此基礎(chǔ)上來建立 Windows下的應用程序,這是一種相對 SDK來說更為簡單的方法。 ReleaseSemaphore(pDlgm_hEmptySemaphore[temp],1,NULL)。 pDlgInvalidateRect(CRect(17+temp*40,17,20+(temp+1)*40,200))。 Sleep(t*750+500)。 pDlgInvalidateRect(CRect(17+temp*40,17,20+(temp+1)*40,200))。 CString str。 } 消費者模擬函數(shù)代碼 int CCon