Jojoshuajosh Journal

Just another Binusian blog site

Archive for October, 2015

SisOp Session 7 & Session 8

without comments

*Session 7

Threads


Thread

  • State eksekusi (running, ready, terminated)
  • Isi thread disimpan ketika tidak berjalan
  • Memiliki tumpukan eksekusi
  • Beberapa penyimpanan per thread static dipakai untuk variabel lokal
  • Akses ke memori dan resource terjadi saat proses
  • Theads mengijinkan beberapa eksekusi terjadi dilingkungan proses yang sama
  • Light weight process :threads punya beberapa sifat dari proses
  • Multi threading : mengijinkan beberaa threads diproses yang sama

Thread Model

sisop 18

sisop 19

* kolom pertama berisi beberapa item yang dibagi oleh semua thread dalam sebuah proses.

* kolom kedua berisi beberapa item private ke setiap thread.

 sisop 20

*setiap proses memiliki stack tersendiri

sisop 21

Benefit of thread

  • Membutuhkan waktu yang sedikit untuk membuat thread baru ketimbang sebuah proses
  • Membutuhkan waktu yang sedikit untuk menterminate sebuah thread dibanding sebuah proses
  • Membutuhkan waktu yang sedikit untuk menukar dua thread diproses yag sama
  • Karena memiliki proses yang sama (memori dan files), thread bisa saling berkomunikasi satu sama lain tanpa menggunakan kernel

        sisop 22

*contoh koding menggunakan thread Read the rest of this entry »

Written by jojoshuajosh

October 27th, 2015 at 8:56 pm

Posted in Uncategorized

SisOp Session 3 & Session 4

without comments

*Session 3

Process


Process vs Program

Program : Berisi instruksi – instruksi untuk melakukan perintah atau pekerjaan

Process : Eksekusi dari program

Process Characteristic

  • Identifier : Kode unik yang digunakan untuk membedakannya dari proses lain
  • State : Menentukan kondisi dari program (apakah program itu sedang Running / Suspended / Terminated)
  • Priority : Menentukan level prioritas saat eksekusi dilakukan
  • Program Counter : Menyimpan alamat instruksi selanjutnya
  • Memory pointers : Menunjukkan posisi memori
  • Context data : Data yang disimpan saat eksekusi
  • I/O status confirmation : Menunjukkan informasi status I/O
  • Accounting information : menunjukkan informasi mengenai perhitungan numerik mengenai proses yang terjadi di komputer.

Process Creation

  • Membuat ID Unik
  • Mengalokasi memori untuk proses
  • Menginisiasi Process Control Block (PCB)
  • Menyiapkan antrian program
  • Membuat expand data

Process Termination

  • Normal completion
  • Time limit exceeded
  • Memory unavailable
  • Bounds violation
  • Protection error
  • Arithmetic error
  • Time overrun
  • I/O failure
  • Invalid instruction
  • Privileged instruction
  • Data misuse
  • Operating system intervention
  • Parent terminates so child processes terminate
  • Parent request

Process Table

  • Merupakan tempat proses terjadi
  • Atribut dari process table

– Process ID

– Process state

– Location in memory

Process Location

  • Berisi sekumpulan program yang akan dieksekusi
  • Program Control Block (PCB)
  • Process image

Read the rest of this entry »

Written by jojoshuajosh

October 6th, 2015 at 7:42 pm

Posted in Uncategorized