Suche senden
Hochladen
Synchronization
•
2 gefällt mir
•
9,190 views
Anil Kumar Pugalia
Folgen
Technologie
Melden
Teilen
Melden
Teilen
1 von 21
Empfohlen
Threads
Threads
Anil Kumar Pugalia
Embedded Software Design
Embedded Software Design
Anil Kumar Pugalia
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
Block Drivers
Block Drivers
Anil Kumar Pugalia
Real Time Systems
Real Time Systems
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Embedded Storage Management
Embedded Storage Management
Anil Kumar Pugalia
Linux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
Empfohlen
Threads
Threads
Anil Kumar Pugalia
Embedded Software Design
Embedded Software Design
Anil Kumar Pugalia
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
Block Drivers
Block Drivers
Anil Kumar Pugalia
Real Time Systems
Real Time Systems
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Embedded Storage Management
Embedded Storage Management
Anil Kumar Pugalia
Linux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
Linux File System
Linux File System
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Signals
Signals
Anil Kumar Pugalia
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
Linux Memory Management
Linux Memory Management
Anil Kumar Pugalia
Kernel Programming
Kernel Programming
Anil Kumar Pugalia
Linux Kernel Overview
Linux Kernel Overview
Anil Kumar Pugalia
Introduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
Timers
Timers
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Architecture Porting
Architecture Porting
Anil Kumar Pugalia
Processes
Processes
Anil Kumar Pugalia
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
Character Drivers
Character Drivers
Anil Kumar Pugalia
Video Drivers
Video Drivers
Anil Kumar Pugalia
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Toolchain
Toolchain
Anil Kumar Pugalia
PCI Drivers
PCI Drivers
Anil Kumar Pugalia
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Embedded C
Embedded C
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Weitere ähnliche Inhalte
Was ist angesagt?
Linux File System
Linux File System
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Signals
Signals
Anil Kumar Pugalia
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
Linux Memory Management
Linux Memory Management
Anil Kumar Pugalia
Kernel Programming
Kernel Programming
Anil Kumar Pugalia
Linux Kernel Overview
Linux Kernel Overview
Anil Kumar Pugalia
Introduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
Timers
Timers
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Architecture Porting
Architecture Porting
Anil Kumar Pugalia
Processes
Processes
Anil Kumar Pugalia
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
Character Drivers
Character Drivers
Anil Kumar Pugalia
Video Drivers
Video Drivers
Anil Kumar Pugalia
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Toolchain
Toolchain
Anil Kumar Pugalia
PCI Drivers
PCI Drivers
Anil Kumar Pugalia
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Was ist angesagt?
(20)
Linux File System
Linux File System
System Calls
System Calls
Signals
Signals
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Linux Memory Management
Linux Memory Management
Kernel Programming
Kernel Programming
Linux Kernel Overview
Linux Kernel Overview
Introduction to Linux Drivers
Introduction to Linux Drivers
Timers
Timers
Introduction to Linux
Introduction to Linux
Architecture Porting
Architecture Porting
Processes
Processes
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
Character Drivers
Character Drivers
Video Drivers
Video Drivers
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Toolchain
Toolchain
PCI Drivers
PCI Drivers
I2C Drivers
I2C Drivers
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Andere mochten auch
Embedded C
Embedded C
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Inter Process Communication
Inter Process Communication
Anil Kumar Pugalia
References
References
Anil Kumar Pugalia
Interrupts
Interrupts
Anil Kumar Pugalia
Bootloaders
Bootloaders
Anil Kumar Pugalia
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Board Bringup
Board Bringup
Anil Kumar Pugalia
Functional Programming with LISP
Functional Programming with LISP
Anil Kumar Pugalia
gcc and friends
gcc and friends
Anil Kumar Pugalia
Linux Porting
Linux Porting
Anil Kumar Pugalia
File Systems
File Systems
Anil Kumar Pugalia
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
Andere mochten auch
(14)
Embedded C
Embedded C
Network Drivers
Network Drivers
Inter Process Communication
Inter Process Communication
References
References
Interrupts
Interrupts
Bootloaders
Bootloaders
Shell Scripting
Shell Scripting
Board Bringup
Board Bringup
Functional Programming with LISP
Functional Programming with LISP
gcc and friends
gcc and friends
Linux Porting
Linux Porting
File Systems
File Systems
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
Ähnlich wie Synchronization
Cs 704 d set2
Cs 704 d set2
Debasis Das
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Semihalf
Linux scheduler
Linux scheduler
Liran Ben Haim
Data Democratization at Nubank
Data Democratization at Nubank
Databricks
Interrupts
Interrupts
محمدعبد الحى
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
CODE BLUE
A close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issues
Riyaj Shamsudeen
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Anne Nicolas
RTOS implementation
RTOS implementation
Rajan Kumar
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
FastBit Embedded Brain Academy
MICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdf
KarthiA15
Using Machine Learning to Debug Oracle RAC Issues
Using Machine Learning to Debug Oracle RAC Issues
Anil Nair
Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Wood...
Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Wood...
Anne Nicolas
Speed Up Synchronization Locks: How and Why?
Speed Up Synchronization Locks: How and Why?
psteinb
How to be a smart contract engineer
How to be a smart contract engineer
Oded Noam
Jon Schneider at SpringOne Platform 2017
Jon Schneider at SpringOne Platform 2017
VMware Tanzu
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
Felipe Prado
Writing more complex models (continued)
Writing more complex models (continued)
Mohamed Samy
Real Time Systems & RTOS
Real Time Systems & RTOS
Vishwa Mohan
Shytikov on NTLM Authentication
Shytikov on NTLM Authentication
shytikov
Ähnlich wie Synchronization
(20)
Cs 704 d set2
Cs 704 d set2
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Linux scheduler
Linux scheduler
Data Democratization at Nubank
Data Democratization at Nubank
Interrupts
Interrupts
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
A close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issues
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
RTOS implementation
RTOS implementation
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
MICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdf
Using Machine Learning to Debug Oracle RAC Issues
Using Machine Learning to Debug Oracle RAC Issues
Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Wood...
Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Wood...
Speed Up Synchronization Locks: How and Why?
Speed Up Synchronization Locks: How and Why?
How to be a smart contract engineer
How to be a smart contract engineer
Jon Schneider at SpringOne Platform 2017
Jon Schneider at SpringOne Platform 2017
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
Writing more complex models (continued)
Writing more complex models (continued)
Real Time Systems & RTOS
Real Time Systems & RTOS
Shytikov on NTLM Authentication
Shytikov on NTLM Authentication
Mehr von Anil Kumar Pugalia
File System Modules
File System Modules
Anil Kumar Pugalia
Processes
Processes
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Playing with R L C Circuits
Playing with R L C Circuits
Anil Kumar Pugalia
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
Power of vi
Power of vi
Anil Kumar Pugalia
"make" system
"make" system
Anil Kumar Pugalia
Hardware Design for Software Hackers
Hardware Design for Software Hackers
Anil Kumar Pugalia
RPM Building
RPM Building
Anil Kumar Pugalia
Mehr von Anil Kumar Pugalia
(9)
File System Modules
File System Modules
Processes
Processes
System Calls
System Calls
Playing with R L C Circuits
Playing with R L C Circuits
Audio Drivers
Audio Drivers
Power of vi
Power of vi
"make" system
"make" system
Hardware Design for Software Hackers
Hardware Design for Software Hackers
RPM Building
RPM Building
Kürzlich hochgeladen
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
UiPathCommunity
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
Raghuram Pandurangan
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
Lonnie McRorey
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
LoriGlavin3
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
BookNet Canada
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Alex Barbosa Coqueiro
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
LoriGlavin3
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
DianaGray10
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
HarshalMandlekar2
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
Nicole Novielli
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
LoriGlavin3
Training state-of-the-art general text embedding
Training state-of-the-art general text embedding
Zilliz
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
LoriGlavin3
Kürzlich hochgeladen
(20)
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Training state-of-the-art general text embedding
Training state-of-the-art general text embedding
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Synchronization
1.
© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Synchronization
2.
2© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? Thread Synchronization Mechanisms Mutex Conditional Variables Read/Write Locks Spin Locks Barriers Semaphores Priority Inversion & its Solutions Understanding a Deadlock Inter Thread Communication
3.
3© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Recall Thread Management Creation, Termination, Joining, Cleanup Thread-specific Data What about the other data? Shared: By virtue of existence Communication: Inherent No ITC mechanisms required Where is the catch? Concurrency Issues & Race Conditions
4.
4© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Solutions to Race Conditions Concurrency issues exist within a process Do not need kernel resources to solve them Just some internal synchronization & access protection mechanisms Implemented at pthreads library level Mutex → Critical Sections Condition Variables → Atomic Checks & Actions Read/Write Locks → Readers & Writers Resources Spin Locks → Critical Sections but without yielding Barriers → Serializing Execution Sempahores → Resource Usage
5.
5© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Mutual Exclusion Type: pthread_mutex_t APIs int pthread_mutex_init(&mutex, &attr); int pthread_mutex_destroy(&mutex); int pthread_mutex_lock(&mutex); int pthread_mutex_unlock(&mutex); int pthread_mutex_trylock(&mutex); Macro PTHREAD_MUTEX_INITIALIZER
6.
6© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Priority Inversion Mutex Task H Task M Task L Priority Inversion Time
7.
7© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Priority Inheritance Mutex Priority H Priority L Time Priority M
8.
8© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Mutual Exclusion Attributes Type: pthread_mutexattr_t APIs pthread_mutexattr_init(&attr); pthread_mutexattr_destroy(&attr); pthread_mutexattr_settype(&attr, type); PTHREAD_MUTEX_RECURSIVE / NORMAL / ERRORCHECK pthread_mutexattr_setpshared(&attr, pshared); PTHREAD_PROCESS_SHARED / PRIVATE pthread_mutexattr_setprotocol(&attr, protocol); (Only for RT) PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT pthread_mutexattr_setprioceiling(&attr, proioceiling); (Only for RT) Try out: thread_mutex_attr.c, thread_mutex_error.c
9.
9© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Deadlock Set of entities waiting for each other Four necessary & sufficient conditions Mutual Exclusion Hold & Wait Non-Preemptive Circular Wait Have a look @ thread_deadlock.c
10.
10© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Dealing with Deadlock The Ostrich Approach Deadlock Detection & Recovery Deadlock Algorithm: Current Resource Availability → Possible Allocation Sequences Iterative Recovery Algorithm: O(n2) Deadlock Avoidance Banker's Algorithm Deadlock Prevention Eliminate one of the four conditions
11.
11© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Condition Variables Type: pthread_cond_t APIs int pthread_cond_init(&cond, &attr); int pthread_cond_destroy(&cond); int pthread_cond_wait(&cond, &mutex); int pthread_cond_signal(&cond); int pthread_cond_broadcast(&cond); Macro PTHREAD_COND_INITIALIZER
12.
12© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Condition Variable Attributes Type: pthread_condattr_t APIs pthread_condattr_init(&attr); pthread_condattr_destroy(&attr); pthread_condattr_setpshared(&attr, pshared); PTHREAD_PROCESS_SHARED / PRIVATE Try out: thread_cond.c
13.
13© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Read / Write Locks Type: pthread_rwlock_t APIs int pthread_rwlock_init(&rwlock, &attr); int pthread_rwlock_destroy(&rwlock); int pthread_rwlock_rdlock(&rwlock); int pthread_rwlock_tryrdlock(&rwlock); int pthread_rwlock_wrlock(&rwlock); int pthread_rwlock_trywrlock(&rwlock); int pthread_rwlock_unlock(&rwlock); Macro PTHREAD_RWLOCK_INITIALIZER
14.
14© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Read / Write Lock Attributes Type: pthread_rwlockattr_t APIs pthread_rwlockattr_init(&attr); pthread_rwlockattr_destroy(&attr); pthread_rwlockattr_setpshared(&attr, pshared); PTHREAD_PROCESS_SHARED / PRIVATE pthread_rwlockattr_setkind_np(&attr, kind); PTHREAD_RWLOCK_PREFER_READER_NP / WRITER_NP / WRITER_NONRECURSIVE_NP Try out: thread_rwlock.c
15.
15© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Spin Locks Type: pthread_spinlock_t APIs int pthread_spin_init(&spin, pshared); int pthread_spin_destroy(&spin); int pthread_spin_lock(&spin); int pthread_spin_trylock(&spin); int pthread_spin_unlock(&spin); Try out: thread_spinlock.c
16.
16© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Barriers & its Attributes Type: pthread_barrier_t APIs int pthread_barrier_init(&barrier, &attr, cnt); int pthread_barrier_destroy(&barrier); int pthread_barrier_wait(&barrier); Attribute Type: pthread_barrierattr_t Attribute APIs pthread_barrierattr_init(&attr); pthread_barrierattr_destroy(&attr); pthread_barrierattr_setpshared(&attr, pshared); PTHREAD_PROCESS_SHARED / PRIVATE Try out: thread_barrier.c
17.
17© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Semaphores Type: sem_t APIs int sem_init(sem_t *sem, int pshared, unsigned int value); int sem_destroy(sem_t *sem); int sem_post(sem_t *sem); int sem_wait(sem_t *sem); int sem_trywait(sem_t *sem); Try out: thread_sem.c
18.
18© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Exchange Offer Thread synchronizing mechanisms Can be used for same ancestor processes by setting there pshared attribute to non-zero Example: Semaphores for Processes Similarly, IPC mechanisms Can be used by threads as well Let's see some examples
19.
19© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Inter Thread Communication Signals in Threads Pipe for Threads Memory Map Sharing for Threads Examples thread_kill.c thread_ipc.c thread_ipc2.c
20.
20© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? Thread Synchronization Mechanisms Mutex Conditional Variables Read/Write Locks Spin Locks Barriers Semaphores Priority Inversion & its Solutions Understanding a Deadlock Inter Thread Communication
21.
21© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?