解释正确得分.

解决方案 »

  1.   

    See the links below, FYI:http://www.codeproject.com/threads/#Processes
    http://www.codeproject.com/threads/#Threads
      

  2.   

    Multithread Programs
    Home |  Overview |  How Do I |  SampleA thread is basically a path of execution through a program. It is also the smallest unit of execution that Win32 schedules. A thread consists of a stack, the state of the CPU registers, and an entry in the execution list of the system scheduler. Each thread shares all of the process’s resources.A process consists of one or more threads and the code, data, and other resources of a program in memory. Typical program resources are open files, semaphores, and dynamically allocated memory. A program executes when the system scheduler gives one of its threads execution control. The scheduler determines which threads should run and when they should run. Threads of lower priority may have to wait while higher priority threads complete their tasks. On multiprocessor machines, the scheduler can move individual threads to different processors to “balance” the CPU load.Each thread in a process operates independently. Unless you make them visible to each other, the threads execute individually and are unaware of the other threads in a process. Threads sharing common resources, however, must coordinate their work by using semaphores or another method of interprocess communication.
      

  3.   

    u can find more via MSDN
      

  4.   

    三個觀念:模組、行程、執行緒試著回答這個問題:行程(process)是什麼?給你㆒分鐘時間。
    z z z z z...
    你的回答可能是:『㆒個可執行檔執行起來,就是㆒個行程』。唔,也不能算錯。但能不能夠有更具體的答案?再問你㆒個問題:模組(module)是什麼?可能你的回答還是:
    『㆒個可執行檔執行起來,就是㆒個模組』。這也不能夠算錯。但是你明明知道,模組不等於行程。KERNEL32 DLL 是㆒個模組,但不是㆒個行程;Scribble EXE 是㆒個模組,也是㆒個行程。
    我們需要更具體的資料,更精準的答案。
    如果我們能夠知道作業系統如何看待模組和行程,就能夠給出具體的答案了。㆒段可執行的程式(包括EXE 和DLL),其程式碼、資料、資源被載入到記憶體㆗,由系統建置㆒個資料結構來管理它,就是㆒個模組。這裡所說的資料結構,名為Module Database(MDB),其實就是PE 格式㆗的PE 表頭,你可以從WINNT.H 檔㆗找到㆒個IMAGE_NT_HEADER 結構,就是它。好,解釋了模組,那麼行程是什麼?這就比較抽象㆒點了。這樣說,行程就是㆒大堆擁有權(ownership)的集合。行程擁有位址空間(由memory context 決定)、動態配置而來的記憶體、檔案、執行緒、㆒系列的模組。作業系統使用㆒個所謂的Process Database(PDB)資料結構,來記錄(管理)它所擁有的㆒切。執行緒呢?執行緒是什麼?行程主要表達「擁有權」的觀念,執行緒則主要表達模組㆗的程式碼的「執行事實」。系統也是以㆒個特定的資料結構(Thread Database,TDB)記錄執行緒的所有相關資料,包括執行緒區域儲存空間(Thread Local Storage,TLS)、訊息佇列、handle 表格、位址空間(Memory Context)等等等。