JOEMAR B. OLAIVAR

.....MAHAL KITA PERO MAS MAHAL KO ANG SARILI KO!!!

Thursday, July 16, 2009

5.) INTERPROCESS COMMUNICATION

>For communication and synchronization
–Shared memory
–OS provided IPC
>Message system
–no need for shared variable
– two operations
•send(message) – message size fixed or variable
•receive(message)
>If P and Q wish to communicate, they need to
–establish a communication link between them
–exchange messages via send/receive
>Implementation of communication link
–physical (e.g., shared memory, hardware bus)
–logical (e.g., logical properties)

4.) COOPERATING PROCESSES

>Advantages of process cooperation
–Information sharing
–Computation speed-up
–Modularity
–Convenience
>Independent process cannot affect/be affected by the execution of another process, cooperating ones can
>Issues
–Communication
–Avoid processes getting into each other’s way
–Ensure proper sequencing when there are dependencies
>Common paradigm: producer-consumer
–unbounded-buffer - no practical limit on the size of the buffer
–bounded-buffer - assumes fixed buffer size

3.) OPERATION PROCESS

A.) PROCESS ON CREATION
Parent process creates children processes, which, in turn create other processes, forming a tree of processes.

Resource sharing:

>Parent and children share all resources.
>Children share subset of parent’s resources.
>Parent and child share no resources.

Execution:

>Parent and children execute concurrently.
>Parent waits until children terminate.

B.) PROCESS TERMINATION

>Process executes last statement and asks the operating system to delete it (exit).
>Output data from child to parent (via wait).
>Process’ resources are deallocated by operating system.
>Parent may terminate execution of children processes (abort).
>Child has exceeded allocated resources.
>Task assigned to child is no longer required.
>Parent is exiting.
>Operating system does not allow child to continue if its parent terminates.
>Cascading termination.
>In Unix, if parent exits children are assigned init as parent

2.) PROCESS SHEDULING

A.) SCHEDULING QUEUSE

>Job queue – set of all processes in the system.
>Ready queue – set of all processes residing in main memory, ready and waiting to >Execute.Device queues – set of processes waiting for an I/O device.
>Processes migrate between the various queues.

B.) SCHEDULERS

>Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue.
>Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU.

>Short-term scheduler is invoked very frequently (milliseconds) fi (must be fast).
>Long-term scheduler is invoked very infrequently (seconds, minutes) fi (may be slow).
>The long-term scheduler controls the degree of multiprogramming.
>Processes can be described as either:
>I/O-bound process – spends more time doing I/O than computations, many short CPU bursts.
>CPU-bound process – spends more time doing computations; few very long CPU bursts.


C.) CONTEXT SWITCH

>When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process.
>Context-switch time is overhead; the system does no useful work while switching.
>Time dependent on hardware support.

1.) THE CONCEPTS OF PROCESS

A.) PROCESS STATE

-As a process executes, it changes state
new: The process is being created.F running: Instructions are being executed.
waiting: The process is waiting for some event to occur.
ready: The process is waiting to be assigned to a processor
terminated: The process has finished execution.

B.) PROCESS CONTROL BLACK

-Information associated with each process.
>Process ID
>Process state
>Program countern CPU registers
>CPU scheduling information
>Memory-management information
>Accounting information
>I/O status information

C.) THREADS

-Each process provides the resources needed to execute a program. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution. Each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads.

Thursday, July 9, 2009

QUIZ NUMBER 3

1.) WHAT ARE THE MAJOR ACTIVITIES OF THE O.S WITH REGARDS TO PROCESS MANAGEMENT.

  • Process creation and deletion
  • Process suspension and resumption
  • Provision of management for:
  • Process synchornization
  • Process communication
  • Deadlack handling

2.) WHAT ARE THE MAJOR ACTIVITIES OF THE O.S WITH REGARDS TO MEMORY MANAGEMENT.

  • Keep track of w/ parts of memory are curently being used and by whom.
  • Decide w/c porcess to load when memory space becomes avalable.
  • Allocate and dellocate memory space as needed.

3.) WHAT ARE THE MAJOR ACTIVITIES OF THE O.S WITH REGARDS TO SECONDARY-STORAGE MANAGEMENT.

  • Free space management.
  • Storage allocation.
  • Disk scheduling.

4.) WHAT ARE THE MAJOR ACTIVITIES OF THE O.S WITH REGARDS TO FILE MANAGEMENT.

  • File creation and deletion.
  • Directory creation and deletion.
  • Support of primitives for manipulating files and directories.
  • Mapping files onto secondary storage.
  • File backup on stable (volatile) storage media.

5.) WHAT IS THE PURPOSE OF THE COMMAND INTERPRETER

  • Serves as the interface between the user and the operating system.
  • User friendly, mouse based windows environment in the macintosh and in microsoft windows.
  • Many command are given to the operating system by control statement with deals.
  • Program that read and interpreters control statements is called variously.

Tuesday, July 7, 2009

SYSTEM BOOT

Operating system must be made available to hardware so hardware can start it

Small piece of code – bootstrap loader, locates the kernel, loads it into memory, and starts it
Sometimes two-step process where boot block at fixed location loads bootstrap loader
When power initialized on system, execution starts at a fixed memory location
Firmware used to hold initial boot code