版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、1.1 A Closer Look at the Processor and Primary Storage仔細看看處理器和主存儲器We have learned that all computers have similar capabilities and perform essentially the same functions, although some might be faster than others. We have also learned that a computer system has input, output, storage, and processing
2、 components; that the processor is the “intelligence” of a computer system; and that a single computer system may have several processors. We have discussed how data are represented inside a computer system in electronic states called bits. We are now ready to expose the inner workings of the nucleu
3、s of the computer system the processor. 我們已經(jīng)知道,所有的計算機都具有相似的能力,并且在本質(zhì)上執(zhí)行相同的功能,盡管一些可能會比另一些快一點。我們也知道,一個計算機系統(tǒng)具有輸入,輸出,存儲和處理部件;處理器是一個計算機系統(tǒng)智能核心,并且一個計算機系統(tǒng)可以有許多個處理器。我們已經(jīng)討論過如何在計算機系統(tǒng)內(nèi)部,用被稱作“位”的電子狀態(tài)來表現(xiàn)數(shù)據(jù),現(xiàn)在我們要弄明白計算機系統(tǒng)的核心,即處理器,的內(nèi)在的工作方式。The internal operation of a computer is interesting, but there really is no my
4、stery to it. The mystery is in the minds of those who listen to hearsay and believe science-fiction writer. The computer is a nonthinking electronic device that has to be plugged into an electrical power source, just like a toaster or a lamp.計算機的內(nèi)部操作很有意思,但確實沒有什么神秘可言。所謂的神秘只是存在于那些聽信傳聞和相信科幻小說作家的人的意識中。計
5、算機就是一種沒有思想的需要接通電源的電子設備而已,與烤面包機和臺燈差不多。Literally hundreds of different types of computers are marketed by scores of manufacturers 1. The complexity of each type may vary considerably, but in the end each processor, sometimes called the central processing unit or CPU, has only two fundamental sections:
6、 the control unit and the arithmetic and logic unit. Primary storage also plays an integral part in the internal operation of a processor. These three primary storage, the control unit, and the arithmetic and logic unit work together. Lets look at their functions and the relationships between them.不
7、加夸張地講,市場上有幾百種不同類型的計算機在銷售.每種電腦在復雜性上可能有很大區(qū)別,但歸根結(jié)底,每種處理器,有時稱為中央處理器即cpu,只有兩個基本部分:控制單元和計算邏輯單元.主內(nèi)存在處理器內(nèi)部操作中也是一個不可缺少的部分.這三個部件-主內(nèi)存,控制單元和計算邏輯單元-一起工作.然我們看看它們(各自的)功能和它們之間的聯(lián)系。 Unlike magnetic secondary storage devices, such as tape and disk, primary storage has no moving parts. With no mechanical movement, data
8、 can be accessed from primary storage at electronic speeds, or close to the speed of light. Most of todays computers use DRAM (Dynamic Random-Access Memory) technology for primary storage. A state-of-the-art DRAM chip about one eighth the size of a postage stamp can store about 256,000,000 bits, or
9、over 25,600,000 characters of data!主存與其他的輔助存儲器(如:磁帶、硬盤)不一樣的是,主存不含有運轉(zhuǎn)部件。由于沒有機械運轉(zhuǎn)的需要,主存種數(shù)據(jù)訪問可以達到電子的速度,或接近于光速。當今計算機的主存大多數(shù)使用DRAM(動態(tài)隨機存取存儲器)技術。目前最新的工藝水平是:一塊只有大約1/8張郵票大小的DRAM芯片卻可以存儲大約256,000,000位,約25,6000,000個字符的數(shù)據(jù)。Primary storage, or main memory, provides the processor with temporary storage for programs
10、 and data. All programs and data must be transferred to primary storage from an input device (such as a VDT) or from secondary storage (such as a disk) before programs can be executed or data can be processed. Primary storage space is always at a premium; therefore, after a program has been executed
11、, the storage space it occupied is reallocated to another program awaiting execution.主存儲器,也就是說內(nèi)存,用于為處理器暫時存放程序和數(shù)據(jù)。所有的程序和數(shù)據(jù)在被操作之前必須從輸入設備(如VDT)或者輔助存儲器轉(zhuǎn)存到主存儲器中。主存儲器存儲容量通常是相當有限的,因此,在一個程序執(zhí)行結(jié)束,它所占用的存儲空間必須被重新分配給其它正在等待執(zhí)行操作的程序。Figure 1-1 illustrates how all input/output (I/O) is “read to” or “written from” pr
12、imary storage. In the figure, an inquiry (input) is made on a VDT. The inquiry, in the form of a message, is routed to primary storage over a channel (such as a coaxial cable). The message is interpreted, and the processor initiates action to retrieve the appropriate program and data from secondary
13、storage 3.The program and data are “l(fā)oaded”, or moves, to primary storage from secondary storage. This is a nondestructive read process. That is, the program and data that are read reside in both primary storage (temporarily) and secondary storage (permanently). The data are manipulated according to
14、 program instructions, and a report is written from primary storage to a printer.圖 1-1描述了輸入/輸出設備與主存儲器間的讀和寫過程。在圖中,VDT發(fā)出一個輸入請求,請求是以消息模式通過通道(如同軸電纜)發(fā)送到主存儲器。這個查詢被解釋,處理器發(fā)起操作從輔助存儲器中調(diào)用合適的程序和數(shù)據(jù)。程序和數(shù)據(jù)從輔助存儲器傳送到主存儲器中,這是一個非破壞性的讀取過程,也就是說,程序和數(shù)據(jù)同時存在于主存(臨時保存)和輔助存儲器(永久保存)中。根據(jù)程序指令的指示,處理器對數(shù)據(jù)進行操作,并從主存?zhèn)魉鸵环輬蟾娴酱蛴C。A progra
15、m instruction or a piece of data is stored in a specific primary storage location called an address. Addresses permit program instructions and data to be located, accessed, and processed. The content of each address is constantly changing as different programs are executed and new data are processed
16、.程序指令和數(shù)據(jù)是存儲在主存中一個特殊的位置,稱為地址空間。通過地址空間可以實現(xiàn)計算機對程序指令和數(shù)據(jù)的定位、訪問和處理。地址空間的內(nèi)容是經(jīng)常變化的,這是由于計算機一直在執(zhí)行不同的程序和數(shù)據(jù)。Another name for primary storage is random-access memory, or RAM. A special type of primary storage, called read-only memory (ROM), cannot be altered by the programmer. The contents of ROM are “hard-wired
17、” (designed into the logic of the memory chip) by the manufacturer and can be “read only”. When you turn on a microcomputer system, a program in ROM automatically readies the computer system for use. Then the ROM program produces the initial display screen prompt.主存儲器也稱為隨機存取存儲器,或RAM。還有一種特殊的主存儲器,稱為只讀
18、存儲器(ROM),這種存儲器不能被程序更改存放的內(nèi)容。ROM的內(nèi)容是被生產(chǎn)商通過硬件電路寫入的,并且不能被重寫。當你啟動計算機,ROM中的一個程序會自動就緒等待計算機系統(tǒng)的調(diào)用,然后在顯示器中顯示開機提示。A variation of ROM is programmable read-only memory (PROM). PROM is ROM into which you, the user, can load “read-only” programs and data. Once a program is loaded to PROM, it is seldom, if ever, ch
19、anged 4. However, if you need to be able to revise the contents of PROM, there is EPROM, erasable PROM. Before a write operation, all the storage cells must be erased to the same initial state.可編程只讀存儲器(PROM)是另一種ROM,它可以載入只讀的程序和數(shù)據(jù),一旦載入,將不再改變。然而,若果你需要去修正PROM的內(nèi)容,可以使用可擦可編程只讀存儲器。EPROM在進行一次寫操作之前,所有的存儲單元必須被
20、還原為同一初始狀態(tài)。A more attractive form of read-mostly memory is electrically erasable programmable read-only memory (EEPROM). It can be written into at any time without erasing prior contents; only the byte or bytes addressed are updated.一種更吸引人的可改寫只讀存儲器是電可擦除可編程只讀存儲器 (EEPROM)。它可以在任何時候?qū)懭耄也粫脸郧暗膬?nèi)容;只會更新被尋址
21、的字節(jié)。The EEPROM combines the advantage of nonvolatility with the flexibility of being updatable in place 6, using ordinary bus control, address, and data lines.電可擦可編程存儲器把非易失性優(yōu)點和可更新、需要更新的地方的靈活性結(jié)合起來,修改時使用普通的總線控制線、地址線和數(shù)據(jù)線。Another form of semiconductor memory is flash memory (so named because of the spee
22、d). Flash memory is intermediate between EPROM and EEPROM in both cost and functionality. Like EEPROM, flash memory uses an electrical erasing technology. An entire flash memory can be erased in one or a few seconds, which is much faster than EPROM. In addition, it is possible to erase just blocks o
23、f memory rather than an entire chip. However, flash memory does not provide byte-level erasure 7. Like EPROM, flash memory uses only one transistor per bit, and so achieves the high density of EPROM.另一種半導體記憶體是閃存(意味著速度快)。閃存在性價比上處于EPROM和EEPROM之間,它使用電擦寫技術。整個閃存的內(nèi)容可以在一到幾秒內(nèi)被清除,這是遠快于EPROM的。另外,它還可以對部分記憶塊而不是
24、整個存儲器進行清除。然而,閃存并不提供字節(jié)級的擦除。像EPROM,閃存只使用一個晶體管每比特,因此可以實現(xiàn)高密度的EPROM。Cache MemoryProgram and data are loaded to RAM from secondary storage because the time required to access a program instruction or piece of data from RAM is significantly less than from secondary storage. Thousands of instructions or pie
25、ces of data can be accessed from RAM in the time it would take to access a single piece of data from disk storage 8. RAM is essentially a high-speed holding area for data and programs. In fact, nothing really happens in a computer system until the program instructions and data are moved to the proce
26、ssor. This transfer of instructions and data to the processor can be time-consuming, even at microsecond speeds. To facilitate an even faster transfer of instructions and data to the processor, most computers are designed with cache memory. Cache memory is employed by computer designers to increase
27、the computer system throughput (the rate at which work is performed).程序和數(shù)據(jù)從輔助存儲器裝載到RAM中是因為對RAM中的程序指令和數(shù)據(jù)的訪問時間要明顯的少于從輔助存儲器訪問。數(shù)以千條的指令和數(shù)據(jù)能被訪問而只需花費從硬盤訪問一次數(shù)據(jù)的時間。RAM是數(shù)據(jù)和程序的重要的高速存放區(qū),事實上,計算機系統(tǒng)不會進行任何操作直到程序指令被傳入處理器進行執(zhí)行,這種指令和數(shù)據(jù)的傳輸是需要花費時間的,即使傳輸速度已經(jīng)是以納秒來計算了。為了能更快速的傳輸指令和數(shù)據(jù),大多數(shù)計算機設計使用高速緩存。計算機設計者使用高速緩存來提高計算機系統(tǒng)的總處理能力
28、(工作效率)。Like RAM, cache is a high-speed holding area for program instructions and data. However, cache memory uses SRAM (Static RAM) technology that is about 10 times faster than RAM and about 100 times more expensive. With only a fraction of the capacity of RAM, cache memory holds only those instruc
29、tions and data that are likely to be needed next by the processor. Two types of cache memory appear widely in computers. The first is referred to as internal cache and is built into the CPU chip. The second, external cache, is located on chips placed close to the CPU chip. A computer can have severa
30、l different levels of cache memory. Level 1 cache is virtually always built into the chip. Level 2 cache used to be external cache but is now typically also built into the CPU like level 1 cache.和RAM一樣,高速緩存也是程序指令和數(shù)據(jù)的高速存儲區(qū)。然而,高速緩存使用靜態(tài)RAM技術,這種技術比RAM在速度上要高出10倍,價格上高出100倍。cache只保存內(nèi)存中那一小部分最有可能被處理器執(zhí)行的指令和數(shù)據(jù)
31、。兩種類型的cache廣泛應用于計算機,第一種被植入cpu中的叫做內(nèi)部高速存儲,第二種是外部高速存儲,它位于那些靠近cpu的芯片中。一臺計算機可以擁有幾個不同級別的高速緩存。一級緩存實際上總是植入芯片中,二級緩存過去常常作為外部高速緩存,但是現(xiàn)在也像一級緩存植入cpu內(nèi)部。3.2 C+和面向?qū)ο蟮某绦蛟O計一些面向?qū)ο蟮某绦蛟O計概念在語言間滲透。例如微軟Quick Pascal是允許使用對象的第一批語言中的一個。C+有什么使得它是一種適合于開發(fā)面向?qū)ο蟪绦虻恼Z言?如同先前所提到的,答案是類(class)數(shù)據(jù)類型。給該語言建立對象之能力的是建立在C結(jié)構(gòu)類型之上的C+類(class)類型。還有,C+
32、把另外幾個特性引入面向?qū)ο蟮某绦蛟O計,這些特性并不包含在簡單地利用對象的其他一些語言中。C+的優(yōu)點包括強類型、運算符重載和較少地強調(diào)預處理。的確你能使用其他一些產(chǎn)品和采用其他一些語言來進行面向?qū)ο蟮某绦蛟O計,但是采用C+的眾多好處是顯著的。這是為面向?qū)ο蟮某绦蛟O計而設計的語言,并非(現(xiàn)有語言的)式樣翻新。面向?qū)ο蟮某绦蛟O計是一種程序設計技術,使得你能把一些概念看作各種各樣的對象。通過使用對象,你能表示要被執(zhí)行的任務、它們之間的相互作用和必須觀察的某些給定的條件。一種數(shù)據(jù)結(jié)構(gòu)經(jīng)常形成某個對象的基礎;因此,在C或C+中,結(jié)構(gòu)類型能形成某種基本對象。與對象的通信,如前提到的,能通過使用消息來完成。消
33、息的使用類似于在面向過程的程序中對函數(shù)的調(diào)用。當某對象收到一個消息時,包含在該對象內(nèi)的一些方法作出響應。方法類似于面向過程程序設計的函數(shù)。然而,方法是對象的一部分。C+的類是對C和C+結(jié)構(gòu)類型的擴充,并且形成了面向?qū)ο蟪绦蛟O計所需要的抽象數(shù)據(jù)類型。類能包含緊密相關的一些條目,它們共享一些屬性。更正式地說,對象只不過是類的實例。最終,應該出現(xiàn)包含很多對象類型的類庫,你能使用這些對象類型的實例去拼合程序代碼。在你更詳細地考察這些術語之前,一個好的主意是熟悉與C+和面向?qū)ο蟪绦蛟O計相關的另外幾個概念,如同下面幾節(jié)所述的。封裝封裝指的是每個對象把它的成員數(shù)據(jù)和成員函數(shù)(方法)組合成單個結(jié)構(gòu)的方式。圖3
34、-1舉例說明了你如何能組合數(shù)據(jù)域和方法以建立對象。 數(shù)據(jù)域 方法 數(shù)據(jù)數(shù)據(jù)成員函數(shù)成員函數(shù)成員函數(shù)數(shù)據(jù)數(shù)據(jù)成員函數(shù)成員函數(shù)成員函數(shù) 圖3-1 為建立對象而組合的數(shù)據(jù)域和方法典型地,一個對象的描述是一個C+類的一部分, 且包括對該對象內(nèi)部結(jié)構(gòu)的描述、該對象如何與其他對象相關,以及把該對象的功能細節(jié)和該類的外部相隔離的某種形式的保護。C+類結(jié)構(gòu)做到了所有這些。在一個C+類中,你使用私有的、公共的和/或受保護的描述符來控制對象的功能細節(jié)。在面向?qū)ο蟮某绦蛟O計中,公共(public)部分一般用于接口信息(方法),使得該類可在各應用中重用。如果數(shù)據(jù)或方法被包含在公共部分,它們在該類外部也可用。類的私有部
35、分把數(shù)據(jù)或方法的可用性局限于該類本身。包含數(shù)據(jù)或方法的受保護部分被局限于該類和任何派生子類。類層次結(jié)構(gòu)C+類實際上用作創(chuàng)建對象的模板或模式。從類描述形成的對象都是該類的實例。開發(fā)類層次結(jié)構(gòu)是可能的,其中有一個主類和幾個子類。在C+中, 做這事的基礎是派生類。父類表示更一般化的任務,而派生子類執(zhí)行一些特定的任務。例如,早先討論的林肯類也許包含整個林肯系列公共的數(shù)據(jù)和方法,諸如引擎、檢測儀表、電池、制動能力和操縱。從父類派生的子類,諸如Tour Car、Mark 和Continental可能包含該類專用的一些款項。例如,1995 Continental是該系列中唯一具有主動懸架系統(tǒng)的汽車。繼承面向
36、對象程序設計中的繼承使得一個類能繼承某對象類的一些性質(zhì)。父類用作派生類的模式,且能以幾種方式被改變(在下一章中你將了解成員函數(shù)能被重載、新的成員函數(shù)能被添加,并且成員存取特權能被改變)。如果某個對象從單個父類繼承其屬性,稱為單繼承。如果某個對象從多個父類繼承屬性,便稱為多繼承。繼承是一個重要概念,因為它使得無須對代碼做大的改變就能重用類定義。繼承鼓勵重用代碼,因為子類是對父類的擴充。多態(tài)性與類層次結(jié)構(gòu)相關的另一個重要的面向?qū)ο蟾拍钍枪蚕⒛鼙话l(fā)送到諸父類對象和所有派生子類對象。按正式的術語,這稱為多態(tài)性。多態(tài)性使每個子類對象能以一種對其定義來說適當?shù)姆绞綄ο⒏袷阶鞒鲰憫?。試設想收集數(shù)據(jù)的一
37、個類層次結(jié)構(gòu)。父類可能負責收集某個個體的姓名、社會安全號、職業(yè)和雇傭年數(shù),那末你能使用子類來決定根據(jù)職業(yè)將添加什么附加信息。一種情況,一個管理職位會包括年薪,而另一種情況,銷售員職位會包括小時工資和回扣信息。因此,父類收集一切子類公共的通用信息,而子類收集與特定工作描述相關的附加信息。多態(tài)性使得公共的數(shù)據(jù)收集消息能被發(fā)送到每個類。父類和子類兩者都以對該消息是恰當?shù)姆绞阶鞒鲰憫?。多態(tài)性促進現(xiàn)有代碼的可擴充性。虛函數(shù)多態(tài)性賦予對象以當對象的精確類型還未知時響應來自例行程序之消息的能力。在C+中這能力是遲綁定的結(jié)果。使用遲綁定,地址在運行時刻動態(tài)地確定,而不是如同傳統(tǒng)的編譯型語言在編譯時刻靜態(tài)地確定
38、。這靜態(tài)的(固定的)方法往往稱為早綁定。函數(shù)名被替換為存儲地址。你使用虛函數(shù)來完成遲綁定。在隨后的派生類將通過重定義函數(shù)之實現(xiàn)而重載該函數(shù)時,在父類中定義虛函數(shù)。當你使用虛函數(shù)時,消息不是直接傳給對象,而是作為指向?qū)ο蟮闹羔槀魉?。虛函?shù)利用了地址信息表, 該表在運行時刻使用構(gòu)造符而被初始化。一個構(gòu)造符每當創(chuàng)建它的類的一個對象時被調(diào)用。這里構(gòu)造符的工作是把虛函數(shù)與地址信息表鏈接,在編譯運轉(zhuǎn)期間虛函數(shù)的地址是未知的;相反,給出的是(在運行時刻確定的)地址表中將包含該函數(shù)(入口)地址的位置。3.4 JavaScript教程 Java is designed to meet the challenge
39、s of application development in the context of heterogeneous, network-wide distributed environments. Paramount among these challenges is secure delivery of applications that consume the minimum of system resources, can run on any hardware and software platform, and can be extended dynamically.Java是為
40、了解決在復雜的、大規(guī)模分布式網(wǎng)絡環(huán)境下開發(fā)應用程序的挑戰(zhàn)而設計的。其中最大的一個挑戰(zhàn)是確保交付的程序:占用最少的系統(tǒng)資源,并且能在任何硬件、軟件平臺下運行,能被動態(tài)擴展。Java originated as part of a research project to develop advanced software for a wide variety of network devices and embedded systems. The goal was to develop a small, reliable, portable, distributed, real-time oper
41、ating platform. When the project started, C+ was the language of choice. But over time the difficulties encountered with C+ grew to the point where the problems could best be addressed by creating an entirely new language platform. Design an architecture decisions drew from a variety of language suc
42、h as Eiffel, SmallTalk, Objective, C, and Cedar/Mesa. The result is a language platform that has proven ideal for developing secure, distributed, network based end-user applications in environments ranging from network-embedded devices to the World-Wide-Web an the desktop.Java最初只是一個為各種網(wǎng)絡和嵌入式設備而研究的軟件
43、系統(tǒng)的一部分,這個系統(tǒng)的目標是一個小的、可信賴的、可移植的,分布式的、實時的平臺。最開始C+語言是這個平臺的首選。但隨著時間的推移,C+出現(xiàn)了很多問題,有必要開發(fā)一個全新的語言平臺。我們根據(jù)Eiffel, SmallTalk, Objective, C, and Cedar/Mesa等語言來做出決策,結(jié)果是開發(fā)出了一個理想的、能在從嵌入式網(wǎng)絡設備到萬維網(wǎng)到桌面等各種環(huán)境下方便的開發(fā)安全的、分布的、基于網(wǎng)絡的應用程序的平臺。The design requirements of Java are driven by the nature of the computing environments
44、in which software must be deployed.Java的設計要求是由軟件所部署的計算環(huán)境的本質(zhì)決定的.The massive growth of the Internet and the World-Wide Web leads us to a completely new way of looking at development and distribution of software. To live in the world of electronic commerce and distribution, Java technology must enable
45、the development of secure, high performance, and highly robust applications on multiple platforms in heterogeneous, distributed networks.互聯(lián)網(wǎng)和萬維網(wǎng)的快速發(fā)展帶領我們用新的眼光去看待開發(fā)和發(fā)布軟件。在電子商務的時代,Java必須具有開發(fā)安全性、高效性、健壯的、大眾的、能在多平臺和多樣化、分布式網(wǎng)絡運行的程序。Operating on multiple platforms in heterogeneous networks invalidates the t
46、raditional schemes of binary distribution , release, upgrade, patch, and so on. To survive in this jungle, java must be architecture neutral, portable, and dynamically adaptable.為了能在異構(gòu)網(wǎng)絡的多個平臺上執(zhí)行二進制發(fā)布、升級、修補等計劃的環(huán)境中發(fā)展,Java必須是總體結(jié)構(gòu)不帶偏向性的、可移植的、且能動態(tài)地自適應的。The java system that emerged to meet there needs in
47、simple, so it can be easily programmed by most developers; familiar, so that current developers can easily learn java; object oriented ,to take advantage of modern software development methodologies and to fit into distributed client-server application; multithreaded, for high performance in applica
48、tions that need to perform multiple concurrent activities , such as multimedia; and interpreted ,for maximum portability and dynamic capabilities.Java系統(tǒng)的出現(xiàn)使得這些需求變得簡單,所以可以很容易的被大多數(shù)開發(fā)人員所使用;大眾的,所以現(xiàn)在的開發(fā)人員可以很容易的學習Java;面對對象的,利用現(xiàn)代軟件開發(fā)方法的優(yōu)勢以適應分布式客戶端-服務器應用程序;多線程的,用于高性能的執(zhí)行多個并發(fā)活動,如多媒體;解釋型的,為了最大的可移植性和動態(tài)能力。Togeth
49、er, the above requirements comprise quite a collection of buzzwords, so lets examine some of them and their respective benefits before going on.總的來說,上述包括相當多的專業(yè)術語,所以在繼續(xù)之前先讓我們來認識一下它們以及它們所帶來的的各種好處。Whats completely new is the manner in which java and its run-time system have combined them to produce a f
50、lexible and powerful programming system.Java和它在運行時的系統(tǒng)能包含有良好的操作性以及強大的編譯設計系統(tǒng)是一種全新的方式。 Developing your applications using Java results in software that is portable across multiple machine architectures, operating systems, and graphical user interfaces, secure, and high performance. With Java, your job
51、as a software developer is much easier-you focus your full attention on the end goal of shipping innovative products on time, based on the solid foundation of Java. The better way to develop software is here, now, brought to you by the Java language platform.使用Java開發(fā)您的應用軟件所帶來的是可在多種機器總體結(jié)構(gòu)、操作系統(tǒng)和圖形用戶借口
52、間的移植,安全性和高性能。使用Java,你作為軟件開發(fā)人員的工作室非常容易的-基于Java的基礎您可以專注發(fā)展和及時創(chuàng)新。開發(fā)軟件的最好方法在這里,現(xiàn)在,給您帶來Java語言平臺。 Very dynamic languages like lisp, TCL, and SmallTalk are often used for prototyping. one of the reasons for their success at this is that they are very robust-you dont have to worry about freeing or corrupting
53、 memory.非常具有生命力的語言如lisp、tcl和SmallTalk常常用于充當原型構(gòu)造技術。他們在這取得成功的其中一個原因是:他們非常強大,您不需要內(nèi)存的釋放或者損壞。Similarly ,programmers can be relatively fearless about dealing with memory when programming in java .the garbage collection system makes the programmers job vastly easier ;with the burden of memory management ta
54、ken off the programmers shoulders , storage allocation errors go away.同樣的,程序員在使用Java編程的時候可以不用過多擔心存儲問題。無用單元手機系統(tǒng)使程序員的工作大為容易,卸下了程序員肩上存儲管理的負擔,存儲分配錯誤不再發(fā)生。 Another reason commonly given that like lisp , TCl, and smalltalk are good for prototyping is that they dont require you to pin down decision early on
55、 these languages are semantically rich.一般認為像LISP、TCL和SmallTack這樣一些語言十分適合于原型法的另一理由,是因為它們不要求你受早期決定的約束-這樣的語言的語義是很豐富的。 Java has exactly the opposite property ; it forces you to make explicit choices . along with these choices come a lot of assistance you can write method invocations and ,if you get some
56、thing wrong, you get told about it at compile time . you dont have to worry about method invocations error.Java具有完全相反的性質(zhì),它強制你做出明確的選擇。伴隨著這些選擇的是許多助理-如:你可以寫一些方法的調(diào)用,如果有錯誤,你會在編譯時被告知。您也不需要擔心方法調(diào)用錯誤。4.1 summary of osAn operating system is the software which acts as an interface between a user of a computer
57、and the computer hardware.操作系統(tǒng)是計算機用戶和硬件的軟件接口。The purpose of an operating system is to provide an environment in which a user may execute program. 操作系統(tǒng)的目的是提供用戶一個可以執(zhí)行程序的環(huán)境。The primary goal of an operating system is thus to make the computer system convenient to use. 操作系統(tǒng)的主要目標因此是使計算機系統(tǒng)便于使用。A secondary
58、goal is to use the computer hardware in an efficient way. 其次是高效地使用計算機硬件。We can view an operating system as a resource allocator. 我們可以把操作系統(tǒng)看做是一個資源分配器。A computer system has many resources which may be required to solve a problem: CPU time, memory space, file storage, input/output(I/O) devices, and so on.一個計算機系統(tǒng)擁有許多資源,因此需要去解決一些問題,如cpu時間,內(nèi)存空間,文件存儲,輸入輸出設備等。The operating system acts as the manager of these resources and allocates them to specific program
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 城市市政項目在線學習作業(yè)
- 高校校企合作項目管理流程標準
- 脫硫工程施工組織設計方案
- 餐飲企業(yè)節(jié)能減排管理措施
- 服裝采購管理方案及供應鏈實施
- 房地產(chǎn)開發(fā)項目合同范本及解析
- 物業(yè)管理崗位職責清單
- 幼兒園游戲教學與安全監(jiān)管手冊
- 小學生數(shù)學趣味課堂活動設計
- 企業(yè)網(wǎng)絡安全設備調(diào)試驗收報告
- NB-T20048-2011核電廠建設項目經(jīng)濟評價方法
- 4第四章 入侵檢測流程
- 鈀金的選礦工藝
- 人工智能在金融策略中的應用
- JCT640-2010 頂進施工法用鋼筋混凝土排水管
- 赤壁賦的議論文800字(實用8篇)
- 高壓燃氣管道施工方案
- 輸變電工程技術標書【實用文檔】doc
- 南部山區(qū)仲宮街道鄉(xiāng)村建設規(guī)劃一張表
- GB/T 2652-1989焊縫及熔敷金屬拉伸試驗方法
- GB/T 25630-2010透平壓縮機性能試驗規(guī)程
評論
0/150
提交評論