¾²·¹µå µ¿±âÈ­
 FrontPage|FindPage|TitleIndex|RecentChanges|UserPreferences E D R S P I M H RSS

¼Ò¼³Ã³·³ ÀÐÈ÷´Â ÇÁ·Î±×·¡¹Ö¼Õ½¬¿î ¹ö±× ÃßÀû¹ý¼Õ½¬¿î ¼ÒÇÁÆ®¿þ¾î ½ºÄÉÁÙ °ü¸®¹ý¼öÁýµÈ ÀÚ·á¾²·¹µå °øºÎÇϱ⠛ ¾²·¹µå µ¿±âÈ­
Contents:
1 ¾²·¹µå µ¿±âÈ­ (Thread Synchronization)
1.1 À¯Àú ¸ðµå (User Mode) ¿Í Ä¿³Î ¸ðµå (Kernel Mode)
1.2 À¯Àú ¸ðµå¿¡¼­ÀÇ µ¿±âÈ­ (Synchronization in User Mode)
1.3 Ä¿³Î ¸ðµå¿¡¼­ÀÇ µ¿±âÈ­ (Synchronization in Kernel Mode )
2 µ¿±âÈ­ ¿ÀºêÁ§Æ®
2.1 CRITICAL_SECTION
2.2 Mutex (Mutual Exclusion)
2.3 Semaphore
2.4 Event


1 ¾²·¹µå µ¿±âÈ­ (Thread Synchronization) #


1.1 À¯Àú ¸ðµå (User Mode) ¿Í Ä¿³Î ¸ðµå (Kernel Mode) #


Windows ÇÁ·Î±×·¥Àº ÀϹÝÀûÀ¸·Î ÀÌÁß ¸ðµå ¿¬»ê (Dual-Mode Operation) ¿¡ ÀÇÇÏ¿© ½ÇÇàµÈ´Ù. À¯Àú ¸ðµå¿Í Ä¿³Î ¸ðµå·Î ±¸¼ºµÇ¾î ÀÖÀ¸¸ç, À¯Àú ¸ðµå´Â ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ±âº» ¸ðµå·Î Á¢±ÙÇÒ ¼ö ÀÖ´Â ¸Þ¸ð¸® Á¦ÇÑ, ¹°¸®ÀûÀÎ ¿µ¿ª ( Çϵå¿þ¾î ) ÀÇ Á÷Á¢ Á¢±ÙÀÌ Çã¿ëµÇÁö ¾Ê´Â´Ù. Ä¿³Î ¸ðµå´Â ¸®¼Ò½º Á¢±Ù, Çϵå¿þ¾î Á¢±ÙÀÌ °¡´ÉÇÏ´Ù.

1.2 À¯Àú ¸ðµå¿¡¼­ÀÇ µ¿±âÈ­ (Synchronization in User Mode) #


À¯Àú ¸ðµå µ¿±âÈ­ ±â¹ýÀº CRITICAL_SECTION ¿ÀºêÁ§Æ® ( Object ) ¸¦ »ç¿ëÇÑ´Ù. À¯Àú ¸ðµå¿¡¼­ µ¿±âÈ­°¡ ÀÌ·ç¾îÁö¹Ç·Î Ä¿³Î ¸ðµå Àüȯ¿¡ ´ëÇÑ ºÎ´ãÀÌ ¾øÁö¸¸ Ä¿³Î ¸ðµå µ¿±âÈ­ ±â¹ý¿¡ ºñÇØ Á¦ÇÑµÈ ±â´É¸¸ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ( ´ÜÀÏ ÇÁ·Î¼¼½º¿¡¼­¸¸ »ç¿ë °¡´ÉÇÏ´Ù. )

1.3 Ä¿³Î ¸ðµå¿¡¼­ÀÇ µ¿±âÈ­ (Synchronization in Kernel Mode ) #


Ä¿³Î ¸ðµå µ¿±âÈ­ ±â¹ýÀº ´Ù¸¥ ÇÁ·Î¼¼½º ¾È¿¡ Á¸ÀçÇÏ´Â ¾²·¹µåµé°£ÀÇ µ¿±âÈ­°¡ °¡´ÉÇÏ´Ù. À¯Àú ¸ðµå µ¿±âÈ­ ±â¹ýÀº Deadlock ¹ß»ý °¡´É¼ºÀÌ ÀÖÁö¸¸ Ä¿³Î ¸ðµå µ¿±âÈ­ ±â¹ý¿¡¼­´Â Deadlock À» ¹æÁöÇϱâ À§ÇÏ¿© ŸÀÓ ¾Æ¿ôÀ» ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. Ä¿³Î ¸ðµå µ¿±âÈ­ ±â¹ýÀº Event, Semaphore, Mutex ¿ÀºêÁ§Æ®¸¦ »ç¿ëÇϸç, À̵éÀº ¸ðµÎ Ä¿³Î ¿ÀºêÁ§Æ® ÀÌ´Ù.


2 µ¿±âÈ­ ¿ÀºêÁ§Æ® #


2.1 CRITICAL_SECTION #


À¯Àú ¸ðµå µ¿±âÈ­ ±â¹ýÀ¸·Î ´ÜÀÏ ÇÁ·Î¼¼½º¿¡¼­¸¸ »ç¿ëµÈ´Ù. ( Ä¿³Î ¿ÀºêÁ§Æ®°¡ ¾Æ´Ï´Ù. )

ÇÔ ¼ö ¼³ ¸í
InitializeCriticalSection Initializes a critical section object.
InitializeCriticalSectionAndSpinCountInitializes a critical section object and sets the spin count for the critical section.
EnterCriticalSection Waits for ownership of the specified critical section object.
LeaveCriticalSection Releases ownership of the specified critical section object.
DeleteCriticalSection Releases all resources used by an unowned critical section object.
SetCriticalSectionSpinCount Sets the spin count for the specified critical section.
TryEnterCriticalSection Attempts to enter a critical section without blocking.

2.2 Mutex (Mutual Exclusion) #


Ä¿³Î ¿ÀºêÁ§Æ®·Î CRITICAL_SECTION °ú ºñ½ÁÇÑ ¹æ¹ýÀ¸·Î »ç¿ëÇÑ´Ù.

ÇÔ ¼ö ¼³ ¸í
CreateMutex Creates or opens a named or unnamed mutex object.
bInitialOwner - FALSE ·Î Àü´ÞÇϸé Mutex ¼ÒÀ¯ÀÚ°¡ Á¸ÀçÇÏÁö ¾ÊÀ¸¸ç Signaled »óŰ¡ µÈ´Ù.
OpenMutex Opens an existing named mutex object.
ReleaseMutexReleases ownership of the specified mutex object.

Mutex ¿ÀºêÁ§Æ®´Â ¼ÒÀ¯ÀÚ°¡ Á¸ÀçÇÒ °æ¿ì Non-Signaled »óÅÂ, ¼ÒÀ¯ÀÚ°¡ Á¸ÀçÇÏÁö ¾ÊÀ» °æ¿ì Signaled »óŰ¡ µÇ´Â Ä¿³Î ¿ÀºêÁ§Æ®ÀÌ´Ù.

2.3 Semaphore #


ÇÔ ¼ö ¼³ ¸í
CreateSemaphore Creates or opens a named or unnamed semaphore object.
OpenSemaphore Opens an existing named semaphore object.
ReleaseSemaphoreIncreases the count of the specified semaphore object by a specified amount.

2.4 Event #


ÇÔ ¼ö ¼³ ¸í
CreateEventCreates or opens a named or unnamed event object.
OpenEvent Opens an existing named event object.
PulseEvent Sets the specified event object to the signaled state and then resets it to the nonsignaled state after releasing the appropriate number of waiting threads.
ResetEvent Sets the specified event object to the nonsignaled state.
SetEvent Sets the specified event object to the signaled state.



SubCategorySystem

EditText|FindPage|DeletePage|LikePages| Valid XHTML 1.0! Valid CSS! powered by MoniWiki