Threading vs. multiprocessing in Python
Вставка
- Опубліковано 7 вер 2024
- With Python 3.13 looking to change the world with regards to multi-core parallelism, I thought it would be good to take a look at what we have right here, right now!
Oh, and pitch them against each other for a laugh.
-
If you enjoy my content, consider supporting me on Patreon or becoming a member!
patreon.carber...
join.carberra.xyz
If you need help with anything, feel free to join the Discord server:
discord.carber...
I get a lot of people asking, so here's my Visual Studio Code setup!
• My Visual Studio Code ...
-
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto
Great! Im' happy to see that all thoses cores can be used in python!
Would be interested to see how Mojo handles threading and multi-core parallelism as it doesn't have GIL.
Probably a lot better 😅 Though Python is looking at starting to ditch the GIL from 3.13, so would be interesting to see that too!
@@Carberra From what I heard those Python boffins are going to make 2 versions of the compiler, one with GIL, another one without. It'd also be good if Python gets a JIT as well in 3.13 as well.
That's correct yeah. Funny you should say that, 3.13 already has a JIT! Things aren't fully optimised to work with it yet, but apparently it's already have an affect on performance in some areas.
I made a video about the GIL if you want to learn more: ua-cam.com/video/Wy4sI0zFXsU/v-deo.html
@@Carberra Fabulous ! I can't wait to get my mitts onto roadtesting 3.13 when it's properly released this Oct. I hope it will be as fast as Julia. I will check out your GIL tutorial. Ta muchly !
Nice video idea - like the comparison
3:06 - i see 3.11 standing there and not 3.12
9:37 do you really use multiple cores, it is processes which are multiple - but for sure the processes started will use your 10 core cpu optimal, but don't forget that the main program uses also on core, so better use 9 instead of 10
Thanks!
Yeah I was reading what VS Code was telling me the interpreter was. I was technically coding in 3.12 but running in 3.11 😆
Yeah you're probably right on setting it to n_cores - 1.
what extension are you using to get those splint window shortcuts in vscode?