09-02-2013, 02:38 PM
Using the Operating System
Using the Operating .ppt (Size: 387.5 KB / Downloads: 14)
Abstract Machine Entities
Process: A sequential program in execution
Resource: Any abstract resource that a process can request, and which may can cause the process to be blocked if the resource is unavailable.
File: A special case of a resource. A linearly-addressed sequence of bytes. “A byte stream.”
Classic Process
OS implements {abstract machine} – one per task
Multiprogramming enables N programs to be space-muxed in executable memory, and time-muxed across the physical machine processor.
Result: Have an environment in which there can be multiple programs in execution concurrently*, each as a processes
More on Processes
Abstraction of processor resource
Programmer sees an abstract machine environment with spectrum of resources and a set of resource addresses (most of the addresses are memory addresses)
User perspective is that its program is the only one in execution
OS perspective is that it runs one program with its resources for a while, then switches to a different process (context switching)
OS maintains
A process descriptor data structure to implement the process abstraction
Identity, owner, things it owns/accesses, etc.
Tangible element of a process
Resource descriptors for each resource
Address Space
Process must be able to reference every resource in its abstract machine
Assign each unit of resource an address
Most addresses are for memory locations
Abstract device registers
Mechanisms to manipulate resources
Addresses used by one process are inaccessible to other processes
Say that each process has its own address space
Shared Address Space
Classic processes sharing program shared address space support
Thread model simplifies the problem
All threads in a process implicitly use that process’s address space , but no “unrelated threads” have access to the address space
Now trivial for threads to share a program and data
If you want sharing, encode your work as threads in a process
If you do not want sharing, place threads in separate processes
Objects
A recent trend is to replace processes by objects
Objects are autonomous
Objects communicate with one another using messages
Popular computing paradigm
Too early to say how important it will be ...