๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ“– Note

๋™์‹œ์„ฑ vs ๋ณ‘๋ ฌ์„ฑ ( Concurrency vs Parallelism )

ํ”„๋กœ๊ทธ๋žจ์„ ํ•˜๋‹ค๋ณด๋ฉด ๋™์‹œ์„ฑ ํ”„๋กœ๊ทธ๋žจ, ๋ณ‘๋ ฌ์„ฑ, ๋น„๋™์‹œ์„ฑ ๋“ฑ ๋‹ค์–‘ํ•œ ๋ง์„ ๋“ฃ๊ฒŒ ๋˜๋Š”๋ฐ ์ด์ค‘์—์„œ ๋™์‹œ์„ฑ๊ณผ ๋ณ‘๋ ฌ์„ฑ์ด ์–ด๋–ป๊ฒŒ ๋‹ค๋ฅธ์ง€์— ๋Œ€ํ•ด stackoverflow์— ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •๋ฆฌ๋˜์–ด์žˆ์–ด์„œ ๊ฐ€์ ธ์™€๋ณด์•˜๋‹ค.

 

stackoverflow์— ๋“ค์–ด๊ฐ€๋ฉด ๋™์‹œ์„ฑ๊ณผ ๋ณ‘๋ ฌ์„ฑ์— ๋Œ€ํ•œ ์˜ˆ์‹œ๋กœ ์Šคํ† ๋ฆฌ๋ฅผ ๋งŒ๋“ค์–ด ์ ์–ด๋†“์€ ๋ถ€๋ถ„์ด ์žˆ๊ธฐ๋•Œ๋ฌธ์—, ํ•„์š”ํ•˜๋‹ค๋ฉด ์ฐธ๊ณ ํ•˜์ž!

 

 

Concurrency: ๋™์‹œ์„ฑ

Concurrency is when two or more tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean they'll ever both be running at the same instant. For example, multitasking on a single-core machine.

๋™์‹œ์„ฑ์€ ๋‘ ๊ฐœ ์ด์ƒ์˜ ์ž‘์—…์ด ๊ฒน์ณ์žˆ๋Š” ์‹œ๊ฐ„์— ์‹คํ–‰, ์‹คํ–‰ ๋ฐ ์™„๋ฃŒ ๋  ์ˆ˜ ์žˆ๋‹ค. ํ•˜์ง€๋งŒ ๋ฐ˜๋“œ์‹œ ๋‘˜ ๋‹ค ๊ฐ™์€ ์ˆœ๊ฐ„์— ์‹คํ–‰ ๋œ๋‹ค๋Š” ์˜๋ฏธ๋Š” ์•„๋‹ˆ๋‹ค.

์˜ˆ์‹œ๋กœ ๋‹จ์ผ ์ฝ”์–ด ์ปดํ“จํ„ฐ์—์„œ์˜ ๋ฉ€ํ‹ฐํƒœ์Šคํ‚น์ด ์žˆ๋‹ค.

 

๋™์‹œ์„ฑ์€ ์„œ๋กœ์˜ ์ž‘์—…๋“ค์ด ์ธํ„ฐ๋ŸฝํŠธ๋˜๋ฉฐ ๋™์ž‘์ด ์ด๋ฃจ์–ด ์ง„๋‹ค.

 

Parallelism: ๋ณ‘๋ ฌ์„ฑ

Parallelism is when tasks literally run at the same time, e.g., on a multicore processor.

๋ณ‘๋ ฌ์„ฑ์€ ๋ง ๊ทธ๋Œ€๋กœ ์ž‘์—…์ด ๋™์‹œ์— ์‹คํ–‰๋˜๋Š” ๊ฒฝ์šฐ๋ฅผ ๋งํ•œ๋‹ค. ์˜ˆ์‹œ๋กœ ๋ฉ€ํ‹ฐ ์ฝ”์–ด ํ”„๋กœ์„ธ์„œ๊ฐ€ ์žˆ๋‹ค.

 

๋ณ‘๋ ฌ์„ฑ์€ ๋™์‹œ์„ฑ๊ณผ ์„œ๋กœ์˜ ์ž‘์—…๋“ค์ด ๋…๋ฆฝ์ ์ด๋‹ค.

 

Photos

 

 

 

 

 


Thanks for