Sections
00:00 Do we need to run multiple threads?
01:44 Compress 5 files using 1 thread
10:00 Enhance compression to use 5 threads
12:15 Non thread safe code using mutable objects
19:32 Write thread safe code using Atomic objects
22:44 Deadlock!
32:07 Debug deadlocks with ThreadDump
37:05 SynchronizedMap vs ConcurrentHashMap
44:17 Atomic classes
Code used could be found here github.com/ahmadhashem/MultithreadingDemo/tree/main
Do I need to write multi threaded code ?!
Can I reduce time to process compressing a file by 75% ?!
Do I need to learn how to write multi threaded code ?!
Is it just safe to write code with knowing how threads work ?!
Is it possible that something goes wrong ?!
Do all operations need to be atomic when executed in a thread ?
Is it safe to use mutable objects in multi threads ?!
How to fall into a deadlock ?!
How to detect dead lock?
How to generate thread dump ?!
How to debug thread dump ?!
Which data structures need to be used in multi threaded code ?!
Which one should I use , synchronizedMap or ConcurrentHashMap?
AhmadBinHashem
www.linkedin.com/in/ahmedhashem404/
#java #multithread #logback #MDC #CountDownLatch #ExecutorService #threading #production #ready #code #programming #deadlock #synchronized #atomic #AtomicInteger #Threadsafe #Mutable #Immutable #threaddump #بالعربي #arabic
30 апр 2024