this video helped me reduce lag in my applications that have over 250,000 objects
@anonjr75855 жыл бұрын
nice video man, i was unable to understand at beginning when i looked at the code, but then i understood evrything after your illustrations.
@TechWithTim5 жыл бұрын
Awesome! Glad to hear that :)
@elishashmalo37315 жыл бұрын
PLEASE DO MORE PYTHON PROBLEMS AND SOLUTIONS!! Like one a week?
@TechWithTim5 жыл бұрын
Possibly!
@willgiovanni20413 жыл бұрын
Pro trick: you can watch series at flixzone. Me and my gf have been using them for watching lots of of movies lately.
@upasanadhameliya99113 жыл бұрын
Awesome tutorial dude! You're really talented :))
@FeedFall85 жыл бұрын
also Great video As usual Tim :)
@DanielWeikert5 жыл бұрын
Is there any priority? Lets say thread 1 sleeps so thread 2 starts and takes 5 minutes without a break to finish. thread 1 (half executed) would then have to wait 5 minutes until it resumes and finishes then?
@TechWithTim5 жыл бұрын
good question, yes you would have to wait. There is ways around this however...
@DanielWeikert5 жыл бұрын
@@TechWithTim thanks Tim
@chujuntang35175 жыл бұрын
I think thread priority is not controllable in Python due to unawareness of GIL to switch thread.
@baruchba75035 жыл бұрын
If it's possible to show msec in the clock time this may be a better demonstration to show how the threads wait and start.
@devpatel63194 жыл бұрын
Perfect explanation .. keep it up 👻👍👍👌
@arshia.sasson4 жыл бұрын
I am looking into making a device manager that would interact with several comports (at least 2-3, but could be as many as 6) that would read logs/write commands. What would be the most efficient implementation? Running each port in its own thread? Perhaps dedicate a core to running all of the serial port threads? How would I share the logs read into each serial port with the main thread running the computation/testing?
@awwwwhhhyeahhhh5 жыл бұрын
I'm just getting into threading for my kivy app. The reason being is that I have an nslookup function bound to a kivy button and on the button press a progress spinner should appear while the nslookup is running. However when I press the button the app freezes (presumably because the function is an nslookup and doesn't actually interact with the GUI). So my thinking is that I run the function and the progress spinner animation on different threads so the spinner doesn't have to wait for the nslookup to complete. Am I thinking along the right lines here? Will threading help me to achieve this or should I be looking into something else?
@muizzy5 жыл бұрын
"Multithreading" is a very big word when it comes to plain python. You won't be getting any significant performance gain from doing it. If you want to achieve actual multi-threading in python, the best way I know of is to use Konrad Hinsen's modified Python interpreter together with his Bulk Synchronous Parallel (BSP) module included in his scientific python package: bitbucket.org/khinsen/scientificpython The problem is that Python's GIL will protest against any form of parallelisation. I tried to build a package that could deliver a Python based BSP package, but was unable to get the GIL to play nice in any generalised case. Hence, the project is currently on the backburner.
@TechWithTim5 жыл бұрын
Yes you’re correct, to create parallelism you need to use multiprocessing! Multi threading is great for networking applications however because when waiting for tasks to be completed then you can have other threads running in the background. I will be doing a multiprocessing tutorial after this one !
@muizzy5 жыл бұрын
@@TechWithTim ... wait ... You know of a way to get around the GIL?? Do you have any links to resources?
@TechWithTim5 жыл бұрын
@@muizzy It's not necessarily getting around GIL... It's using multiple GIL, you can create more than one process of your program and have them run in parallel on separate cores or CPU's. The issue here is its much more difficult to share information between processes because they have their own memory location. Just try looking up the processing module in python, not sure if it will fix your issue but have a look.
@muizzy5 жыл бұрын
@@TechWithTim Dude, this actually ended up fixing all my problems. Two days of frantic coding later, I've got a working (and beautiful) proof of concept!
@Hamheadon3 жыл бұрын
My main wonder is what happens if you set two threads to delay for the same intervals of time
@kitgary4 жыл бұрын
Any thought about the gevent? Is it good?
@munivoltarc Жыл бұрын
where did you learn this, can u share the resource, if it is a pdf?
@aryanbhatia69925 жыл бұрын
When are deep learning tutorials coming ??
@ashishsrivastava1234 жыл бұрын
Please make video on vscode..its very good.. but lot of issue we face while running e.g. extension do not load, update json files etc ( Python ML developer )
@maulikmadhavi3 жыл бұрын
why different number of empty spaces? Can anyone explain? Thanks
@manishkumar-bh6cc5 жыл бұрын
Bro can you upload a tutorial in webscraping in python
@hammzahammza79145 жыл бұрын
thank you very mush
@chujuntang35175 жыл бұрын
I think it's Python which cannot run two threads at the same time due to GIL.
@marconarca27064 жыл бұрын
you can use concurrent
@sainco30365 жыл бұрын
thanks.
@FeedFall85 жыл бұрын
OMG PYGAMES WEBSITE IS DOWN WHATS HAPPENING?!?!?!?!?