Posts Thread Process
Post
Cancel

Thread Process

Thread Process


๐Ÿ’ฟ Definition

  • ํ”„๋กœ๊ทธ๋žจ: ํŒŒ์ผ์ด ์ €์žฅ ์žฅ์น˜์— ์ €์žฅ๋˜์–ด ์žˆ์ง€๋งŒ ๋ฉ”๋ชจ๋ฆฌ์—๋Š” ์˜ฌ๋ผ๊ฐ€ ์žˆ์ง€ ์•Š์€ ์ •์ ์ธ ์ƒํƒœ๋ฅผ ๋งํ•œ๋‹ค.
  • ํ”„๋กœ์„ธ์Šค: ์šด์˜์ฒด์ œ๋กœ๋ถ€ํ„ฐ ์ž์›์„ ํ• ๋‹น๋ฐ›์€ ์ž‘์—…์˜ ๋‹จ์œ„.
  • ์Šค๋ ˆ๋“œ: ํ”„๋กœ์„ธ์Šค๊ฐ€ ํ• ๋‹น๋ฐ›์€ ์ž์›์„ ์ด์šฉํ•˜๋Š” ์‹คํ–‰ ํ๋ฆ„์˜ ๋‹จ์œ„.

๐Ÿ’ฟ Thread & Process

image

Thread๋Š” Process์™€ ๋‹ค๋ฅด๊ฒŒ Thread ๊ฐ„ Memory๋ฅผ ๊ณต์œ ํ•˜๋ฉฐ ์ž‘๋™

  • ์ฆ‰ Thread๋Š” Process์˜ ์ž์›์„ ๊ณต์œ ํ•˜๋ฉด์„œ Process ์‹คํ–‰ ํ๋ฆ„์˜ ์ผ๋ถ€๊ฐ€ ๋œ๋‹ค.

๐Ÿ’ฟ Thread

image

  • ์šด์˜์ฒด์ œ๋Š” ํ”„๋กœ์„ธ์Šค๋งˆ๋‹ค ๊ฐ๊ฐ ๋…๋ฆฝ๋œ ๋ฉ”๋ชจ๋ฆฌ ์˜์—ญ์„, Code/Data/Stack/Heap์˜ ํ˜•์‹์œผ๋กœ ํ• ๋‹น
  • ์ด์™€ ๋‹ค๋ฅด๊ฒŒ Thread๋Š” Memory๋ฅผ ์„œ๋กœ ๊ณต์œ  ํ•  ์ˆ˜ ์žˆ์Œ

image

  • Process ๊ฐ•์ œ ์ข…๋ฃŒ: ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค ๋Š” ๊ณต์œ ํ•˜๊ณ  ์žˆ๋Š” ํŒŒ์ผ์„ ์†์ƒ์‹œํ‚ค๋Š” ๊ฒฝ์šฐ๊ฐ€ ์•„๋‹ˆ๋ผ๋ฉด ์•„๋ฌด๋Ÿฐ ์˜ํ–ฅ์„ ๋ฐ›์ง€ ์•Š์Œ.
  • Thread ๊ฐ•์ œ ์ข…๋ฃŒ: Thread ํ•˜๋‚˜์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ๊ฐ™์€ Process ๋‚ด์˜ ๋‹ค๋ฅธ Thread ๋ชจ๋‘๊ฐ€ ๊ฐ•์ œ๋กœ ์ข…๋ฃŒ

์•ž์„œ ์–ธ๊ธ‰ํ•œ ๋Œ€๋กœ Thread์˜ ๊ฒฝ์šฐ ๋™๊ธฐํ™”, ๊ฐ„์„ญ์ด ๊ฐ€์žฅ ํฐ ๋‹จ์ ์œผ๋กœ ์ž‘์šฉ


๐Ÿ’ฟ Process

ํ”„๋กœ์„ธ์Šค๋„ ๊ณต์œ ๊ฐ€ ๋จ

  • IPC(Inter-Process Communication)์„ ์‚ฌ์šฉํ•œ๋‹ค.
  • LPC(Local inter-Process Communication)์„ ์‚ฌ์šฉํ•œ๋‹ค.
  • ๋ณ„๋„๋กœ ๊ณต์œ  ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋งŒ๋“ค์–ด์„œ ์ •๋ณด๋ฅผ ์ฃผ๊ณ ๋ฐ›๋„๋ก ์„ค์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

CPU ๋ ˆ์ง€์Šคํ„ฐ ๊ต์ฒด๋ฟ๋งŒ์ด ์•„๋‹ˆ๋ผ RAM๊ณผ CPU ์‚ฌ์ด์˜ ์บ์‹œ ๋ฉ”๋ชจ๋ฆฌ๊นŒ์ง€ ์ดˆ๊ธฐํ™”๋˜๊ธฐ ๋•Œ๋ฌธ์— ์•ž์„œ ๋งํ–ˆ๋“ฏ ์ž์› ๋ถ€๋‹ด์ด ํฌ๋‹ค.

This post is licensed under CC BY 4.0 by the author.

Java Thread

Spring JPA