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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
publisher | Addison-Wesley | 978-0-13-270225-6 | eBook | |||||||||||||||||||||||||||||||||||||||||||||||||||||
published | 2006-05-19 | B004V9OA84 | kindle | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Bloch and Lea especially have very good reputations in concurrent programming. This is the dream team to write such a book. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
recommend book⇒Concurrent Programming in Java(TM): Design Principles and Patterns, third edition | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
by | Douglas Lea | 978-0-321-25617-1 | paperback | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
publisher | Addison-Wesley | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
published | 2006-05-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 |
http://mindprod.com/jgloss/concurrency.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\concurrency.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.138.32.53] |
| |
Feedback |
You are visitor number | |