Difference Between Parallelism and Concurrency

Before doing concurrent programming, you must first understand what is concurrency, what is parallelism, what is concurrent programming, and what is parallel programming.

Concurrency and parallelism are:

Explanation 1: Parallel means that two or more events occur at the same time; while concurrency means that two or more events occur at the same time interval.
Explanation 2: Parallelism is multiple events on different entities, and concurrency is multiple events on the same entity.
Explanation 3: Multiple tasks are processed "simultaneously" on one processor, and multiple tasks are processed simultaneously on multiple processors. Such as hadoop distributed cluster
, so the goal of concurrent programming is to fully utilize each core of the processor to achieve the highest processing performance

Among them: Concurrency includes synchronization and mutual exclusion of multiple threads; synchronization and asynchrony are relative

Example:
Parallel: Double Eleven, 0:00:00, 300,000 users log on Taobao at the same
 time .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325144235&siteId=291194637