Processes


Single vs Multithreaded process



Download 0.57 Mb.
Page3/7
Date02.08.2022
Size0.57 Mb.
#59263
1   2   3   4   5   6   7
Lecture 2 Processes
Lecture 1 Introduction

Single vs Multithreaded process

  • Code – Contains instruction
  • Data – holds global variable
  • Files – opening and closing files
  • Register – contain information about CPU state
  • Stack – parameters, local varibles, functions

Types of Threads

  • User Threads
    • Thread creation, scheduling, management are done by a thread library at the user level
    • If a user thread performs a system call which blocks it, all the other threads in that process are also automatically blocked, whole process is blocked
  • Advantages
    • Thread switching does not require kernel mode privileges
    • User level threads can run on any operating system
    • User level threads are fast to create and manage
    • Is generic and can run on any Os
  • Disadvantages

Types of Threads cont...

  • Kernel threads
  • Advantages
    • Kernel can simultaneously schedule multiple threads from the same process on multiple processes.
    • If one thread in a process is blocked, the Kernel can schedule another thread of the same process.
    • Kernel routines can be multithreaded
  • Disadvantages
    • Kernel threads are generally slower to create and manage than the user threads.
    • Is specific to the operating system

Multithreading models

  • Categories of threading implementation
  • One to One
    • One of the earliest implementation of true multithreading
    • One user thread to one kernel thread
    • Each user user-level thread created by the application is known to the kernel and all threads can access the kernel at the same time.
    • Disadvantage of this model is that creating user thread requires the corresponding Kernel thread.
    • OS/2, windows NT and windows 2000 use one to one model

Download 0.57 Mb.

Share with your friends:
1   2   3   4   5   6   7




The database is protected by copyright ©ininet.org 2024
send message

    Main page