SlideShare a Scribd company logo
1 of 6
ASSIGNMENT-01
Muaz nasir
Roll no-76
Bsse-a
What is the differences between threads and
processing in operating system?
Thread Processing
 Its means a segment of a process  Its means any program is in execution
 Thread takes less time to terminate  It takes more time to terminate
 It takes less time for creation  It takes more time for creation
 Thread is more efficient in terms of communication  The process is less efficient in terms of communication.
 A Thread is lightweight as each thread in a process shares code,
data, and resources
 The process is called the heavyweight process
 Thread switching does not require calling an operating system and
causes an interrupt to the kernel.
 Process switching uses an interface in an operating system.
 If a user-level thread is blocked, then all other user-level threads
are blocked.
 If one process is blocked then it will not affect the execution of
other processes
 Threads share data with each other.  The process does not share data with each other
 No system call is involved, it is created using APIs.  A system call is involved in it
 Thread has Parents’ PCB, its own Thread Control Block, and Stack
and common Address space.
 The process has its own Process Control Block, Stack, and
Address Space.
Briefly explain Multi-threading?
◦ Multithreading is the ability of a program or an operating system to enable more than one user
at a time without requiring multiple copies of the program running on the computer
◦ Multithreading is a CPU feature that allows two or more instruction threads to execute
independently while sharing the same process resources. A thread is a self-contained sequence
of instructions that can execute in parallel with other threads that are part of the same root
process.
◦ Multithreading allows multiple concurrent tasks can be performed within a single process. When
data scientists are training machine learning algorithms, a multithreaded approach to
programming can improve speed when compared to traditional parallel
multiprocessing programs.
How does Multithreading Work
◦ In programming, a thread maintains a list of information relevant to its execution, including the priority
schedule, exception handlers, a set of CPU registers, and stack state in the address space of its hosting
process.
◦ Parallel multiprocessing means the system is actually handling more than one thread at a given time.
Concurrent processing means that only one thread will be handled at a time, but the system will create
efficiencies by moving quickly between two or more threads.
◦ In addition, much of the parallel or concurrent processing is made available according to the vagaries of the
operating system. So in effect, to the human user, either parallel or concurrent process, or processes that are
mixed, are all experienced as parallelism in real-time.
◦ Different types of multithreading apply to various versions of operating systems and related controls that
have evolved in computing: for example, in pre-emptive multithreading, the context switch is controlled by
the operating system. Then there’s cooperative multithreading, in which context switching is controlled by the
thread. This could lead to problems, such as deadlocks if a thread is blocked waiting for a resource to
become free.
Basis for comparison Multiprocessing Multithreading
Basic Multiprocessing add CPUs to increase
computing power.
It creates multiple threads of a single process
to increase the computing power.
Execution Multiple processes are executed concurrently. Multiple threads of a single process are
executed concurrently.
What is the differences between multi-
threading and multi-tasking in operating
system?
Multi-tasking Multi-threading
 In multitasking, users are allowed to perform many tasks by CPU.  Many threads are created from a process through which computer
power is increased.
 Multitasking involves often CPU switching between the tasks  CPU switching is often involved between the threads.
 In multitasking, the processes share separate memory.  While in multithreading, processes are allocated the same memory.
 The multitasking component involves multiprocessing.  While the multithreading component does not involve
multiprocessing.
 In multitasking, the CPU is provided in order to execute many tasks
at a time.
 While in multithreading also, a CPU is provided in order to execute
many threads from a process at a time.
 In multitasking, processes don’t share the same resources, each
process is allocated separate resources.
 While in multithreading, each process shares the same resources
 Multitasking is slow compared to multithreading.  While multithreading is faster.
 In multitasking, termination of a process takes more time.  While in multithreading, termination of thread takes less time.
 Isolation and memory protection exist in multitasking.  Isolation and memory protection does not exist in multithreading.
 It helps in developing efficient programs  It helps in developing efficient operating systems.

More Related Content

Similar to Assignment-01.pptx

Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxPrudhvi668506
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESsuthi
 
Operating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdfOperating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdfJUSTSTYLISH3B2MOHALI
 
Multiprocessor Scheduling
Multiprocessor SchedulingMultiprocessor Scheduling
Multiprocessor SchedulingKhadija Saleem
 
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemProcess, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemLieYah Daliah
 
Process Management Operating Systems .pptx
Process Management        Operating Systems .pptxProcess Management        Operating Systems .pptx
Process Management Operating Systems .pptxSAIKRISHNADURVASULA2
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcbKanza batool
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptxNagaVarthini
 
Lecture 3- Threads (1).pptx
Lecture 3- Threads (1).pptxLecture 3- Threads (1).pptx
Lecture 3- Threads (1).pptxAmanuelmergia
 
Multivector and multiprocessor
Multivector and multiprocessorMultivector and multiprocessor
Multivector and multiprocessorKishan Panara
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreadingjehan1987
 

Similar to Assignment-01.pptx (20)

Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptx
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
 
Not Imp
Not ImpNot Imp
Not Imp
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
W-9.pptx
W-9.pptxW-9.pptx
W-9.pptx
 
Operating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdfOperating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdf
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Multiprocessor Scheduling
Multiprocessor SchedulingMultiprocessor Scheduling
Multiprocessor Scheduling
 
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemProcess, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
 
Epc 3.ppt
Epc 3.pptEpc 3.ppt
Epc 3.ppt
 
Process Management Operating Systems .pptx
Process Management        Operating Systems .pptxProcess Management        Operating Systems .pptx
Process Management Operating Systems .pptx
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
 
Lecture 3- Threads (1).pptx
Lecture 3- Threads (1).pptxLecture 3- Threads (1).pptx
Lecture 3- Threads (1).pptx
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Multivector and multiprocessor
Multivector and multiprocessorMultivector and multiprocessor
Multivector and multiprocessor
 
Os
OsOs
Os
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Threads
ThreadsThreads
Threads
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
 

More from HaiderZaman45

More from HaiderZaman45 (11)

lec#37.pptx
lec#37.pptxlec#37.pptx
lec#37.pptx
 
Haider Zaman.pptx
Haider Zaman.pptxHaider Zaman.pptx
Haider Zaman.pptx
 
BAHADUR SHAH ZAFAR.ppt
BAHADUR SHAH ZAFAR.pptBAHADUR SHAH ZAFAR.ppt
BAHADUR SHAH ZAFAR.ppt
 
lec#10,11.pptx
lec#10,11.pptxlec#10,11.pptx
lec#10,11.pptx
 
Perspectives in psychology.pptx
Perspectives in psychology.pptxPerspectives in psychology.pptx
Perspectives in psychology.pptx
 
lec#9.pptx
lec#9.pptxlec#9.pptx
lec#9.pptx
 
lec#2.pptx
lec#2.pptxlec#2.pptx
lec#2.pptx
 
Personality.pptx
Personality.pptxPersonality.pptx
Personality.pptx
 
INTRO TO PSY-1(2022).pptx
INTRO TO PSY-1(2022).pptxINTRO TO PSY-1(2022).pptx
INTRO TO PSY-1(2022).pptx
 
Presentation Styles and Difference.pptx
Presentation Styles and Difference.pptxPresentation Styles and Difference.pptx
Presentation Styles and Difference.pptx
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 

Recently uploaded

Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfPaper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfNainaShrivastava14
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxStephen Sitton
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfisabel213075
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming languageSmritiSharma901052
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 

Recently uploaded (20)

Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfPaper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptx
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdf
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming language
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 

Assignment-01.pptx

  • 2. What is the differences between threads and processing in operating system? Thread Processing  Its means a segment of a process  Its means any program is in execution  Thread takes less time to terminate  It takes more time to terminate  It takes less time for creation  It takes more time for creation  Thread is more efficient in terms of communication  The process is less efficient in terms of communication.  A Thread is lightweight as each thread in a process shares code, data, and resources  The process is called the heavyweight process  Thread switching does not require calling an operating system and causes an interrupt to the kernel.  Process switching uses an interface in an operating system.  If a user-level thread is blocked, then all other user-level threads are blocked.  If one process is blocked then it will not affect the execution of other processes  Threads share data with each other.  The process does not share data with each other  No system call is involved, it is created using APIs.  A system call is involved in it  Thread has Parents’ PCB, its own Thread Control Block, and Stack and common Address space.  The process has its own Process Control Block, Stack, and Address Space.
  • 3. Briefly explain Multi-threading? ◦ Multithreading is the ability of a program or an operating system to enable more than one user at a time without requiring multiple copies of the program running on the computer ◦ Multithreading is a CPU feature that allows two or more instruction threads to execute independently while sharing the same process resources. A thread is a self-contained sequence of instructions that can execute in parallel with other threads that are part of the same root process. ◦ Multithreading allows multiple concurrent tasks can be performed within a single process. When data scientists are training machine learning algorithms, a multithreaded approach to programming can improve speed when compared to traditional parallel multiprocessing programs.
  • 4. How does Multithreading Work ◦ In programming, a thread maintains a list of information relevant to its execution, including the priority schedule, exception handlers, a set of CPU registers, and stack state in the address space of its hosting process. ◦ Parallel multiprocessing means the system is actually handling more than one thread at a given time. Concurrent processing means that only one thread will be handled at a time, but the system will create efficiencies by moving quickly between two or more threads. ◦ In addition, much of the parallel or concurrent processing is made available according to the vagaries of the operating system. So in effect, to the human user, either parallel or concurrent process, or processes that are mixed, are all experienced as parallelism in real-time. ◦ Different types of multithreading apply to various versions of operating systems and related controls that have evolved in computing: for example, in pre-emptive multithreading, the context switch is controlled by the operating system. Then there’s cooperative multithreading, in which context switching is controlled by the thread. This could lead to problems, such as deadlocks if a thread is blocked waiting for a resource to become free.
  • 5. Basis for comparison Multiprocessing Multithreading Basic Multiprocessing add CPUs to increase computing power. It creates multiple threads of a single process to increase the computing power. Execution Multiple processes are executed concurrently. Multiple threads of a single process are executed concurrently.
  • 6. What is the differences between multi- threading and multi-tasking in operating system? Multi-tasking Multi-threading  In multitasking, users are allowed to perform many tasks by CPU.  Many threads are created from a process through which computer power is increased.  Multitasking involves often CPU switching between the tasks  CPU switching is often involved between the threads.  In multitasking, the processes share separate memory.  While in multithreading, processes are allocated the same memory.  The multitasking component involves multiprocessing.  While the multithreading component does not involve multiprocessing.  In multitasking, the CPU is provided in order to execute many tasks at a time.  While in multithreading also, a CPU is provided in order to execute many threads from a process at a time.  In multitasking, processes don’t share the same resources, each process is allocated separate resources.  While in multithreading, each process shares the same resources  Multitasking is slow compared to multithreading.  While multithreading is faster.  In multitasking, termination of a process takes more time.  While in multithreading, termination of thread takes less time.  Isolation and memory protection exist in multitasking.  Isolation and memory protection does not exist in multithreading.  It helps in developing efficient programs  It helps in developing efficient operating systems.