Marco, has anyone ever told You that You're doing absolutely fantastic stuff? Because You're doing absolutely amazing stuff
@MarcoCodes Жыл бұрын
Jacek, thanks a lot for those words!! Much appreciated and a great start for the day for me.
@stephentomaszewski8501 Жыл бұрын
Please do a deep dive into optimizing the mutiprocessing. Most people don't understand the difference between threads and processes and how threads are light weight processes that share data, code, and the heap but have their own stack which makes context switching quicker.
@MarcoCodes Жыл бұрын
Will see how/when to fit this in!
@tipazas Жыл бұрын
No need to say we want some content or not, from you it's interesting to see about everything :)
@marcinkunert Жыл бұрын
Awesome content as always. Thanks Marco!
@MarcoCodes Жыл бұрын
Thank you!
@igeolasoji3513 Жыл бұрын
Hello Marco, I believe calling the parallel method before the other operators should work with the old Java version.
@MarcoCodes Жыл бұрын
Hey Ige, nope, the order has no effect. As mentioned, it was a long known issue in the JDK, I'll need to dig around and find the openjdk bug report for this one.
@SergiyPonomarenko-f5e Жыл бұрын
Great as always!
@cdhagen Жыл бұрын
16:25 Would be interesting to see how you solve the potential race condition when two threads work on identical files. I'm thinking about some kind of synchronized Set which stores the hashes of already processed images, maybe? 🤔
@MarcoCodes Жыл бұрын
There are many ways to approach this. The easiest one I could think of for now is to let the two threads work on identical files, but render the resulting thumbnail to a randomly named tmpfile. And after rendering has finished, "mv" the tmp file into the final destination. If some other thread has already created the final file, then the mv will just be ignored, the file deleted and that's it. It's a simple solution without elaborated synchronisation on the Java side, just a bit of additional CPU wasted in this corner case.
@fmictsang88749 ай бұрын
I learn a lot from this video.
@vishnugovindan8550 Жыл бұрын
Hi Marco, any good resources on concurrent/multi threading programming in Java apart from concurrency in practice that you have found helpful?
@MarcoCodes Жыл бұрын
Concurrency in practice is literally it. It's a bummer that there is no new version out, but reading/working through it will give you the best base possible. You also might want to follow up with the "little book of semaphores"
@rydmerlin Жыл бұрын
If ImageMagick was multithreaded would you want to see it using its own thread pool? Also can you say which NAS that you’re running Java on?
@MarcoCodes Жыл бұрын
ImageMagick in fact already is multithreaded, and you can influence that behavior with command line options. Explaining what effect that has is a whole other topic :) as for the Nas, it is self-assembled and I don't quite remember the individual parts - it has been a couple years.
@tipazas Жыл бұрын
Just interested... what is the rationale behind strictly not using old File API? Performance? For me it looks like big price to have so much technical code copied instead of calling hasher.update(image.toFile()). Thank you.
@MarcoCodes Жыл бұрын
That is a good question. It is just from past experience that I've seen the file API becoming cumbersome at some point, e.g. testing. And I got into the habit of making sure to use the Path API whenever I can - but sure, for the scope of that prototype we could have also used the "old" file API.
@AmNotLegend Жыл бұрын
combine two filter in a private method
@MarcoCodes Жыл бұрын
yup, possible.
@alirezaasadi86568 ай бұрын
nothing new , most important question were not answered. you ask questions we are here for answers. that is actually a bad thing. we are here looking for the answers not questions. question already raised by ourselves.
@MarcoCodes8 ай бұрын
Ironically your nonsensical comment contains not a single question.
@marin14197 ай бұрын
@@MarcoCodes His prose follows the style of Gottlob Frege lmao
@cypherliquid Жыл бұрын
you are not going to continue this google photos clone
@MarcoCodes Жыл бұрын
Why?
@cypherliquid Жыл бұрын
@@MarcoCodes common its 1st April you can't fall for this