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

Time:05-01

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?

CodePudding user response:

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

  • Related