毕业设计外文资料翻译-C #和.net网络框架准备好了吗_第1页
毕业设计外文资料翻译-C #和.net网络框架准备好了吗_第2页
毕业设计外文资料翻译-C #和.net网络框架准备好了吗_第3页
毕业设计外文资料翻译-C #和.net网络框架准备好了吗_第4页
毕业设计外文资料翻译-C #和.net网络框架准备好了吗_第5页
已阅读5页,还剩15页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、毕业设计外文资料翻译学 院: 专业班级: 学生姓名: 学 号: 指导教师: 外文出处:C# and the .NET Framework:ReadyforReal Time 附 件:1.外文资料翻译译文; 2.外文原文 指导教师评语:翻译材料与毕业设计课题有一定关联,学生根据要求能正确翻译外文材料,充分表达出原文意思,语句通顺。按时完成外文翻译任务,总体上符合相关要求。签名: 年 月 日1外文资料翻译译文C #和.net网络框架:准备好了吗?微软的集成开发环境:Visual Studio,包括一种新的编程语言c#,二者均以.net framework为平台,.net framework与c#都

2、是比较成熟的技术,但是对于实时系统平台的实时性来说确实没有得到太多的体现。微软并未特别声称:c#和.net framework的目的是针对于实时系统。但这些平台的许多特点包括类型安全特性,线程算术均适用于实时系统。本文将进一步探索c#和.net framework对于实时系统的网络框架的适用性。实时系统 从业者将实时系统分为:硬件,软件这几类。硬件实时系统包括可能会导致灾难性的一个最后期限。实时系统容忍一个或多个错过最后期限但没有造成灾难性影响的期限。在软实时体系中,错过了最后期限则会导致系统退化。 Bart Van Beneden说:“通常,实时行为与原始速度有关。”普遍的结论通常是:对系统

3、的响应越快越实时。然而,这些结论是不正确的,实时系统必须解决调度性和决定论的问题,特别是在负载的情况下,这种调度性预示着系统所能满足的所有期限的能力。在任何给定的时间、当前状态和一组输入数据的情况下,观察者根据决定论预测下一个状态。实时c# 实时Java系统已经被广泛的研究。在.net framework框架、c#、Java虚拟试机和Java共享特征中,我们申请采用.net framework和c#来作为这些研究所采取的作法。 当检查c#和.net framework的实时系统时,你应该注意那些潜在的特性,有些平台只针对微软操作系统。微软和科立尔加入了一个开源的端口的共同语言的基础设施和c#

4、Unixlike FreeBSD操作系统。此外,至少有其他两个主要工作正在进行中,以.net framework、c# Unix和Linux操作系统为主。操作系统注意事项 微软发布了.net framework的框架版本,.net,framework可用于小型操作系统,比如Windows CE 3.0,嵌入式Windows XP和手持设备之中。虽然这些小型框架的文档较少使用,但是它仍然包含很多的类。.Net framework框架适用于实时系统。 对于实时系统来说,Microsoft Windows CE 3.0提供了许多特性,其中包括256线程优先级,使用优先级设施来抵消反演和线程延迟时间,

5、在其他行业中,采用领先的实时操作系统。Windows CE 3.0是高度可配置的,可以扩展从小型嵌入式系统的足迹(350 kb)以上(例如,系统要求用户界面支持)。最小内核配置提供基本的网络支持,线程管理、动态链接新馆支持,虚拟内存管理。虽然可以详细地讨论会超出本文的范围,但显然Windows CE 3.0也能提供一个强大的实时操作系统。无论是否利用网络平台,.net framework使用CE的实时功能的紧凑框架尚未确定,仍然需要进一步研究。物理内存访问c#支持采用公共语言安全进行编码,因此可以在指定的内存位置存放指针。你必须使用(通过使用关键字“固定”)指针引用的对象,防止垃圾收集器在内存

6、中改变他们的位置。垃圾收集器收集固定对象,但是不能移动它们。此功能会增加调度性,它还为直接内存设备在具体的内存位置中允许访问写出,必要地嵌入实时系统中。垃圾收集和内存管理。典型的C算法遍历的数据结构(通常是一个树或哈希表)可以找到合适的位置分配。它允许存放在内存中,然后更新对象的数据结构。 网络管理动态,基于堆的内存堆栈。它是系统指针,它总是指向已分配的动态内存。所以,分配内存。往往是一个简单的、简化的过程。微软的测量支持这个申明。网络提供了一个分代垃圾收集方法,旨在减少线程在标记和清扫中的阻塞。微软的垃圾收集器可以实现随着时间的推移来提高该算法,甚至增加各种需求(比如实时系统)。此算法是建立

7、在假设评判处理部分堆的基础之上。即使有.net framework的升级版,然而,它也是不可能知道搜集的确切时间表,也不可能保证每个收集的成本。这种行为可能成为构成用c#编写的硬实时系统的最重要的障碍。线程调度性和决定论c#和.net framework网络平台不支持许多线程管理的实时系统,这是特别困难的。甚至从理论上来说(微软的c#首席架构师) ,“硬件实时”类型的项目(至少现在)不会适合网络平台。例如,该框架不支持线程在一个特定的时刻在时间,并保证它完成一个特定的时间点创建。c#支持许多线程同步机制。 Windows CE 3.0大大提高了线程管理结构。如果正确利用c#和.net fram

8、ework紧凑的框架,它可以提供一个相当强大的线程管理基础设施。当前线程按照优先级首选的是.net framework框架,然而,在很大程度上这也是不令人满意的实时系统。 根据在Windows 2000,Windows CE 2.1 ,CE 3.0,XP等的微软文档,窗口句柄通过优先级继承。专栏作家杰弗里里克特说,CLR利用底层操作系统的线程管理制度,所以优先级继承应该也类似。但是,根据这些实验,在.net framework的锁定机制的情况下,优先级继承是不容易的。 在c#中,定时器类似于现有的Win32计时器的功能。建造时,计时器被告知等待多久之前首先调用,也提供一个时间间隔(以毫秒为单位

9、),指定后续的时期。这些计时器的精度是试机时依赖、但是不能保证实时系统的实用性。硬件特征发现 开尔文流行病学指出,“实时Java程序的发展目前仍然是疑难问题。在Java虚拟机环境中运行应用程序中,Java应用程序的开发人员不知道有多么强大的CPU和多少内存才可用。这些许多缺点并不适用于c#和.net framework网络平台。例如,c#(通过.net framework的系统运行时间库)段通过PInvoke支持系统应用程序编程接口调用。它显示了如何调用QueryPerformanceCounter Win32 API,访问系统的高分辨率由于计数器。Win32 API提供了在机器和工艺水平下C

10、PU的特点、内存使用情况等等。此外,通过系统诊断库,c#开发人员可以访问制度的性能计数器,包括数以百计的系统级测量。微软增加了许多.NET-specific性能对象:CLR数据,CLR记忆,CLR网络、ASP.net framework柜台,和一组JIT(及时)compiler counters-all programmatically并通过Performance Manager访问用户界面(Perfmon.exe)。类型安全 类型安全是不可或缺的。在.net framework平台中,若在编译时捕获程序错误,应积极抓住他们在实时系统的宝贵资产。里希特指出,“分配对象的类型安全资产总是包含兼容

11、的方式。因此,如果一个方法输入参数声明为4字节值,CLR将检测和陷阱试图访问参数作为一个8字节的值。类似地,如果一个对象在内存中包含 10个字节,应用程序则不能强迫这个表单,允许超过10个字节来读。类型安全也表明“执行流的位置(即方法入口点)。没有办法在这个位置开始执行并构建任意引用内存的位置和原因代码。这些可以消除许多常见编程错误和经典系统利用缓冲区溢出等攻击。异常处理 .net framework框架包含结构化异常处理。异常处理是基于“尝试,扔,赶上,最后”的作法,许多主流的面向对象的语言使用。异常处理中,.net framework跨越语言是可扩展的,这意味着开发人员可以基于特定应用程序

12、的错误信息来进行扩展。 抛出异常创建异常目标在catch块中。所以,c#错误处理,随便一个对象是一个例子。此外,这种方法跨越所有的语言目标。网络平台,包括VB、.net framework、c#和c+。在当前Win32 / COM(组件对象模型)编程模型,错误处理机制存在,包括hresult(COM),implementa-tion特殊接口(COM)得到一个更有意义的错误消息,和调用每个盘(Win32)。网络支持一种易于理解、结构化异常处理技术共同语言。性能测试 虽然“表现”不是实时系统的本质,但是这也是一个重要的方面。虽然速度本身并不能保证100%的成功率,但是一个进程执行的速度越快,越容易

13、获得满足相关的最后期限。 我们进行了c#的和C 的两个性能实验的比较,所有测试都是用c+的55603-652-0000007-18846版。我们构建和系统安全是基于c#和net framework的。网络平台的版本是1.0.3705。一般地,这些版本对net framework可用。所有构建优化发布构建的测试都是运行在一个800 mhz中,在SP 1,523 mb的物理内存中,运行专业的Windows 2000。第一个测试是由100亿年float-ing-point的操作。显示了cu-mulative挂钟运行。第二个测试处理内存管理。我们生成和发布了一个包含5000个节点的链表C和C # 24

14、倍(48)。其他列表看到节点规模的增加。所以第一套有5000个节点,每个节点包含一个简单的数值和长度为零的字符串了。第二组的两个列表,每个节点包含一个简单的数字,2500字节的字符串,等等。ASP.NET是建立在一个共同的语言运行时,可以用来构建功能强大的Web应用程序公编程框架的服务器上。 ASP.NET有很多好处 - 无论是为程序员和最终用户,因为它是与.NET Framework兼容。这种兼容性允许用户通过ASP.NET使用以下功能:1)强大的数据库驱动的功能:ASP.NET允许程序员开发Web与数据库交互的应用程序。 ASP.NET的优点是,它是面向导向和具有许多编程的工具,允许发展更

15、快和更多的功能。 。2)更快的Web应用程序:ASP.NET的两个方面使之快 - 编译代码缓存。在ASP.NET访客时涉及到网站之前的代码被编译成“机器语言”。缓存是对内存中的信息进行快速访问存储。 ASP.NET允许程序员建立重用被缓存的一段时间内,以提高Web应用的性能网页页面或区域。此外,ASP.NET允许数据的高速缓存。 3)内存泄漏和崩溃保护:从内存泄漏以确保该网站是始终可用的窗体顶端 ASP.NET还支持以超过25种.NET语言(包括VB.NET,C和Jscript.Net)代码。这是通过支持多个公共语言运行时(CLR)编译器实现的语言。 在ASP.NET应用程序有两个独立的身份验

16、证层。所有请求流通过IIS在他们交给ASP.NET面前,IIS可以决定拒绝访问ASP.NET之前甚至知道该请求。下面是如何处理工作: 在这种公关拍摄对象时,MySQL作为后端数据库。 MySQL是一个开放源代码的数据库管理系统。MySQL的特征在下面给出:MySQL是一个关系数据库管理系统。关系数据库在不同的表中存储的信息,而不是在一个巨大的表。这些表可以被引用到彼此之上,以访问和容易维护的数据。MySQL是开源的数据库系统。数据库软件可以使用,根据自己的需要任何人修改。它是快速,可靠和易于使用的。为了提高性能,MySQL是多线程的数据库数据库连接发动机。多线程应用程序,同时,该应用程序的多个

17、实例可被同时运行的多任务所执行。多线程MySQL有很多优点。一个单独的线程处理通过始终运行来管理连接一个额外的线程,使得每个传入连接。多个客户端可以同时执行读、写操作,但是只允许撑起另一个客户端需要访问的数据才能被更新。即使线程共享相同的进程空间,他们也分别执行。并且由于这种分离,多处理器机器可以作为主机操作系统支持多个CPU,且多个CPU的传播线一样长。多线程的关键功能,在于支持MySQL的性能设计目标。它的核心功能,围绕MySQL是“建立”.MySQL数据库使用ODBC驱动程序连接到ASP.NET。开放式数据库连接(ODBC)是用于数据库访问广泛接受的应用编程接口(API)。的ODBC D

18、RIV是实现由ODBC API支持的功能的库。它处理ODBC函数调用,提交SQL请求或者通过IIS直接处理或路由到ISAPI扩展。 ISAPI扩展是安装在Web服务器上编译类,其职责是返回标记为请求。例如,当一个请求是一个.html文件提出,IIS直接返回请求的HTML文件的内容。文件类型。默认情况下,IIS处理请求,并简单地返回请求的文件13的内容。 。这是有道理的静态文件,如图像,HTMLwwwpages,CSS文件,外部JavaScript文件,等等。对于ASP页面已经映射到ASP.DLL ISAPI扩展.asp扩展名。该ASP.DLL ISAPI扩展执行所请求的ASP页,并返回其生成的

19、HTML标记。如果网站提供了ASP.NET的Web页面,IIS已映射在.aspx到aspnet_isapi.dll,启动关闭ISAPI扩展。对于文件,其内容是动态生成的,ISAPI扩展配置文件扩展名是负责产生文件。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 “last 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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论