Search code examples
pythonmultithreadingraspberry-pipython-multithreading

Question about the threading module and Raspberry Pi


I'd like to ask a question regarding the threading module in the context of my Raspberry Pi project.

Does spawning new threads in the script actually use a different hardware thread?

And if so, is there a limit of threads I can make in the said script? (considering there's a limited amount of physical threads/cores onboard)


Solution

  • As you can read mora on this article, no.

    Unfortunately the internals of the main Python interpreter, CPython, negate the possibility of true multi-threading due to a process known as the Global Interpreter Lock (GIL).