More About Me...

Lorem ipsum dolor sit amet, nisl elit viverra sollicitudin phasellus eros, vitae a mollis. Congue sociis amet, fermentum lacinia sed, orci auctor in vitae amet enim. Ridiculus nullam proin vehicula nulla euismod id. Ac est facilisis eget, ligula lacinia, vitae sed lorem nunc. Orci at nulla risus ullamcorper arcu. Nunc integer ornare massa diam sollicitudin.

Another Tit-Bit...

Lorem ipsum dolor sit amet, nisl elit viverra sollicitudin phasellus eros, vitae a mollis. Congue sociis amet, fermentum lacinia sed, orci auctor in vitae amet enim. Ridiculus nullam proin vehicula nulla euismod id. Ac est facilisis eget, ligula lacinia, vitae sed lorem nunc.

Management Process

Process:
The program is being run or the software that is being implemented, including the operating system organized into a number of sequential process.

The basic concept of:
1. Multiprogramming
Establishing a process alternates in a very quick time / same time (the hardware level). Each process has a virtual CPU.
2. Pseudoparallelism
Conducting more than one job in the same time / pseudoparallelism (user level).

The model:

1. Sequential Process / alternate
2. Multiprogramming
3. Switching the CPU procedures in the transition process 1 to process the other.

The concept of each process have 1 virtual CPU, but the reality is multiprogramming. It will be easier to assume that the collection process run in parallel.

Description:
a. multiprogramming for 4 programs in memory
b. conceptual model for 4 independent process, sequential
c. only 1 program is active in 1 time = pseudoparalel

Hierarchy Process
Calling the process by another process called parallel. Operating system provides what is needed by the process. Generally, the process created and removed during the operation lasted.

1. Create & Destroy Process
Operating system that supports the concept of the process, should provide a way to (create) the process and eliminate (Destroy) process.
2. Fork System Call
Mechanism to create (create) a process that is identical with the process that call.
Example:
Parent -> children
->children -> children
->children
In UNIX, parent and child process running in parallel.
In DOS, parent and child process running alternately (sequential). For example: MSDOS as a parent and program applications as a child.

Process scheduler for the execution process

Status of the 3 / the state of the process:
1. Running / work, really use the CPU at that time (instructions are in the process of executing it).
2. Blocked / stopped, can not walk up to an external activities involved (the accident waiting to complete its work)
Can be a process of waiting: the completion of operating the device I / O; Availability of memory; arrival message answers
3. Ready / ready, the process is done, but ready to wait another turn with a process that is being done (can walk, stop temporarily to allow other process is done)

Transitional Status

1. The process in the block to serve as the input of resources that are not yet available / ask the service I / O wait until incidents occur.
2. Scheduling take the other.
3. Scheduling take this process (new).
4. Input has been available.

Implementation Process:

  • To model the process, the operating system using a table / array called the table with 1 per-entry process.
  • Each entry contains about: the status process, the program counter, stack pointer, memory allocation, the status of the files, information schedulling / scheduling information, etc. from the status of work to ready status.
  • Interupsi: Work on the processor a process stopped by pensaklaran context.
  • Pensaklaran context: changes in the activities of the processor to process that occurs between the system / application process
  • Context: the processor to the case, comes from the operating system, language system and system utilities.
  • Block control the process: a memory to record the state of the process, which is divided into areas where each region to record different information.

2 interruptions in the processor:

  1. Interruptions directly
  2. Derived from outside the processor (peripheral / tool send a signal to the processor to request services)

  3. Ask interruptions / Polling
  4. Derived from the processor (the processor in turns to check whether there are peripherals that require services or not)

  • Interupsi-in can enable and disable depending on the level.
  • The interruptions can come from:
  • Program, the program has been designed in a certain part will happen pensaklaran context, that causes interruptions, for example, when the use of tools / processor alternates.
  • Processors, the processor can generate its own interruption, the normal process arithmetic and logic. If melampoi size patch registers in the processor, then there will be a mistake menginterupsi own work and submit a control processor on the operating system. For example, the division of the number zero.
  • Unit of control, the task to implement the interruption is located on the control unit, so that the control unit can generate interruptions. For example, confusion instructions
  • Key time / clock, using the interruption periodic. For example, the program anahammad the infinite, diinterupsi on the lapse of time every 60 seconds.
  • Peripheral I / O, I / O will work if you let the processor with the processor interruptions and also when the work is completed or when the error occurred parity.
  • Memory, because the error occurred, for example, when the processor wants to reach the address of the memory is located outside the expanse of memory address.
  • other resources, for instance, raised by the service computer system that understands how interruptions.
  • Interupsi vector: Contains procedures address service interruptions
  • Revenue interruptions and interruptions necessary: sometimes rejected by the interruption processor or interruptions that come not only one that required priority.

Follow-up interruptions:
1. Organized interruptions / Interrupt handlers
if the interruption occurs, the control processor submitted to the interruptions in the system’s operation, it’s interruption is conducting interruptions.
a. Instructions are processed by the processor left to complete the program.
b. Organized interruptions record all the information to process control block in the process.
c. Organized interruptions to identify the type and origin of interruptions.
d. Organized interruptions to take action in accordance with the definition interruptions.
e. Organized interruptions prepare everything for the resumption of the process diinterupsi.
2. Organized wrong / error handlers
namely interruptions because of confusion on the part of the process and the processing of the operating system up activities resulting’s mistake is misleading.
a. Recovery, the computer has been equipped with a password error discovery and recovery, for example, have been equipped with a password so that when Hamming find the password will correct the mistake error, the process is restored to original form before the error occurred.
b. Repetition, set the process in order to generate the interruption mistakenly re-done, if the error can be solved then the process will take place as usual, if you do not feel the interruptions will tread the follow-up out of the process.
c. Exit from the process,’s blunder prepare mistaken view news from the monitor, the processor out of the process, this is the last action can not be helped if the process is wrong.

Follow-up interruptions, according to Peterson & Silberschatz:

Description:
1. Completed
The program implemented by the processor has finished so that the transfer of the control process to a new job / new command because the process is done by the processor has been completed.
2. Misrepresentation
If the error is displayed, and the control processor is the next in command.
3. Demand is not the tool of I / O
After the interruption was completed, the control processor returned to the original process, for example, periodic interruptions.
4. Demand from the tool I / O
After the interruption was completed, the control processor returned to the previous process, but sometimes the processor intervene in the working tools of I / O control of the process so that the original, does not take place immediately / waiting.
5. Completed from the instrument I / O
After the interruption was finished and finished signs note, the control processor returned to the original. Usually tool for I / O is not diikut campuri by the processor.

Catt:
1 & 2 does not restore the processor to process the terinterupsi, while
3,4,5 restore the processor to process the terinterupsi.

Step-by-step operating system at the time of the interruption:
1. hardware enter the program counter, dl.l.
to enter the stack in the census program
2. Hardware load (load) of the program counter of the new vector interrupsi
3. Procedure language assembled to save the contents of the register
4. Procedure language assembled set a new stack
5. Procedure C to mark the service is ready (ready)
6. Scheduler / scheduling process of determining which roads will be next
7. Procedure C back to the mode of language assembled
8. Procedure language assembled begin the process of being implemented.

Inter-process communication
(Inter Process Communinication / IPC):

  • Some of the process usually communicate with other processes.
  • For example in the shell pipe line: the output of the process must first be given to the process to two and so on.
  • In some operating systems, processes that often work together sharing (shared) storage media, a process which can read and write on the shared storage (main memory or files)

The problem - a problem in the IPC:

Race Condition:
A condition where two or more processes to access the shared memory / data at the same time, and the end result is not in accordance with the desired
Example COULD’VE Condition:

  • Print spooler
  • Example: a collection of data that will be in print.
  • Spooler directory
  • process A -> check of the input slot is empty (7) to print data and a stop
  • Interupsi … … …
  • process B -> the data will be put in print in the empty slot (7) and stop (the slot is empty the next 7 1 = 8)
  • : the processor to process other
  • process A -> resumed  data will be put in print in the slot (7), so to overwrite the data process B that is placed in the slot (7)
  • The process B will not be implemented, and will not be detected in error.

To avoid race conditions, it must be regulated so that the 2-critical process that has the same section does not enter the critical section at the same time.

Critical Section / critical section:
Part of the program to access a shared memory, which can cause race conditions.
4 condition to prevent race conditions:
a. 2 does not enter the critical process that simultaneously sectionnya / simultan
b. No assumptions are made regarding the speed and number of CPUs
c. No process that runs outside of its critical section that can block any other process
d. No process is waiting forever for the entry into its critical section.

Mutual Exclusion (MuTex) With Busy Waiting:
If a process is accessing the shared memory in critical sectionnya, no one can enter percent of the critical section (mutual Exclusion) and cause problems.

The types of mutual Exclusion:
1. This Interrupt / off interruptions
By the way shut incoming interruption during the process is in its critical section. This is sometimes quite useful to the kernel, but not for the user. And how starters are not too good for the CPU, the number of which more than one, where only about Interrupt disable the CPU are running the process and do not affect other CPU
2. Lock variables
Each process will be access to the critical section will need to check lock variable. 0 If the process can enter its critical section 1, and if the process must wait until the lock variable = 0. The disadvantage is 2 process can still enter the critical section is at the same time. During the one-check process to lock variable = 0, when will set 1 no interruptions to the process of implementing others who also want to enter the critical sectionnya, there will be race conditions.
3. Strict alternation
By observing variable turn to determine who will enter a critical section is not a good idea if the process slower than the other.
For example:
While (true)
(
While (turn! = 0) / * wait * /;
Critical_section ();
Turn = 1;
Noncritical_section ();
)
while (true)
(
While (turn! = 1) / * wait * /;
Critical_section ();
Turn = 0;
noncritical_section ();
)
4. Peterson’s Solution
The process will not be fulfilled until he is ready, if interested in [other] = TRUE, then the process will wait until FALSE.
The disadvantage: if the call enter_region it is almost the same time, which in turn is stored data that is written last.
For example:
# Include “prototype.h”
# Define FALSE 0
# Define TRUE 1
# Define N 2 / * number of processes * /

int turn;
int interested [N]; / * initial value is set = 0 (false) * /
void enter_region (int process) / * process = 1 or 0 * /

(
int other; / * number of other processes * /
other = 1 - process; / * other processes * /
interested [process] = TRUE; / * indicates interested * /
turn = process; / * set of flags * /
while (turn == process & interested [other] == TRUE)
)

void leave_region (int process) / * process is finished * /
(
interested [process] = FALSE; / * leave critical region * /
)
5. Test and Instruction Set Lock / TSL Instruction
With the help of hardware, determine who has the right to enter critical_region (section)
Example:
Enter_region :
Tsl reg,flag | copy flag ke reg dan set flag = 1
Cmp reg,#0 | apakah flag = 0
Jnz enter_region |jika <> 0 loop lagi
Ret |return ke caller, masuk critical region

Leave_region :
Mov flag, #0 |simpan 0 ke flag
Ret |return ke caller
This process must call at the right time.
The main weakness with everyone waiting is more and more CPU time and priority inversion problem.
6. Sleep and Wake Up
Mechanism: the process will be in the block / sleep (sleep) when critical_section can not enter it and will be developed (its people up) / readily when resources needed are available.
SLEEP: the system call to make the process of calling in blocks (blocked)
WAKE UP: call system that make the process ready to call menjasi
Example:
Procedure-Consumer Problem (bounded buffer)
Some share the process with the size of the buffer remain
If the buffer is full sleep Producer
If the buffer empty consumer sleep
If the buffer starts to empty its people up Producer
If the buffer filled up consumer its people
There is still a possibility the race Condition
7. Semaphore (Dijkstra, 1965)
To check, change and sleep 1 instructions
Change and its people up inseparability
Instruction is very useful for synchronization.
Can be implemented to solve Producer-consumer problem.
Mechanism its use:
- Integer variables to calculate the number of its people who saved up / delayed
- 0 valued when its people are not kept up, there is a positive value when its people up pending

Two kinds of operations against the semaphore:
DOWN(S) :
If S >= 0 then
S := S-1;
Else sleep (S)
End;

UP(S) :
If S <= 0 then wakeup(S) End;

Production is down and UP operations are Atomic (Atomic Action).
8. Event counters (Reed and Kanodia, 1979)
Three operations on the event counter (E):
1. Read (E): the return of current value of E
2. Advance (E): Atomically increment E by 1
3. Wait until E has a value of more or v
9. Monitors
- Higher levels Synchronization primitive.
- Collection procedures, variables and data structures that dipaket into one module or package.
- The process can call the procedure in the monitor, but can not directly access the data structure of the internal monitor.
10. Message Passing
Use 2 primitive:
1. send (destination, & message)
2. receive (source, & message)
Some issues on the message passing system: lost message; acknowledgement; domains; authentication; performance

Classic IPC problems:

  • The Dining Philosopher Problem

- 5 philosophers who work only eat and think
- Spaghetti available five plates and five chopsticks
- Needed to eat fruit bua chopsticks
- Its problem-how to write the program so that every philosopher can think and eat each other without having to wait?

  • The Readers and Writers Problem

- Model access to the database
- Many of the process to compete for reading and writing. For example: airline reservation.
- Some processes can be read at the same time
- If a process is writing, the process can not be any other database access
- The process to have a higher priority than the process of writing

There are 3 models in the process server:

  1. to create the thread can do paralelisme combined with the execution sekuensial and blocking system calls
  2. treads a single server, using the blocking system calls, but system performance is not good
  3. finite-state machine, with good performance parallelisme do, but using nonblocking calls, so difficult in the program

0 komentar:

Posting Komentar