λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

detach1

[C++] 20. λ©€ν‹° μŠ€λ ˆλ“œ ν”„λ‘œκ·Έλž˜λ°(Multi-Threads) λ©€ν‹°μŠ€λ ˆλ“œ(Multi-Threads) λ©€ν‹°μŠ€λ ˆλ“œ ν”„λ‘œκ·Έλž˜λ°μ€ ν•˜λ‚˜μ˜ 컴퓨터 ν”„λ‘œκ·Έλž¨ μ•ˆμ—μ„œ μ—¬λŸ¬ 개의 μ‹€ν–‰ 흐름인 μŠ€λ ˆλ“œ(thread)λ₯Ό μ‚¬μš©ν•˜μ—¬ λ³‘λ ¬λ‘œ μž‘μ—…μ„ μˆ˜ν–‰ν•˜λŠ” ν”„λ‘œκ·Έλž˜λ° κΈ°λ²•μž…λ‹ˆλ‹€. κ°„λ‹¨νžˆ λ§ν•΄μ„œ, λ©€ν‹°μŠ€λ ˆλ“œ ν”„λ‘œκ·Έλž˜λ°μ€ μ—¬λŸ¬ 개의 μž‘μ€ "λΆ€λΆ„ μž‘μ—…"을 λ™μ‹œμ— μ‹€ν–‰ν•˜μ—¬ 전체 μž‘μ—…μ„ 더 효율적으둜 μ²˜λ¦¬ν•˜λŠ” 것을 λͺ©ν‘œλ‘œ ν•©λ‹ˆλ‹€. λ©€ν‹°μŠ€λ ˆλ“œ ν”„λ‘œκ·Έλž˜λ°μ˜ μ£Όμš” κ°œλ…μ€ λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€: 1. μŠ€λ ˆλ“œ (Thread): ν”„λ‘œκ·Έλž¨μ˜ μ‹€ν–‰ 흐름을 λ‚˜νƒ€λ‚΄λŠ” ν•˜λ‚˜μ˜ λ‹¨μœ„λ‘œ, λ™μ‹œμ— μ—¬λŸ¬ μŠ€λ ˆλ“œλ₯Ό μ‹€ν–‰ν•˜λ©΄ μ—¬λŸ¬ μž‘μ—…μ„ λ™μ‹œμ— μ²˜λ¦¬ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 2. 병렬성 (Concurrency): λ©€ν‹°μŠ€λ ˆλ“œ ν”„λ‘œκ·Έλž˜λ°μ—μ„œλŠ” μ—¬λŸ¬ μŠ€λ ˆλ“œκ°€ λ™μ‹œμ— μ‹€ν–‰λ˜μ§€λ§Œ, μ‹€μ œλ‘œ λ™μ‹œμ— μ‹€ν–‰λ˜λŠ” 것은 ν”„λ‘œμ„Έμ„œμ˜ 물리적 ν•œκ³„ λ•Œλ¬Έμ— μ œν•œλ  수 .. 2023. 8. 18.