實(shí)現(xiàn)進(jìn)程這個(gè)抽象的概念需要低級(jí)硬件和操作系統(tǒng)軟件之間的緊密合作.
Implementing the process abstraction require close cooperation between both the low-level hardware and the operating system software.
線程:
一個(gè)進(jìn)程可以由多個(gè)(multiple )稱(chēng)為線程的執(zhí)行單元組成,每個(gè)線程都運(yùn)行在進(jìn)程的上下文當(dāng)中,分享著相同的代碼和全局?jǐn)?shù)據(jù). 由于網(wǎng)絡(luò)服務(wù)器對(duì)并行(concurrency )處理的需求,由于數(shù)據(jù)的分享在多個(gè)線程和處理器之間更加的容易,因?yàn)榫€程比處理器更加的高效.多線程是一種讓程序運(yùn)行得更快的結(jié)果,
A process can consist of multiple excution unites, calls treads, each treads are running in the context of the process, sharing the same code and global data. Because of the requirement for concurrency in network servers, because the share data is easier both multiple threads and multiple processes, because threads efficient than processes.
在linux中,地址空間最上面(topmost)的區(qū)域(region)是保留給操作系統(tǒng)中的代碼和數(shù)據(jù)的,這對(duì)所有的進(jìn)程來(lái)說(shuō)都一樣(common).地址空間的底部區(qū)域放用戶(hù)進(jìn)程定義的代碼和數(shù)據(jù).
In Linux, the topmost region for address is give code and data in the operating system. The lower address region put code and data of user process define.
每個(gè)進(jìn)程看到的虛擬地址(virtual address)空間由大量準(zhǔn)確定義(welldefined )的區(qū)構(gòu)成,每個(gè)區(qū)都有具體的(specific)的目的.
Each processes seen virtual address space consists of a number of welldefined areas, each areas have welldefined specific.
對(duì)所有進(jìn)程來(lái)說(shuō)代碼是從同一固定的地址開(kāi)始的,緊接著是C全局變量(global variables)相對(duì)應(yīng)(correspond )的數(shù)據(jù)位置. 代碼和數(shù)據(jù)區(qū)(data areas)是已直接初始化的(initialized)可執(zhí)行目標(biāo)文件內(nèi)容.
For all process the code always begin at same fixed address, followed data locati that correspond to global C variables, code and data areas are initialized directly from the contents of an executable object file.