pthread_setconcurrency(3) - wariua/manpages-ko GitHub Wiki
pthread_setconcurrency, pthread_getconcurrency - λμμ± μμ€ μ€μ νκΈ°/μ»κΈ°
#include <pthread.h>
int pthread_setconcurrency(int new_level);
int pthread_getconcurrency(void);
-pthread
λ‘ μ»΄νμΌ λ° λ§ν¬.
pthread_setconcurrency()
ν¨μλ new_level
μ μ§μ ν μμ©μ΄ μνλ λμμ± μμ€μ ꡬν체μκ² μλ¦°λ€. ꡬν체λ μ΄λ₯Ό ννΈλ‘λ§ λ°μλ€μΈλ€. POSIX.1μμλ pthread_setconcurrency()
νΈμΆμ κ²°κ³Όλ‘ μ 곡λμ΄μΌ νλ λμμ± μμ€μ λͺ
μΈνκ³ μμ§ μλ€.
new_value
λ₯Ό 0μΌλ‘ μ§μ νλ κ²μ ꡬν체μκ² μ μ νλ€ μΆμ λλ‘ λμμ± μμ€μ κ΄λ¦¬νλΌκ³ μ§μνλ κ²μ΄λ€.
pthread_getconcurrency()
λ μ΄ νλ‘μΈμ€μ λν νμ¬μ λμμ± μμ€ κ°μ λ°ννλ€.
μ±κ³΅ μ pthread_setconcurrency()
λ 0μ λ°ννλ€. μ€λ₯ μ 0 μλ μ€λ₯ λ²νΈλ₯Ό λ°ννλ€.
pthread_getconcurrency()
λ νμ μ±κ³΅νλ©° μμ pthread_setconcurrency()
νΈμΆλ‘ μ€μ ν λμμ± μμ€μ λ°ννλ€. μμ pthread_setconcurrency()
λ₯Ό νΈμΆν μ μ΄ μμΌλ©΄ 0μ λ°ννλ€.
pthread_setconcurrency()
κ° λ€μ μ€λ₯λ‘ μ€ν¨ν μ μλ€.
EINVAL
-
new_level
μ΄ μμμ΄λ€.
POSIX.1μμλ EAGAIN
μ€λ₯("new_value
λ‘ μ§μ ν κ°μ΄ μμ€ν
μμ μ΄κ³Όλ₯Ό μΌμΌν€κ² λ¨")λ μ κ³ μλ€.
glibc λ²μ 2.1λΆν° μ΄ ν¨μλ€μ΄ μ¬μ© κ°λ₯νλ€.
μ΄ μ μμ μ¬μ©νλ μ©μ΄λ€μ λν μ€λͺ μ attributes(7)λ₯Ό 보λΌ.
μΈν°νμ΄μ€ | μμ± | κ° |
---|---|---|
pthread_setconcurrency() ,pthread_getconcurrency()
|
μ€λ λ μμ μ± | MT-Safe |
POSIX.1-2001, POSIX.1-2008.
κΈ°λ³Έ λμμ± μμ€μ 0μ΄λ€.
λμμ± μμ€μ M:N μ€λ λ© κ΅¬νμμλ§ μλ―Έκ° μλ€. κ·Έ λ°©μμμλ ν μμ μ νλ‘μΈμ€μ μ¬μ©μ μμ€ μ€λ λλ€ μ€ μΌλΆκ° λ μ μ 컀λ μ€μΌμ€λ§ κ°μ²΄λ€μ κ²°μλμ΄ μμ μ μλ€. λμμ± μμ€μ μ€μ ν¨μΌλ‘μ¨ ν¨μ¨μ μΈ μμ© μ€νμ μν΄ μ 곡λΌμΌ νλ 컀λ μ€μΌμ€λ§ κ°μ²΄ μμ λν ννΈλ₯Ό μμ©μ΄ μμ€ν μκ² μ€ μ μλ€.
LinuxThreadsμ NPTL λͺ¨λ 1:1 μ€λ λ© κ΅¬νμ΄λ―λ‘ λμμ± μμ€ μ€μ μ΄ μλ―Έκ° μλ€. λ€μ λ§ν΄ 리λ μ€μμ μ΄ ν¨μλ€μ λ€λ₯Έ μμ€ν κ³Όμ νΈνμ±μ μν΄ μμ λΏμ΄λ©° νλ‘κ·Έλ¨ μ€νμ μ΄λ€ μν₯λ μ£Όμ§ μλλ€.
pthread_attr_setscope(3), pthread(7)
2017-09-15