Category: 1. Python Concurrency
-
Python Threading
Summary: in this tutorial, you’ll learn how to use the Python threading module to develop multi-threaded applications. Single-threaded applications Let’s start with a simple program: How it works. First, import the sleep() and perf_counter() functions from the time module: Second, define a function that takes one second to complete: Third, get the value of the performance counter by calling the perf_counter() function: Fourth, call the task() function…
-
What’s are the Differences between Processes and Threads
Summary: in this tutorial, you’ll learn about the processes and threads, and more importantly, the main differences between them. Introduction to processes and threads Suppose that you have a simple Python program: Computers don’t understand Python. They only understand machine code, which is a set of instructions containing zero and one. Therefore, you need a…