A*******e 发帖数: 2419 | 1 手头两本书都有,从哪本开始比较好?
C++ concurrency in action
Java concurrency in practice
对C++熟悉一些,但Java更流行?不知内容是否大同小异。 | c********1 发帖数: 5269 | 2 大同小异.
concurrency functionality is provided by modern OSs.
C++, java just provides interfaces to access the functionality.
【在 A*******e 的大作中提到】 : 手头两本书都有,从哪本开始比较好? : C++ concurrency in action : Java concurrency in practice : 对C++熟悉一些,但Java更流行?不知内容是否大同小异。
| k**********g 发帖数: 989 | 3
Start with Java Executors.
Learn how to use it just like the Runnable and Callable class.
http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/E
For example, if your goal is to write Android programs, (1) Executors is
basically all you need - the only other things you need are (2) thread
safety on Android, and (3) understand when and why you need to call Activity
.runOnUiThread() in some situations
C++ didn't have anything in the standard library comparable to Java
Executors. Design-by-Committee Paralysis, lagging behind Java a whole decade.
However, Boost, Intel TBB and Microsoft PPL are libraries that will enable
functionality similar to Java Executors. They might be included into the C++
standard one day ... but that might be many years or decades down the road.
----
Feel free to skip everything below ... just my ranting.
Here, "concurrent" mostly means "multicore", sometimes means "asynchronous"
/ cooperative multitasking.
"Distributed" mostly means spanning over many machines, along with
complications such as high latency, machine failures, network failures etc.
For beginners, this diagram will give an intuitive understanding and
motivation for concurrency: http://cdn.nginx.com/wp-content/uploads/2015/06/Thread-Pool1.png
1. Introduction to computer architecture (talks about how CPU works, e.g.
fetch decode read execute write, CPU cache, etc.)
* Most CS & CompEng should have taken this course in undergrad. If you have
never taken this course, you may have difficulty understanding fundamental
"thread-safety" concepts, because you will not intuitively identify what
kind of memory (variable) accesses will suffer from race-condition.
2. Operating Systems
* Using threads
* Synchronization primitives
* This course should also teach fundamental "thread-safety" concepts.
2. Concurrent data structures and algorithms
* Beginners only need to know the concurrent queues and vectors, know which
of their operations are thread-safe (consistent when used simultaneously by
multiple threads), and why.
* Stay away from the advanced courses ... implementation is too difficult
to learn.
3. Distributed information systems
* Only need to know how to use libraries ...
4. Distributed algorithms
* Too theoretical (e.g. graph algorithms) typically not needed unless
working for the top famous companies
5. Software patterns for multicore computations.
* Single machine (or a single cluster that behaves like a single machine),
many "processing elements" a.k.a. cores.
* Workload is mostly computational, i.e. don't depend on networks, external
resources, or databases.
* Basically the picture above -
* Break down algorithms into "tasks" and specify their "computation order
dependencies"
* Submit read-to-execute tasks to a task queue
* Many worker threads pull from the task queue and execute each item
* Whenever a task is completed, other tasks which had their preconditions
fully satisfied will also be appended to the task queue
* Might also need to know SIMD, GPGPU stuff ... depending
6. Software patterns for distributed computations.
* Hadoop
7. Concurrency practicum
* http://docs.oracle.com/javase/8/docs/api/java/nio/channels/Selector.html
* http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html
【在 A*******e 的大作中提到】 : 手头两本书都有,从哪本开始比较好? : C++ concurrency in action : Java concurrency in practice : 对C++熟悉一些,但Java更流行?不知内容是否大同小异。
| h****r 发帖数: 2056 | 4 your understanding to concurrent is not right, although close.
Activity
decade.
【在 k**********g 的大作中提到】 : : Start with Java Executors. : Learn how to use it just like the Runnable and Callable class. : http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/E : For example, if your goal is to write Android programs, (1) Executors is : basically all you need - the only other things you need are (2) thread : safety on Android, and (3) understand when and why you need to call Activity : .runOnUiThread() in some situations : C++ didn't have anything in the standard library comparable to Java : Executors. Design-by-Committee Paralysis, lagging behind Java a whole decade.
| c*********e 发帖数: 16335 | 5 当然是java. 书里面讲到很多java具体的class,有具体的例子。
【在 A*******e 的大作中提到】 : 手头两本书都有,从哪本开始比较好? : C++ concurrency in action : Java concurrency in practice : 对C++熟悉一些,但Java更流行?不知内容是否大同小异。
| c*********e 发帖数: 16335 | 6 正在看Java concurrency in practice,作者是geek,programming技术可能还行,写书
讲故事的水平真不敢恭维,经常看得我有拍桌子的冲动。
【在 A*******e 的大作中提到】 : 手头两本书都有,从哪本开始比较好? : C++ concurrency in action : Java concurrency in practice : 对C++熟悉一些,但Java更流行?不知内容是否大同小异。
| k**********g 发帖数: 989 | 7
async 当中,有扯蛋的成份。
【在 h****r 的大作中提到】 : your understanding to concurrent is not right, although close. : : Activity : decade.
|
|