Can threads execute same synchronized methods on the different objects?
In our previous video (https://youtu.be/PJtxT3cgCPk), we learnt that when a method is synchronized, only one thread can enter the method at a time. But do you know what happens if more than one thread tries to invoke the same synchronized method on different objects simultaneously? In this video, we'll go deeper into this topic and explore the answer to it. If you liked this video, you'll love our Java Performance Masterclass. Learn more: https://ycrash.io/java-performance-training - - - - - - - - - - - - - - - Topics covered: 00:33 - Multiple synchronized methods in a same object example 02:45 - How does the same Synchronized method on different objects work in Java? 04:54 - Threads behavior when executing same Synchronized on different objects - - - - - - - - - - - - - - - Links shared in the video: Synchronized method – Boy Friend Threads & Girl Friend Object: https://blog.ycrash.io/2023/02/13/synchronized-method-boy-friend-threads-girl-friend-object/ Open-source script yCrash: https://github.com/ycrash/yc-data-script Thread dump analysis report: https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjMvMDIvMTAvc3luY2hyb25pemVkLWRpZmZlcmVudC1vYmplY3RzLnR4dC0tMTQtMzktMTc=& Can threads execute the same synchronized method on same objects? https://blog.ycrash.io/2023/02/13/can-threads-execute-different-synchronized-methods-on-same-object/ - - - - - - - - - - - - - - - Read more in this blog: https://blog.ycrash.io/2023/02/13/can-threads-execute-same-synchronized-method-on-different-objects/ - - - - - - - - - - - - - - - Our Tools: yCrash: https://ycrash.io/ GCeasy: https://gceasy.io/ HeapHero: https://heaphero.io/ fastThread Tool: https://fastthread.io/ - - - - - - - - - - - - - - - SRE Community: Need help in troubleshooting your performance problems? Post here: https://answers.ycrash.io/ - - - - - - - - - - - - - - - Follow us on: LinkedIn: https://www.linkedin.com/company/ycrash Instagram: https://www.instagram.com/ycrash_rca/ Facebook: https://www.facebook.com/tier1app Twitter: https://twitter.com/tier1app - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - Related videos: Synchronized method – Boy Friend Threads & Girl Friend Object: https://youtu.be/PJtxT3cgCPk Can threads execute different synchronized methods on same object? https://youtu.be/Q_3uSD4rH9w - - - - - - - - - - - - - - - #synchronized | #synchronizedmethod | #synchronizedmethodinjava | #javasynchronizedmethod | #thread | #threads | #c# | #threadexecutemethod | #threadsynchronization | #synchronizedmethods | #javasynchronized | #synchronizedblock | #synchronizedkeywordinjava | #synchronizedmethodsinjava | #synchronizedblockandsynchronizedmethodsinjava | #synchronizedmethodandsynchronizedblockinjava | #synchronizedblockvssynchronizedmethod | #multithreadingsynchronizedkeyword
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.