The performance of the single-threaded process and the multi-threaded process will be the same in python and this is because of GIL in python.
It's maybe worth stressing here that multi-threading can make execution a lot faster. It requires that threads release the GIL when e.g. waiting on I/O. Well-written libraries like NumPy release the GIL whenever possible, allowing multiple computations to proceed in parallel.
Threading runs on a single processor and therefore only runs one at a time.
Single Python process can use multiple cores at the same time in parallel. Try starting e.g. two threads each making a numerical computation with NumPy and you may see the process CPU usage going up to 200 %.
Thanks for the article!
It's maybe worth stressing here that multi-threading can make execution a lot faster. It requires that threads release the GIL when e.g. waiting on I/O. Well-written libraries like NumPy release the GIL whenever possible, allowing multiple computations to proceed in parallel.
Single Python process can use multiple cores at the same time in parallel. Try starting e.g. two threads each making a numerical computation with NumPy and you may see the process CPU usage going up to 200 %.
yes, it can be taken into consideration although writing on such advanced topics was quite challenging for me, thanks for your feedback noted it.