There are two concepts concurrency and parallelism that are easily confused. If you had a single core CPU (Central Processing Unit), two threads would have to take turns using it. That is called concurrency. Both threads are progressing simultaneously, but only one is running at a time.
If you had a multi-core CPU, if you were running only two threads, then each thread could run on its own CPU. Both could be running simultaneously. That is called parallelism.
In practice, there are hundreds or thousands of threads running at once sharing perhaps 6 cores so you get a mixture of concurrency and parallelism.
Part of what lambda expressions are about is creating iterators that run either sequentially or partially in parallel. Application code in either case is almost identical.
Java supports concurrent multiprocessing via Threads. The java.util.concurrent package has all manner of canned threading solutions including ways of queuing up work and processing it with Thread pools. Writing multi-thread code is extremely tricky, so you want to use well-tested packages wherever you can. The Future interface lets you return values and success status information from your Threads.
|recommend book⇒Java Concurrency in Practice|
|by||Brian Goetz, Tim Peierls, Joshua J. Bloch, Joseph Bowbeer, David Holmes, Doug Lea||978-0-321-34960-6||paperback|
|Bloch and Lea especially have very good reputations in concurrent programming. This is the dream team to write such a book.|
|recommend book⇒Concurrent Programming in Java(TM): Design Principles and Patterns, third edition|
|Threads and concurrency in Java, design considerations (safety, liveness and performance), Before/After Patterns, layering, adapters, immutability and synchronization, deadlock, resource ordering, the Java Memory Model and concurrency, using the java.concurrency package, confinement, refactoring for concurrency, mutexes, read-write locks, recovering from failure, notifications, semaphores, latches, exchanges, transactions, one-way messages, worker threads, polling and event-driven I/O, parallelism techniques (fork/join, computation trees and barriers), Communicating Sequential Processes (CSP).|
|Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.|
This page is posted
Optional Replicator mirror
Your face IP:[188.8.131.52]
You are visitor number|