---
title: "Multithreading"  
description: "Multithreading"  
author: "Anonymous User"  
published: 2018-06-15  
updated: 2018-06-15  
canonical: https://www.mindstick.com/forum/34514/multithreading  
category: "oops"  
tags: ["oops", "multiple threading", "python"]  
reading_time: 1 minute  

---

# Multithreading

What is the [concept](https://www.mindstick.com/blog/79/routing-concept-in-dot-net) of Multi threading. It would be better for [me if](https://answers.mindstick.com/qa/50259/tell-me-if-your-system-is-infected-by-a-virus-how-you-will-recover-the-data) [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) given answer in [Python](https://www.mindstick.com/articles/75378/simple-yet-useful-tips-when-using-python) with example .

## Replies

### Reply by Prakash nidhi Verma

Multi threading means multi processing and multitasking.You can speed your code up through multi-thread because python having multi threading packages. This happens very quickly so to the human eye it may seem like your threads are executing in parallel, but they are really just taking turns using the same CPU core.

```
import threading  def print_cube(n):
    print("Cube: {}".format(n*n*n))
def print_square(n):
    print("Square: {}".format(n*n))
 if __name__ == "__main__":
    // creating thread
    t1 = threading.Thread(target=print_square, args=(10,))
    t2 = threading.Thread(target=print_cube, args=(10,))
    t1.start() // starting the thread 1
    t2.start()
    t1.join() // exicute the thread 1
    t2.join()
    print("Done!")
```

You can understand this by this image :

![Multithreading](https://www.mindstick.com/mindstickforums/0d8a4be1-05f7-4e29-b0c6-99031243daec/images/ba9c38a7-d031-47d3-b507-b782209faea5.png)\

Happy Coding :)


---

Original Source: https://www.mindstick.com/forum/34514/multithreading

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
