Toward Concurrency
 

軟體開發現況

  • Concurrency Kit: Concurrency primitives, safe memory reclamation mechanisms and non-blocking data structures for the research, design and implementation of high performance concurrent systems.
 

Functional Programming

 

Concurrency (並行) vs. Parallelism (平行)

 
Task: Let's burn a pile of obsolete language manuals! One at a time!
Concurrency: There are many concurrently decompositions of the task! One example:
(composition 合成 decomposition 分解)
[ Interruptability ]
Parallelism: The previous configuration occurs in parallel if there are at least 2 gophers working at the same time or not.
[ Independentability ]
 
換個觀點來理解 [ source ]
  • Concurrency: If two or more problems are solved by a single processor.
  • multiple execution flows with the potential to share resources
  • Example: two threads competing for a I/O port.
  • the separation of tasks to provide interleaved execution
  • Concurrency solves the problem of having scarce CPU resources and many tasks. So, you create threads or independent paths of execution through code in order to share time on the scarce resource. Up until recently, concurrency has dominated the discussion because of CPU availability.
  • Parallelism: If one problem is solved by multiple processors.
  • splitting a problem in multiple similar chunks.
  • Example: parsing a big file by running two processes on every half of the file.
  •  the simultaneous execution of multiple pieces of work in order to increase speed
  • Parallelism solves the problem of finding enough tasks and appropriate tasks (ones that can be split apart correctly) and distributing them over plentiful CPU resources. Parallelism has always been around of course, but it's coming to the forefront because multi-core processors are so cheap.
 

Concurrency 系列文章 (繁體中文)