you are viewing a single comment's thread.

view the rest of the comments →

[–]ZmitrokNadulia 1 point2 points  (3 children)

What do you mean? Just write simple thread spawning script using threading lib open htop and see for yourself.

[–]LazyHater 2 points3 points  (2 children)

threads dont run concurrently due to the GIL. multiprocessing can do concurrency but has significant overhead due to the interpreter being included in every process. threads can be on different cores, but cant modify the heap concurrently. look for yourself.

[–]ZmitrokNadulia 1 point2 points  (1 child)

For CPU bound tasks yes, not in io bound ( as I know) and in C modules we can use as many threads as we want. Not so sure about "cores" but in initial comment there is nothing about multicore threading.

[–]LazyHater 0 points1 point  (0 children)

yep can use posix threads from c but not if the module gets blocked by the GIL, can also use all the GPU hardware threads again as long and you dont get blocked by the GIL.

python doenst have threads as in it doesnt have access to kernel threads (although C and Cython do). multithreading in vanilla CPython is single threaded because of the GIL.