畢業(yè)設(shè)計外文資料翻譯-C #和.net網(wǎng)絡(luò)框架準(zhǔn)備好了嗎_第1頁
畢業(yè)設(shè)計外文資料翻譯-C #和.net網(wǎng)絡(luò)框架準(zhǔn)備好了嗎_第2頁
畢業(yè)設(shè)計外文資料翻譯-C #和.net網(wǎng)絡(luò)框架準(zhǔn)備好了嗎_第3頁
畢業(yè)設(shè)計外文資料翻譯-C #和.net網(wǎng)絡(luò)框架準(zhǔn)備好了嗎_第4頁
畢業(yè)設(shè)計外文資料翻譯-C #和.net網(wǎng)絡(luò)框架準(zhǔn)備好了嗎_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、畢業(yè)設(shè)計外文資料翻譯學(xué) 院: 專業(yè)班級: 學(xué)生姓名: 學(xué) 號: 指導(dǎo)教師: 外文出處:C# and the .NET Framework:ReadyforReal Time 附 件:1.外文資料翻譯譯文; 2.外文原文 指導(dǎo)教師評語:翻譯材料與畢業(yè)設(shè)計課題有一定關(guān)聯(lián),學(xué)生根據(jù)要求能正確翻譯外文材料,充分表達(dá)出原文意思,語句通順。按時完成外文翻譯任務(wù),總體上符合相關(guān)要求。簽名: 年 月 日1外文資料翻譯譯文C #和.net網(wǎng)絡(luò)框架:準(zhǔn)備好了嗎?微軟的集成開發(fā)環(huán)境:Visual Studio,包括一種新的編程語言c#,二者均以.net framework為平臺,.net framework與c#都

2、是比較成熟的技術(shù),但是對于實時系統(tǒng)平臺的實時性來說確實沒有得到太多的體現(xiàn)。微軟并未特別聲稱:c#和.net framework的目的是針對于實時系統(tǒng)。但這些平臺的許多特點包括類型安全特性,線程算術(shù)均適用于實時系統(tǒng)。本文將進(jìn)一步探索c#和.net framework對于實時系統(tǒng)的網(wǎng)絡(luò)框架的適用性。實時系統(tǒng) 從業(yè)者將實時系統(tǒng)分為:硬件,軟件這幾類。硬件實時系統(tǒng)包括可能會導(dǎo)致災(zāi)難性的一個最后期限。實時系統(tǒng)容忍一個或多個錯過最后期限但沒有造成災(zāi)難性影響的期限。在軟實時體系中,錯過了最后期限則會導(dǎo)致系統(tǒng)退化。 Bart Van Beneden說:“通常,實時行為與原始速度有關(guān)?!逼毡榈慕Y(jié)論通常是:對系統(tǒng)

3、的響應(yīng)越快越實時。然而,這些結(jié)論是不正確的,實時系統(tǒng)必須解決調(diào)度性和決定論的問題,特別是在負(fù)載的情況下,這種調(diào)度性預(yù)示著系統(tǒng)所能滿足的所有期限的能力。在任何給定的時間、當(dāng)前狀態(tài)和一組輸入數(shù)據(jù)的情況下,觀察者根據(jù)決定論預(yù)測下一個狀態(tài)。實時c# 實時Java系統(tǒng)已經(jīng)被廣泛的研究。在.net framework框架、c#、Java虛擬試機(jī)和Java共享特征中,我們申請采用.net framework和c#來作為這些研究所采取的作法。 當(dāng)檢查c#和.net framework的實時系統(tǒng)時,你應(yīng)該注意那些潛在的特性,有些平臺只針對微軟操作系統(tǒng)。微軟和科立爾加入了一個開源的端口的共同語言的基礎(chǔ)設(shè)施和c#

4、Unixlike FreeBSD操作系統(tǒng)。此外,至少有其他兩個主要工作正在進(jìn)行中,以.net framework、c# Unix和Linux操作系統(tǒng)為主。操作系統(tǒng)注意事項 微軟發(fā)布了.net framework的框架版本,.net,framework可用于小型操作系統(tǒng),比如Windows CE 3.0,嵌入式Windows XP和手持設(shè)備之中。雖然這些小型框架的文檔較少使用,但是它仍然包含很多的類。.Net framework框架適用于實時系統(tǒng)。 對于實時系統(tǒng)來說,Microsoft Windows CE 3.0提供了許多特性,其中包括256線程優(yōu)先級,使用優(yōu)先級設(shè)施來抵消反演和線程延遲時間,

5、在其他行業(yè)中,采用領(lǐng)先的實時操作系統(tǒng)。Windows CE 3.0是高度可配置的,可以擴(kuò)展從小型嵌入式系統(tǒng)的足跡(350 kb)以上(例如,系統(tǒng)要求用戶界面支持)。最小內(nèi)核配置提供基本的網(wǎng)絡(luò)支持,線程管理、動態(tài)鏈接新館支持,虛擬內(nèi)存管理。雖然可以詳細(xì)地討論會超出本文的范圍,但顯然Windows CE 3.0也能提供一個強(qiáng)大的實時操作系統(tǒng)。無論是否利用網(wǎng)絡(luò)平臺,.net framework使用CE的實時功能的緊湊框架尚未確定,仍然需要進(jìn)一步研究。物理內(nèi)存訪問c#支持采用公共語言安全進(jìn)行編碼,因此可以在指定的內(nèi)存位置存放指針。你必須使用(通過使用關(guān)鍵字“固定”)指針引用的對象,防止垃圾收集器在內(nèi)存

6、中改變他們的位置。垃圾收集器收集固定對象,但是不能移動它們。此功能會增加調(diào)度性,它還為直接內(nèi)存設(shè)備在具體的內(nèi)存位置中允許訪問寫出,必要地嵌入實時系統(tǒng)中。垃圾收集和內(nèi)存管理。典型的C算法遍歷的數(shù)據(jù)結(jié)構(gòu)(通常是一個樹或哈希表)可以找到合適的位置分配。它允許存放在內(nèi)存中,然后更新對象的數(shù)據(jù)結(jié)構(gòu)。 網(wǎng)絡(luò)管理動態(tài),基于堆的內(nèi)存堆棧。它是系統(tǒng)指針,它總是指向已分配的動態(tài)內(nèi)存。所以,分配內(nèi)存。往往是一個簡單的、簡化的過程。微軟的測量支持這個申明。網(wǎng)絡(luò)提供了一個分代垃圾收集方法,旨在減少線程在標(biāo)記和清掃中的阻塞。微軟的垃圾收集器可以實現(xiàn)隨著時間的推移來提高該算法,甚至增加各種需求(比如實時系統(tǒng))。此算法是建立

7、在假設(shè)評判處理部分堆的基礎(chǔ)之上。即使有.net framework的升級版,然而,它也是不可能知道搜集的確切時間表,也不可能保證每個收集的成本。這種行為可能成為構(gòu)成用c#編寫的硬實時系統(tǒng)的最重要的障礙。線程調(diào)度性和決定論c#和.net framework網(wǎng)絡(luò)平臺不支持許多線程管理的實時系統(tǒng),這是特別困難的。甚至從理論上來說(微軟的c#首席架構(gòu)師) ,“硬件實時”類型的項目(至少現(xiàn)在)不會適合網(wǎng)絡(luò)平臺。例如,該框架不支持線程在一個特定的時刻在時間,并保證它完成一個特定的時間點創(chuàng)建。c#支持許多線程同步機(jī)制。 Windows CE 3.0大大提高了線程管理結(jié)構(gòu)。如果正確利用c#和.net fram

8、ework緊湊的框架,它可以提供一個相當(dāng)強(qiáng)大的線程管理基礎(chǔ)設(shè)施。當(dāng)前線程按照優(yōu)先級首選的是.net framework框架,然而,在很大程度上這也是不令人滿意的實時系統(tǒng)。 根據(jù)在Windows 2000,Windows CE 2.1 ,CE 3.0,XP等的微軟文檔,窗口句柄通過優(yōu)先級繼承。專欄作家杰弗里里克特說,CLR利用底層操作系統(tǒng)的線程管理制度,所以優(yōu)先級繼承應(yīng)該也類似。但是,根據(jù)這些實驗,在.net framework的鎖定機(jī)制的情況下,優(yōu)先級繼承是不容易的。 在c#中,定時器類似于現(xiàn)有的Win32計時器的功能。建造時,計時器被告知等待多久之前首先調(diào)用,也提供一個時間間隔(以毫秒為單位

9、),指定后續(xù)的時期。這些計時器的精度是試機(jī)時依賴、但是不能保證實時系統(tǒng)的實用性。硬件特征發(fā)現(xiàn) 開爾文流行病學(xué)指出,“實時Java程序的發(fā)展目前仍然是疑難問題。在Java虛擬機(jī)環(huán)境中運行應(yīng)用程序中,Java應(yīng)用程序的開發(fā)人員不知道有多么強(qiáng)大的CPU和多少內(nèi)存才可用。這些許多缺點并不適用于c#和.net framework網(wǎng)絡(luò)平臺。例如,c#(通過.net framework的系統(tǒng)運行時間庫)段通過PInvoke支持系統(tǒng)應(yīng)用程序編程接口調(diào)用。它顯示了如何調(diào)用QueryPerformanceCounter Win32 API,訪問系統(tǒng)的高分辨率由于計數(shù)器。Win32 API提供了在機(jī)器和工藝水平下C

10、PU的特點、內(nèi)存使用情況等等。此外,通過系統(tǒng)診斷庫,c#開發(fā)人員可以訪問制度的性能計數(shù)器,包括數(shù)以百計的系統(tǒng)級測量。微軟增加了許多.NET-specific性能對象:CLR數(shù)據(jù),CLR記憶,CLR網(wǎng)絡(luò)、ASP.net framework柜臺,和一組JIT(及時)compiler counters-all programmatically并通過Performance Manager訪問用戶界面(Perfmon.exe)。類型安全 類型安全是不可或缺的。在.net framework平臺中,若在編譯時捕獲程序錯誤,應(yīng)積極抓住他們在實時系統(tǒng)的寶貴資產(chǎn)。里希特指出,“分配對象的類型安全資產(chǎn)總是包含兼容

11、的方式。因此,如果一個方法輸入?yún)?shù)聲明為4字節(jié)值,CLR將檢測和陷阱試圖訪問參數(shù)作為一個8字節(jié)的值。類似地,如果一個對象在內(nèi)存中包含 10個字節(jié),應(yīng)用程序則不能強(qiáng)迫這個表單,允許超過10個字節(jié)來讀。類型安全也表明“執(zhí)行流的位置(即方法入口點)。沒有辦法在這個位置開始執(zhí)行并構(gòu)建任意引用內(nèi)存的位置和原因代碼。這些可以消除許多常見編程錯誤和經(jīng)典系統(tǒng)利用緩沖區(qū)溢出等攻擊。異常處理 .net framework框架包含結(jié)構(gòu)化異常處理。異常處理是基于“嘗試,扔,趕上,最后”的作法,許多主流的面向?qū)ο蟮恼Z言使用。異常處理中,.net framework跨越語言是可擴(kuò)展的,這意味著開發(fā)人員可以基于特定應(yīng)用程序

12、的錯誤信息來進(jìn)行擴(kuò)展。 拋出異常創(chuàng)建異常目標(biāo)在catch塊中。所以,c#錯誤處理,隨便一個對象是一個例子。此外,這種方法跨越所有的語言目標(biāo)。網(wǎng)絡(luò)平臺,包括VB、.net framework、c#和c+。在當(dāng)前Win32 / COM(組件對象模型)編程模型,錯誤處理機(jī)制存在,包括hresult(COM),implementa-tion特殊接口(COM)得到一個更有意義的錯誤消息,和調(diào)用每個盤(Win32)。網(wǎng)絡(luò)支持一種易于理解、結(jié)構(gòu)化異常處理技術(shù)共同語言。性能測試 雖然“表現(xiàn)”不是實時系統(tǒng)的本質(zhì),但是這也是一個重要的方面。雖然速度本身并不能保證100%的成功率,但是一個進(jìn)程執(zhí)行的速度越快,越容易

13、獲得滿足相關(guān)的最后期限。 我們進(jìn)行了c#的和C 的兩個性能實驗的比較,所有測試都是用c+的55603-652-0000007-18846版。我們構(gòu)建和系統(tǒng)安全是基于c#和net framework的。網(wǎng)絡(luò)平臺的版本是1.0.3705。一般地,這些版本對net framework可用。所有構(gòu)建優(yōu)化發(fā)布構(gòu)建的測試都是運行在一個800 mhz中,在SP 1,523 mb的物理內(nèi)存中,運行專業(yè)的Windows 2000。第一個測試是由100億年float-ing-point的操作。顯示了cu-mulative掛鐘運行。第二個測試處理內(nèi)存管理。我們生成和發(fā)布了一個包含5000個節(jié)點的鏈表C和C # 24

14、倍(48)。其他列表看到節(jié)點規(guī)模的增加。所以第一套有5000個節(jié)點,每個節(jié)點包含一個簡單的數(shù)值和長度為零的字符串了。第二組的兩個列表,每個節(jié)點包含一個簡單的數(shù)字,2500字節(jié)的字符串,等等。ASP.NET是建立在一個共同的語言運行時,可以用來構(gòu)建功能強(qiáng)大的Web應(yīng)用程序公編程框架的服務(wù)器上。 ASP.NET有很多好處 - 無論是為程序員和最終用戶,因為它是與.NET Framework兼容。這種兼容性允許用戶通過ASP.NET使用以下功能:1)強(qiáng)大的數(shù)據(jù)庫驅(qū)動的功能:ASP.NET允許程序員開發(fā)Web與數(shù)據(jù)庫交互的應(yīng)用程序。 ASP.NET的優(yōu)點是,它是面向?qū)蚝途哂性S多編程的工具,允許發(fā)展更

15、快和更多的功能。 。2)更快的Web應(yīng)用程序:ASP.NET的兩個方面使之快 - 編譯代碼緩存。在ASP.NET訪客時涉及到網(wǎng)站之前的代碼被編譯成“機(jī)器語言”。緩存是對內(nèi)存中的信息進(jìn)行快速訪問存儲。 ASP.NET允許程序員建立重用被緩存的一段時間內(nèi),以提高Web應(yīng)用的性能網(wǎng)頁頁面或區(qū)域。此外,ASP.NET允許數(shù)據(jù)的高速緩存。 3)內(nèi)存泄漏和崩潰保護(hù):從內(nèi)存泄漏以確保該網(wǎng)站是始終可用的窗體頂端 ASP.NET還支持以超過25種.NET語言(包括VB.NET,C和Jscript.Net)代碼。這是通過支持多個公共語言運行時(CLR)編譯器實現(xiàn)的語言。 在ASP.NET應(yīng)用程序有兩個獨立的身份驗

16、證層。所有請求流通過IIS在他們交給ASP.NET面前,IIS可以決定拒絕訪問ASP.NET之前甚至知道該請求。下面是如何處理工作: 在這種公關(guān)拍攝對象時,MySQL作為后端數(shù)據(jù)庫。 MySQL是一個開放源代碼的數(shù)據(jù)庫管理系統(tǒng)。MySQL的特征在下面給出:MySQL是一個關(guān)系數(shù)據(jù)庫管理系統(tǒng)。關(guān)系數(shù)據(jù)庫在不同的表中存儲的信息,而不是在一個巨大的表。這些表可以被引用到彼此之上,以訪問和容易維護(hù)的數(shù)據(jù)。MySQL是開源的數(shù)據(jù)庫系統(tǒng)。數(shù)據(jù)庫軟件可以使用,根據(jù)自己的需要任何人修改。它是快速,可靠和易于使用的。為了提高性能,MySQL是多線程的數(shù)據(jù)庫數(shù)據(jù)庫連接發(fā)動機(jī)。多線程應(yīng)用程序,同時,該應(yīng)用程序的多個

17、實例可被同時運行的多任務(wù)所執(zhí)行。多線程MySQL有很多優(yōu)點。一個單獨的線程處理通過始終運行來管理連接一個額外的線程,使得每個傳入連接。多個客戶端可以同時執(zhí)行讀、寫操作,但是只允許撐起另一個客戶端需要訪問的數(shù)據(jù)才能被更新。即使線程共享相同的進(jìn)程空間,他們也分別執(zhí)行。并且由于這種分離,多處理器機(jī)器可以作為主機(jī)操作系統(tǒng)支持多個CPU,且多個CPU的傳播線一樣長。多線程的關(guān)鍵功能,在于支持MySQL的性能設(shè)計目標(biāo)。它的核心功能,圍繞MySQL是“建立”.MySQL數(shù)據(jù)庫使用ODBC驅(qū)動程序連接到ASP.NET。開放式數(shù)據(jù)庫連接(ODBC)是用于數(shù)據(jù)庫訪問廣泛接受的應(yīng)用編程接口(API)。的ODBC D

18、RIV是實現(xiàn)由ODBC API支持的功能的庫。它處理ODBC函數(shù)調(diào)用,提交SQL請求或者通過IIS直接處理或路由到ISAPI擴(kuò)展。 ISAPI擴(kuò)展是安裝在Web服務(wù)器上編譯類,其職責(zé)是返回標(biāo)記為請求。例如,當(dāng)一個請求是一個.html文件提出,IIS直接返回請求的HTML文件的內(nèi)容。文件類型。默認(rèn)情況下,IIS處理請求,并簡單地返回請求的文件13的內(nèi)容。 。這是有道理的靜態(tài)文件,如圖像,HTMLwwwpages,CSS文件,外部JavaScript文件,等等。對于ASP頁面已經(jīng)映射到ASP.DLL ISAPI擴(kuò)展.asp擴(kuò)展名。該ASP.DLL ISAPI擴(kuò)展執(zhí)行所請求的ASP頁,并返回其生成的

19、HTML標(biāo)記。如果網(wǎng)站提供了ASP.NET的Web頁面,IIS已映射在.aspx到aspnet_isapi.dll,啟動關(guān)閉ISAPI擴(kuò)展。對于文件,其內(nèi)容是動態(tài)生成的,ISAPI擴(kuò)展配置文件擴(kuò)展名是負(fù)責(zé)產(chǎn)生文件。2.外文原文C# and the .NET Framework: Readyfor Real Time?Microsofts integrated development environment, Visual Studio NET, includes a new programming language C# (pronounced “C sharp”), which target

20、s the .NET Framework. Both the .NET Framework and C# are fairly well-documented technologies, Microsofts integrated developmentenvironment, Visual Studio.NET, but the platforms appropriateness for real-time systems has not received much attention. Microsoft doesnt specifically claim that C# and .NET

21、 are intended for real-time systems, but many of the platforms general purpose featuresincluding type unsafe features, thread synchronization, and overflow-sensitive arithmetic apply to real-time systems. This article will further explore C# and the .NET Frameworks suitability for real-time systems.

22、Real-time systemsPractitioners categorize real-time systems as hard, firm, and soft.1Hard real-time systems include those in which a single missed deadline might cause catastrophic repercussions. Firm real-time systems tolerate one or more missed deadlines without catastrophic repercussions. In soft

23、 real-time systems, missed deadlines only result in performance degradation.Bart Van Beneden says, “All too often, real-time behavior is associated with raw speed. Popular conclusions are that the faster a system responds or processes data, the more real-time it is.” However, these conclusions are i

24、ncorrect. Real-time systems must fore-most address schedulability and determinism, especially under load.Scheduleability indicates a systems ability to satisfy all deadlines.Determinism lets an observer predict the systems next state at any time given its current state and a set of inputs.Real-time

25、C#Real-time Java systems have been studied extensively.As the .NET Framework and C# share traits with the Java Virtual Ma-chine and Java, well apply to the .NET Framework and C# a synthesis of the approaches taken by these studies.When examining C# and .NET for real-time systems, you should note the

26、 characteristics of the underlying platformthis primarily means Microsoft operating systems. Microsoft and Corel have joined forces in an open source port of the Common LanguageInfrastructure and C# to the Unixlike FreeBSD operating system. Additionally, at least two other major efforts are underway

27、 to port .NET and C# to Unix and Linux operating systems.Operating system considerationsMicrosoft released the .NET Compact Framework as a version of the .NET Frame-work for scaled-down operating systems such as Windows CE 3.0, Embedded Windows XP, and handheld devices. Although this condensed frame

28、works documentation is sparse, it appears that it will include the classes in the .NET Framework applicable to real-time systems.Microsoft Windows CE 3.0 provides many features for real-time systems, including 256 thread priorities, facilities to counteract priority inversion, and thread latency tim

29、es com-parable to other industry-leading real-time operating systems.2 Windows CE 3.0 is highly configurable, capable of scaling from small, embedded-system footprints (350 Kbytes) and upwards (for example, for systems requiring user interface support).6 The minimum kernel configuration provides bas

30、ic networking sup-port, thread management, dynamic link library support, and virtual memory management. Although a detailed discussion falls outside this articles scope, Windows CE 3.0 clearly provides a powerful real-time operating system for the .NET platform to leverage. Whether the .NET Compact

31、Framework uses all of CEs real-time capabilities has yet to be determined and warrants further study.Physical memory accessC# supports unsafe codecode that runs outside the Common Language Runtime (CLR) and hence lets pointers refer to specific memory locations. You must pin (by using the keyword “f

32、ixed”) objects that pointers reference, to prevent the garbage collector from altering their location in memory. The garbage collector collects pinned objects but does not move them. This capability would tend to increase schedule ability, and it also al-lows for direct memory device access to write

33、 to specific memory locationsa necessary capability in embedded real-time systems.Garbage collection and memory managementThe typical C algorithm traverses a data structure (typically a tree or hash table) tofind a suitable location for allocation. It al-locates the memory, then updates the data str

34、ucture with the new objects presence.NET manages dynamic, heap-based memory with a stack. A system pointer, always points to the location for the next dynamic memory allocation. So, allocating memory in .NET is a simple, streamlined process. Microsofts measurements support this claim.8.NET offers a

35、generational approach to garbage collection intended to minimize thread blockage during mark and sweep.8 Microsofts garbage collector and other vendors .NET implementations will improve this algorithm over time and might even specialize it for various needs (such as real-time systems). The algorithm

36、 is built on the assumption that processing a portion of the heap is less expensive than processing the en-tire heap. Even with .NETs generations, however, its impossible to know the collections exact schedule, nor is it possible to guarantee each collections cost. This nondeterministic behavior mig

37、ht pose the most significant barrier to hard real-time systems written in C#.Thread schedule ability and determinismC# and the .NET platform do not sup-port many of the thread management con-structs that real-time systems, particularly hard ones, often require.9,10 Even Anders Hejlsberg (Microsofts

38、C# chief architect) states, “I would say that hard real-time kinds of programs wouldnt be a good fit (at least right now)” for the .NET platform.11 For instance, the Framework does not sup-port thread creation at a particular instant in time with the guarantee that it completes by a particular point

39、 in time. C# supports many thread synchronization mechanisms but none with this precision.Windows CE 3.0 has significantly improved thread management constructs.6If properly leveraged by C# and the .NET Compact Framework, it could provide a reasonably powerful thread management infrastructure. Curre

40、nt enumerations for thread priority in the .NET Framework, however, are largely unsatisfactory for real-time systems. Only five levels exist:According to Microsoft documentation on Windows 2000, Windows CE 2.1, CE 3.0, XP, and so forth, Windows handles priority inversion through priority inheritance

41、. Jeffrey Richter, a columnist for MSDN magazine, says the CLR leverages the underlying operating systems thread management sys-tem, so priority inheritance should theoretically behave similarly.5 According to these experiments, however, at least in the case of.NETs lock mechanism, priority inherita

42、nce was not easily noticeable.TimersTimers in C# resemble the existing Win32 timers functionality. When constructed, timers are told how long to wait in milliseconds before their first invocation and are also supplied an interval (in milliseconds), specifying the period between subsequent in-vocatio

43、ns. These timers accuracy are ma-chine dependent and not guaranteed, reducing their usefulness for real-time systems.Hardware characteristics discoveryKelvin Nilsen notes that “development of real-time Java programs is especially difficult. The developer of a Java application has no idea how powerfu

44、l the CPU is and how much memory will be available in the Java Virtual Machine environment in which the application is to run.”13Many of these shortcomings do not apply to C# and the .NET platform. For instance, C# (through .NETs System.Runtime.InteropServiceslibrary) supports underlying system appl

45、ication programming interface invocation through PInvoke. For example, Figure 1 shows how to call theQueryPerformanceCounterWin32 API,accessing the systems high-resolution performance counter. The Win32 API provides the CPU characteristics, memory usage, and so on, at both the machine and process le

46、vels. Furthermore, via the System.Diagnostics library, C# developers can access the systems performance counters, consisting of hundreds of system-level measurements. Microsoft has added numerous .NET-specific performance objects: CLR Data, CLRMemory, CLR Networking, ASP .NET counters, and a set of

47、JIT (just in time) compiler countersall accessible programmatically and through the Performance Manager user interface (Perfmon.exe).Type safetyType safety is integral to the .NET plat-form; it catches program errors at compile time and proactively catches them at run-timea valuable asset for real-t

48、ime systems. In .NET, Richter notes that type safety assures that “allocated objects are always accessed in compatible ways. Hence, if a method input parameter is declared as accepting a 4-byte value, the CLR will detect and trap attempts to access the parameter as8-byte value. Similarly, if an obje

49、ct occupies 10 bytes in memory, the application cant coerce this into a form that will allow more than 10 bytes to be read.”Richter continues, noting type safety also indicates that “execution flow will only transfer to well-known locations (namely, method entry points). There is no way to construct

50、 an arbitrary reference to a memory location and cause code at that location to begin execution. Together, these eliminate many common programming errors and classic system at-tacks such as exploiting buffer overruns.”Exception handlingThe .NET Framework contains structured exception handling. Excep

51、tion handling isbased on the “try, throw, catch, finally” approach that many mainstream object-oriented languages use.10 Exception handling in .NET spans languages and is extensible, meaning a developer can extend the error messages based on a specific application.Thrown exceptions create exception

52、objects caught in catch blocks. So, in C# error handling, an exception is literally an object. Furthermore, this approach spans all languages targeting the .NET platform, including VB.NET, C#, and Managed C+. In the current Win32/COM (Component Object Model) programming model, a myriad of error-hand

53、ling mechanisms exist, including HRESULTs (COM), the implementation of special interfaces to get a more meaningful error message (COM),7 and calls to GetLastError (Win32). .NET supports one well-understood, structured exception-handling technique common to all languages.Performance testsAlthough per

54、formance is not the essence of real-time systems, its an important as-pect.14The faster a process executes, the easier it is to meet associated deadlines, al-though speed alone does not guarantee a 100-percent success rate.We conducted two experiments comparing C#s performance against C. All tests w

55、ere built with version 55603-652-0000007-18846 of C+. NET, and we built and executed C# .NET on the .NET platform, version 1.0.3705. These versions correspond to.NETs first generally available, nonbeta version. All builds were optimized release builds. The tests ran on an 800-MHz Inspiron 8000, runn

56、ing Windows 2000 Professional, SP 1, with 523 Mbytes of physical memory.The first test consisted of 10 billion floating-point operations. Figure 2 shows the cumulative wall clock runtime.The second test dealt with memory management. We generated and released a linked list containing 5,000 nodes in b

57、oth C and C# 24 times (48 total). Every other list saw an increase in node size. So for the first two sets of 5,000 nodes, each node contained a simple numeric value and a string of length zero. For the second set of two lists, each node contained a simple numeric again and a string of 2,500 bytes,

58、and so on, increasing the string size by 2,500 bytes every other list iteration.Although Streamline and Shoplink had business models with many innovative features, they were victims of the dotcom bust. Streamline targeted two income families with children, provided a “dont run out” service which aut

59、omatically replenished the consumers inventory of continuously-needed items and scheduled delivery every week .SimonDelivers now uses a similar “newspaper route delivery” model to helpcontrol costs 35. Streamline offered goods and services beyond groceries, such as videos and dry cleaning 2. Surpris

60、ingly, although using the “l(fā)ast mile” to provide products and services beyond groceries increases margins, with the exception of Tesco and Schwans, currently most online grocers ignore this opportunity 2, 35. Streamline also offered unattended delivery to a refrigerator in the customers garage using

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論