Describe how multithreading is achieved in python?



Describe how multithreading is achieved in python?..

Answer / Bhup Singh

Multithreading in Python can be achieved using the `threading` module. A thread is a lightweight process that shares the same memory space as its parent program. To create and start a new thread, you use the `Thread()` constructor, passing a callable (function or method) as an argument to the constructor. Then, you call the `start()` method on the newly created thread object. Python's Global Interpreter Lock (GIL) limits multithreading performance for CPU-bound tasks in CPython, but it can still be useful for I/O-bound and concurrent workloads.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Will the do-while loop work if you don’t end it with a semicolon?

1 Answers  


What does while true do in python?

1 Answers  


Does python has classes?

1 Answers  


What is pip and pip freeze commands will do?

1 Answers  


Name some of the important modules that are available in python.

1 Answers  


What is %s in python?

1 Answers  


How do you split a string in python?

1 Answers  


If you are ever stuck in an infinite loop, how will you break out of it?

1 Answers  


What does __name__=='__main__' in python mean?

1 Answers  


What do you understand by deque in python?

1 Answers  


What is time sleep in python?

1 Answers  


What is try block?

1 Answers  


Categories