concurrency - Parallel Programming Clarification and Concurrent Programming -


i've been reading on parallel , concurrent programming, , there 2 things still have not found answers , still confused about.

1) in places read parallel programming allows multiple processes executed simultaneously taking advantage of multiple cpus, while other places read taking advantage of multiple cores. right? understanding core part of cpu, it's not possible both definitions valid (unless i'm missing something).

2) have basic understanding of how concurrent programming works, fail see why faster 2 processes executed concurrently rather sequentially. example, if there 2 threads consisting of 4 computations require same amount of time processed:

thread a: a1 a2 a3 a4

thread b: b1 b2 b3 b4

concurrent execution of threads possibly result in following execution: a1 b1 a2 b2 a3 b3 a4 b4. how faster if 2 threads sequentially executed: a1 a2 a3 a4 b1 b2 b3 b4? both methods of execution require 8 total computations, means total time same.

on two-core (multi-core) cpu (or 2 one-core cpus), each thread run on separate core. assuming no synchronization required between 2 threads, can both run @ same time (i.e. each core runs 4 steps, @ same frequency - , half time - single core run 8 steps).

a multi-core cpu can (the devil in details) thought of multiple cpus on single chip: each core, independent of located, can execute program simultaneously.

for instance, system 2x intel i7-47xx (4 cores) processors has 8 (2x4) physical cores. (and hyper-threading, there 16 virtual cores..)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -