pthread_barrier_wait(3p) - wariua/manpages-ko GitHub Wiki
μ΄ λ§€λ΄μΌ νμ΄μ§λ POSIX νλ‘κ·Έλλ¨Έ λ§€λ΄μΌμ μΌλΆμ΄λ€. μ΄ μΈν°νμ΄μ€μ 리λ μ€ κ΅¬νμ μ°¨μ΄κ° μμ μ μμΌλ©° (μμΈν 리λ μ€ λμ λ°©μμ ν΄λΉ 리λ μ€ λ§€λ΄μΌ νμ΄μ§ μ°Έκ³ ) 리λ μ€μμ μ΄ μΈν°νμ΄μ€κ° ꡬνλμ΄ μμ§ μμ μλ μλ€.
pthread_barrier_wait - 배리μ΄μμ λκΈ°ν
#include <pthread.h>
int pthread_barrier_wait(pthread_barrier_t *barrier);
pthread_barrier_wait()
ν¨μλ barrier
κ° κ°λ¦¬ν€λ 배리μ΄μμ μ°Έμ¬ μ€λ λλ€μ λκΈ°ν μν¨λ€. μ§μ ν μμ μ€λ λκ° κ·Έ 배리μ΄λ₯Ό μ§μ ν΄μ pthread_barrier_wait()
μ νΈμΆν λκΉμ§λ νΈμΆ μ€λ λκ° λΈλ‘ νκ² λλ€.
μ§μ ν μμ μ€λ λκ° κ·Έ 배리μ΄λ₯Ό μ§μ ν΄μ pthread_barrier_wait()
μ νΈμΆνμ λ ν λΆνΉμ μ€λ λμκ²λ μμ PTHREAD_BARRIER_SERIAL_THREAD
κ° λ°νλκ³ λλ¨Έμ§ μ€λ λ κ°κ°μκ²λ 0μ΄ λ°νλλ€. κ·Έ μμ μ 배리μ΄λ κ·Έ 배리μ΄λ₯Ό μ°Έμ‘°ν κ°μ₯ μ΅κ·Ό pthread_barrier_init()
ν¨μ νΈμΆ κ²°κ³Όμ κ°μ μνλ‘ μ¬μ€μ λλ€.
μμ PTHREAD_BARRIER_SERIAL_THREAD
κ° <pthread.h>
μ μ μλμ΄ μμΌλ©° κ·Έ κ°μ pthread_barrier_wait()
μ΄ λ°ννλ λ€λ₯Έ μ΄λ€ κ°κ³Όλ λ€λ₯΄λ€.
μ΄κΈ°ν μ λ 배리μ΄λ‘ μ΄ ν¨μλ₯Ό νΈμΆνλ κ²½μ°μ κ²°κ³Όλ κ·μ λμ΄ μμ§ μλ€.
배리μ΄μ λΈλ‘ λμ΄ μλ μ€λ λμκ² μκ·Έλμ΄ μ λ¬λλ κ²½μ° μκ·Έλ νΈλ€λ¬ λ°ν μμ λ°°λ¦¬μ΄ λκΈ°κ° μλ£λμ§ μμμΌλ©΄ (μ¦ μκ·Έλ νΈλ€λ¬ μ€ν λμμ μ§μ ν μμ μ€λ λκ° λ°°λ¦¬μ΄μ λλ¬νμ§ λͺ»νμΌλ©΄) μ€λ λκ° κ³μν΄μ 배리μ΄μμ λκΈ°νλ€. μλλΌλ©΄ κ·Έ μλ£λ λ°°λ¦¬μ΄ λκΈ°λ‘λΆν° μ€λ λκ° μ μμ μΌλ‘ μ€νμ μ΄μ΄ κ°λ€. μ€λ λκ° μκ·Έλ νΈλ€λ¬μμ λ°ννκΈ° μ μ λͺ¨λ μ€λ λκ° λ°°λ¦¬μ΄μ λλ¬νμ λ λ€λ₯Έ μ€λ λκ° λ°°λ¦¬μ΄λ₯Ό μ§λ μ§νν μ μλμ§ μ¬λΆλ λͺ μΈλμ΄ μμ§ μλ€.
배리μ΄μμ λΈλ‘ νλ μ€λ λκ° κ°μ νλ‘μΈμ± μμμ μ¬μ©ν μκ²©μ΄ μλ μ΄λ λ ΌλΈλ‘ μ€λ λμ λν΄μλ κ·Έ μ€νμ΄ μ΅μ’ μ μΌλ‘ μ μ§νμ§ λͺ»νκ² λ§μ§ μλλ€. νλ‘μΈμ± μμμ λν μ격μ μ€μΌμ€λ§ μ μ± μ λ°λΌ μ ν΄μ§λ€.
μ±κ³΅ μλ£ μ pthread_barrier_wait()
ν¨μλ 배리μ΄μ λκΈ°ν λ (μμμ) ν μ€λ λμκ² PTHREAD_BARRIER_SERIAL_THREAD
λ₯Ό λ°ννκ³ λ€λ₯Έ μ€λ λλ€ κ°κ°μκ² 0μ λ°ννλ€. μλλ©΄ μ€λ₯λ₯Ό λνλ΄λ μ€λ₯ λ²νΈλ₯Ό λ°ννλ€.
μ΄ ν¨μλ μ€λ₯ μ½λ [EINTR]
μ λ°ννμ§ μλλ€.
μ΄νλ κ·λ²μ μ΄μ§ μμ λ΄μ©μ΄λ€.
μμ.
μ΄ ν¨μλ₯Ό μ°λ μμ©μμ POSIX.1-2008 Base Definitions κΆμ 3.287μ Priority Inversionμμ λ Όμνλ μ°μ μμ μμ μ κ²ͺμ μ μλ€.
pthread_barrier_wait()
μ barrier
μΈμλ‘ μ§μ ν κ°μ΄ μ΄κΈ°ν λ λ°°λ¦¬μ΄ κ°μ²΄λ₯Ό κ°λ¦¬ν€κ³ μμ§ μμμ ꡬνμμ κ°μ§νλ κ²½μ° ν¨μλ₯Ό μ€ν¨ μ²λ¦¬νκ³ [EINVAL]
μ€λ₯λ₯Ό λ³΄κ³ νκΈ°λ₯Ό κΆμ₯νλ€.
μμ.
POSIX.1-2008 Base Definitions κΆ, 3.287μ Priority Inversion, 4.11μ Memory Synchronization, <pthread.h>
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
2013