Memory management when using threads

1) I tried to find how memory will be allocated when we use threads in the program, but cannot find the answer. Here What and where is the stack and heap? - how the stack and heap work when calling one program. But what happens when it comes to threading programs?

2) Using a parallel area OpenMP creates threads, and parallel code will be executed simultaneously in each thread. Does this allocate more memory space than memory occupied by the same code with sequential execution?

+4
source share
1 answer

, , [user-space] - , . . Linux. (OS), Windows , . OpenMP , . , , .

, , PThreads Nichols et al. (1996) enter image description here

(, , ) LLNL POSIX . .

, , , . , . OpenMP STACKSIZE ( ), , OpenMP .

/ Z (TLS): (.. ) , Thread Local Storage - - . API, , , TLS, , . TLS , . OpenMP / TLS- , THREADPRIVATE. , OpenMP THREADPRIVATE TLS , , Linux, , , .

( " ", TLS ): , , , . TLS. TLS , . ( ) CS. , , / [izing] . , Intel TBB , , TBB. , , , Intel TBB , TLS, - , , , , /object -size, Intel TBB : enter image description here

IBM AIX 7.1, . ( ) , . MALLOCOPTIONS=multiheap:3. AIX 7.1 ( ) MALLOCOPTIONS=threadcache, , Intel TBB, - , . , AIX 7.1 ( ) "Watson2" " , , , . ". ( MALLOCTYPE=Watson2.) Watson2 , Intel TBB.

(Intel TBB AIX), , , - . // . BSDcan jemalloc paper 1998 MS Research paper , . MS - ptmalloc " 11 1998 " ptmalloc : " , , 128 , , . , . , ."

+6

All Articles