SlideShare a Scribd company logo
2
Most read
6
Most read
7
Most read
What are thread libraries in operating system
A thread library provides the programmer with
an API for creating and managing threads.
There are two primary ways of implementing a
thread library.
The first is a user level library with no kernal
support.
All code and data structures for the library
exist in user space.
Invoking a function in the library results in
a Local function call in user sapce and not a
system call.
The second is a kernal-level library supported
directly by the operating system.
In this case,code and data structures for the
library exist in kernal sapce.
Invoking a function in the API for the library
typically results in a system call to the kernal.
There are three type of Thread libraries:
POSIX thread - Pthread
Win 32 thread - Windows
Java Thread
The main thread libraries:
POSIX thread- the library includes pthreads.h header file.
The POSIX thread provided as either a user level or a
kernal level library.
Win 32 library -is similar to pthread library.
To create s thread using the Win 32 library alwaya include
windows.h header file in the program.
The windows library is a kernal level library available on
windows system
JAVA thread - The java thread API allows threads to be
created and managed directly as JAVA programs.
Pthreads:
The POSIX standard defines the specification for
pthreads,not the implementation.
pThreads are available on Solaris,Linux,Unix,Mac
OSX,and via public domain shareware for Windows.
Global variables are share among all thread.
One thread can wait for the other to
rejoin before continuing.
pthreads begin execution in a specified
function,in this example the
runner()function.
pthread.h is the header file used in C
language
:
#inculde<pthread.h>
intpthread_create(pthread_t*thread_id,
const pthread_attr_t*attribute,
void*(*routine)(void*),void*arg);
The Windows thread:
The windows thread library is a kernal-level
library available on windows systems.
Many function similar to pthread.
The header file is windows.h
create_Thread()-to create thread.
Attributes are similar to pthread along
with,security,stack size,flag to indicate current
state.
if flag=0,then SUSPENDED
Java Thread:
The java virtual machine JVM runs on the top
of the host operating system.
In the Windows operating system,the java
threads are implemented using Pthread.
In LINUX and UNIX, the java thread is
implemented using Pthread library.
In a java program, there is at least one thread
of control.
there are two methode to creating a thread
in java program.
1. Thread class and override it’s run() method.
2. Define a class and implement a Runnable
interface to it,
the second method is the most common
method to be used.

More Related Content

What's hot (20)

PDF
Java Garbage Collection - How it works
Mindfire Solutions
 
PPSX
Multithreading in-java
aalipalh
 
PPTX
Deadlock Avoidance in Operating System
Mohammad Hafiz-Al-Masud
 
PDF
Deadlock
Mohd Arif
 
PPTX
contiguous memory allocation.pptx
Rajapriya82
 
PPT
Operating System-Threads-Galvin
Sonali Chauhan
 
PPTX
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
PPTX
Modules in Python Programming
sambitmandal
 
PPT
OS Process Synchronization, semaphore and Monitors
sgpraju
 
PPTX
Multithreading
WafaQKhan
 
PPTX
Principal Sources of Optimization in compiler design
LogsAk
 
PPTX
Linker and Loader
sonalikharade3
 
PPTX
Threads (operating System)
Prakhar Maurya
 
PPTX
Operating system 22 threading issues
Vaibhav Khanna
 
PDF
Python Advanced – Building on the foundation
Kevlin Henney
 
PPTX
Features of JAVA Programming Language.
Bhautik Jethva
 
PPT
Operating Systems - "Chapter 5 Process Synchronization"
Ra'Fat Al-Msie'deen
 
PPT
Java buzzwords
ramesh517
 
PPTX
Classpath
myrajendra
 
PDF
Semaphores
Mohd Arif
 
Java Garbage Collection - How it works
Mindfire Solutions
 
Multithreading in-java
aalipalh
 
Deadlock Avoidance in Operating System
Mohammad Hafiz-Al-Masud
 
Deadlock
Mohd Arif
 
contiguous memory allocation.pptx
Rajapriya82
 
Operating System-Threads-Galvin
Sonali Chauhan
 
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
Modules in Python Programming
sambitmandal
 
OS Process Synchronization, semaphore and Monitors
sgpraju
 
Multithreading
WafaQKhan
 
Principal Sources of Optimization in compiler design
LogsAk
 
Linker and Loader
sonalikharade3
 
Threads (operating System)
Prakhar Maurya
 
Operating system 22 threading issues
Vaibhav Khanna
 
Python Advanced – Building on the foundation
Kevlin Henney
 
Features of JAVA Programming Language.
Bhautik Jethva
 
Operating Systems - "Chapter 5 Process Synchronization"
Ra'Fat Al-Msie'deen
 
Java buzzwords
ramesh517
 
Classpath
myrajendra
 
Semaphores
Mohd Arif
 

Similar to What are thread libraries in operating system (20)

PPTX
Os
DeepaR42
 
PPT
Threads in Operating systems and concepts
RamaSubramanian79
 
PPT
Operating System Chapter 4 Multithreaded programming
guesta40f80
 
PPTX
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
babayaga920391
 
PDF
CH04.pdf
ImranKhan880955
 
PPT
Posix threads(asha)
Nagarajan
 
PPTX
PThreads Vs Win32 Threads
Robert Sayegh
 
PPT
Ch4 Threads
mayacendana
 
PPT
Operating System 4
tech2click
 
PPT
Operating System 4 1193308760782240 2
mona_hakmy
 
PDF
threads (1).pdfmjlkjfwjgliwiufuaiusyroayr
abhinandpk2405
 
PPT
multi-threading
Ezzat Gul
 
PPTX
P-Threads
Bharathwaj_v
 
PPT
Operating Systems Chapter 4444444444.ppt
atheer2058
 
PPT
Operating Systems - "Chapter 4: Multithreaded Programming"
Ra'Fat Al-Msie'deen
 
PDF
Basic Threads in Advanced operating system
sidrah29
 
PPT
Windows Kernel-
Parth Desai
 
PPTX
Java byte code & virtual machine
Laxman Puri
 
PPT
Slot02 concurrency1
Viên Mai
 
PPTX
Threads
Dr. SURBHI SAROHA
 
Threads in Operating systems and concepts
RamaSubramanian79
 
Operating System Chapter 4 Multithreaded programming
guesta40f80
 
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
babayaga920391
 
CH04.pdf
ImranKhan880955
 
Posix threads(asha)
Nagarajan
 
PThreads Vs Win32 Threads
Robert Sayegh
 
Ch4 Threads
mayacendana
 
Operating System 4
tech2click
 
Operating System 4 1193308760782240 2
mona_hakmy
 
threads (1).pdfmjlkjfwjgliwiufuaiusyroayr
abhinandpk2405
 
multi-threading
Ezzat Gul
 
P-Threads
Bharathwaj_v
 
Operating Systems Chapter 4444444444.ppt
atheer2058
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Ra'Fat Al-Msie'deen
 
Basic Threads in Advanced operating system
sidrah29
 
Windows Kernel-
Parth Desai
 
Java byte code & virtual machine
Laxman Puri
 
Slot02 concurrency1
Viên Mai
 
Ad

Recently uploaded (20)

PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PDF
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
Ad

What are thread libraries in operating system

  • 2. A thread library provides the programmer with an API for creating and managing threads. There are two primary ways of implementing a thread library.
  • 3. The first is a user level library with no kernal support. All code and data structures for the library exist in user space. Invoking a function in the library results in a Local function call in user sapce and not a system call.
  • 4. The second is a kernal-level library supported directly by the operating system. In this case,code and data structures for the library exist in kernal sapce. Invoking a function in the API for the library typically results in a system call to the kernal.
  • 5. There are three type of Thread libraries: POSIX thread - Pthread Win 32 thread - Windows Java Thread
  • 6. The main thread libraries: POSIX thread- the library includes pthreads.h header file. The POSIX thread provided as either a user level or a kernal level library. Win 32 library -is similar to pthread library. To create s thread using the Win 32 library alwaya include windows.h header file in the program. The windows library is a kernal level library available on windows system JAVA thread - The java thread API allows threads to be created and managed directly as JAVA programs.
  • 7. Pthreads: The POSIX standard defines the specification for pthreads,not the implementation. pThreads are available on Solaris,Linux,Unix,Mac OSX,and via public domain shareware for Windows. Global variables are share among all thread.
  • 8. One thread can wait for the other to rejoin before continuing. pthreads begin execution in a specified function,in this example the runner()function. pthread.h is the header file used in C language
  • 10. The Windows thread: The windows thread library is a kernal-level library available on windows systems. Many function similar to pthread. The header file is windows.h
  • 11. create_Thread()-to create thread. Attributes are similar to pthread along with,security,stack size,flag to indicate current state. if flag=0,then SUSPENDED
  • 12. Java Thread: The java virtual machine JVM runs on the top of the host operating system. In the Windows operating system,the java threads are implemented using Pthread. In LINUX and UNIX, the java thread is implemented using Pthread library.
  • 13. In a java program, there is at least one thread of control. there are two methode to creating a thread in java program.
  • 14. 1. Thread class and override it’s run() method. 2. Define a class and implement a Runnable interface to it, the second method is the most common method to be used.