43. Python multithreading | run multiple threads in single core CPU | Rajiv

preview_player
Показать описание
Threading is just one of the many ways concurrent programs can be built. In this article, we will take a look at threading and a couple of other strategies for building concurrent programs in Python, as well as discuss how each is suitable in different scenarios.
Multithreading utilize CPU better way, code execution will be faster.

Multithreading is defined as the ability of a processor to execute multiple threads concurrently. In a simple, single-core CPU, it is achieved using frequent switching between threads. This is termed context switching. In context switching, the state of a thread is saved and the state of another thread is loaded whenever any interrupt (due to I/O or manually set) takes place. Context switching takes place so frequently that all the threads appear to be running parallelly (this is termed multitasking).
Рекомендации по теме
join shbcf.ru