Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Do I use a whole processor thread when I start a thread in Python?

I just discovered a module called threading in Python, and it opened a whole world of doors for me. I’m able to do a lot of things I couldn’t do before.
But now that I think about it am I limited by my processor threads? I’m using an i7-8700k (6 Cores, 12 Threads) Like every time a start threading a function with Thread(target=func).start() am I using 1 whole "physical" thread? I’d be a little scared to run a program that uses more than the available threads. Will it be a problem?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

No, you are not using a full thread don’t worry about that.

You could check this SO topic for more info: How do threads work in Python, and what are common Python-threading specific pitfalls?

Another library that might interest you is asyncio: https://docs.python.org/3/library/asyncio.html

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading