why processes simplicity
play

Why processes? Simplicity nfsd emacs www nfsd OS gcc emacs ls - PowerPoint PPT Presentation

Why processes? Simplicity nfsd emacs www nfsd OS gcc emacs ls lpr ls www lpr OS Processes give isolated Address Spaces nfsd emacs lpr www ls OS Physical Memory (Paging) Physical Memory (Segmentation) Why processes? Speed


  1. Why processes? Simplicity nfsd emacs www nfsd OS gcc emacs ls lpr ls www lpr OS

  2. Processes give isolated Address Spaces nfsd emacs lpr www ls OS Physical Memory (Paging) Physical Memory (Segmentation)

  3. Why processes? Speed • I/O parallelism: emacs (wait for input) (wait for input) gcc overlap execution: make 1 CPU into many (Real parallelism: > 1 CPU (multiprocessing)) • Completion time: 80 s 20 s A B B’s completion time = 100s (A + B). So overlap A Completion time for B? A? B 10 s

  4. Process != Program • Program: code + data int a; int main() { passive printf (“hello”); } • Process: running program stack s tate: registers, stack, heap… position: program counter heap • We both run netscape: int a; data Same program, different process code main()

  5. The multithreading illusion • Each thread has its illusion of own CPU – yet on a uni-processor, all threads share the same physical CPU! How does this work? CPU • Two key pieces: – thread control block: one per thread, holds execution state – dispatching loop: while(1) interrupt thread save state get next thread load state, jump to it

  6. Remote Procedure Call (RPC) Comparison P1: P1: calls send(args) [2] sets up args in regs calls recv(), blocks [1] calls yield(P2) [1] P2: P2: calls recv(args) [2] resumes [1] … does work … … does work … calls send(results) [2] sets up results in regs P1: calls yield(P1) [1] P1: recv() returns [1] resumes [1] Monolithic Kernel: around [8] total ExoKernel: around [4] total user/kernel crossings user/kernel crossings

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend