Parallel and Concurrent Programming (Using Java) — Part I

Photo by Brooke Lark on Unsplash
http://brahe.canisius.edu/~meyer/253/BOOK/ch20/FULLPAGE/ch20-3.html

Shared vs Distributed Memory

https://www.researchgate.net/figure/Memory-Organization-a-Shared-Memory-b-Distributed-Memory_fig1_302245489
Ready Queue — https://www.tutorialspoint.com/operating_system/os_process_scheduling.htm
mini reminder:
- cache coherency -> handled by processor hardware
- modern multi-core systems -> Flynn's Taxonomy MIMD
- parallel computing increases:
* speed
* # of tasks executed
* scaling
https://www.geeksforgeeks.org/difference-between-running-and-runnable-states-of-a-thread-in-java/
https://www.javabrahman.com/corejava/understanding-thread-life-cycle-thread-states-in-java-tutorial-with-examples/
synchronized(object) {
// protected code
}

Locks

https://www.geeksforgeeks.org/deadlock-in-java-multithreading/
ReadWriteLock rwLock = new ReentrantReadWriteLock();
Lock readLock = rwLock.readLock();
Lock writeLock = rwLock.writeLock();
...
rwLock.getReadLockCount();
try {
...
...
} finally {
secondLock.unlock();
firstLock.unlock();
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store