This shows you the differences between two versions of the page.
|
so:laboratoare:laborator-09 [2022/03/02 09:35] teodor_stefan.dutu [Exerciții] Move Github suggestions here |
so:laboratoare:laborator-09 [2022/05/06 13:38] (current) costin.carabas [Exercițiul 6 - Barrier] |
||
|---|---|---|---|
| Line 858: | Line 858: | ||
| | Incrementarea unui semafor | ''sem_post'' | [[#incrementarea|ReleaseSemaphore]] | | | Incrementarea unui semafor | ''sem_post'' | [[#incrementarea|ReleaseSemaphore]] | | ||
| | Distrugerea unui semafor | ''sem_destroy''/''sem_close'' | [[#distrugerea1|CloseHandle]] | | | Distrugerea unui semafor | ''sem_destroy''/''sem_close'' | [[#distrugerea1|CloseHandle]] | | ||
| - | | Thread Local Storage | [[https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html|__thread]] | [[#thread_local_storage|TlsAlloc, TlsSetValue, TlsGetValue, TlsFree]] | | + | | Thread Local Storage | [[https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html|__thread]], [[https://linux.die.net/man/3/pthread_key_create|pthread_key_create]], [[https://linux.die.net/man/3/pthread_setspecific|pthread_setspecific]], [[https://linux.die.net/man/3/pthread_getspecific|pthread_getspecific]], [[https://linux.die.net/man/3/pthread_key_delete|pthread_key_delete]] | [[#thread_local_storage|TlsAlloc, TlsSetValue, TlsGetValue, TlsFree]] | |
| Line 932: | Line 932: | ||
| typedef struct { | typedef struct { | ||
| HANDLE hGuard; /* mutex to protect internal variable access */ | HANDLE hGuard; /* mutex to protect internal variable access */ | ||
| - | HANDLE hEvent; /* auto-resetable event */ | + | HANDLE hEvent; /* manual resetable event */ |
| DWORD dwCount; /* number of threads to have reached the barrier */ | DWORD dwCount; /* number of threads to have reached the barrier */ | ||
| DWORD dwThreshold; /* barrier limit */ | DWORD dwThreshold; /* barrier limit */ | ||