JOIN ME
—————
YouTube 🎬 [ Ссылка ]
Patreon 🚀 [ Ссылка ]
COMPLETE PLAYLIST
————————————
C++ Tutorial For Beginners: [ Ссылка ]
STL (Standard Template Library): [ Ссылка ]
ThreadIng In C++: [ Ссылка ]
Data Structures: [ Ссылка ]
Algorithms: [ Ссылка ]
Design Patterns: [ Ссылка ]
Smart Pointers: [ Ссылка ]
C++14: [ Ссылка ]
C++17: [ Ссылка ]
C++ All Type Casts: [ Ссылка ]
INTERVIEW PLAYLIST
————————————
C++ Interview Q&A: [ Ссылка ]
C++ Interview Q&A For Experienced: [ Ссылка ]
Linked List Interview Questions: [ Ссылка ]
BST Interview Questions: [ Ссылка ]
Array Interview Questions: [ Ссылка ]
String Interview Questions: [ Ссылка ]
Bit Manipulation Questions: [ Ссылка ]
Binary Tree Interview Question: [ Ссылка ]
Sorting Algorithms: [ Ссылка ]
C++ MCQ: [ Ссылка ]
C MCQ: [ Ссылка ]
C Interview Questions: [ Ссылка ]
QUICK SHORT VIDEOS
————————————-
C++ Short : [ Ссылка ]
C Short : [ Ссылка ]-
In this video we will learn that what is the difference between thread sleep and thread wait.
What Is SLEEP :
0. “I’m done with my time-slice, and please don’t give me another one for at least n milliseconds.” The OS doesn’t even try to schedule the sleeping thread until requested time has passed.
1. It will keep the lock and sleep.
2. Sleep is directly to thread, it is a thread function.
What Is WAIT :
0. “I’m done with my time-slice. Don’t give me another time-slice until someone calls notify().” As with sleep(), the OS won’t even try to schedule your task unless someone calls notify() (or one of a few other wakeup scenarios occurs).
1. It releases the lock and wait.
2. Wait is on condition variable, it is like there is a condition variable in a thread and wait is applied to that CV but it ends up putting thread in waiting state.
#programming #softwareengineering #thread #cpp #threading
Sleep VS Wait In Threading
Теги
programmingcodingwait on threadsleep on threadsleep or waitthread waitingthreading sleepingwhat is waiting in threadingwhat is sleeping in threadingthread waitthread sleepwait c++sleep c++threading in c++thread wait c++thread sleep c++c programmingc++ programmingthreadthreadingsleepwaitoperating system