-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Parallel Programming with Python
By :
Threads are different execution lines in a process. Let us picture a program as if it was a hive, and there is a process of collecting pollen inside this hive. This collection process is carried out by several worker bees who work simultaneously in order to solve the problem of lack of pollen. The worker bees play the role of threads, acting inside a process and sharing resources to perform their tasks.
Threads belong to the same process and share the same memory space. Hence, the developer's task is to control and access these areas of memory.
Some advantages and disadvantages have to be taken into account when deciding on the use of threads, and it depends on the language and operating system used to implement a solution.
The advantages of using threads are as follows:
Change the font size
Change margin width
Change background colour