Thread-local storage (TLS) is a computer programming method that uses static or global memory local to a thread. This is sometimes needed because all threads in a process share the same address space. In other words, data in a static or global variable is normally always located at the same memory location, when referred to by threads from the same process. Variables on the stack however are local to threads, because each thread has its own stack, residing in a different memory location.

PropertyValue
dbpprop:abstract
  • Thread-local storage (TLS) is a computer programming method that uses static or global memory local to a thread. This is sometimes needed because all threads in a process share the same address space. In other words, data in a static or global variable is normally always located at the same memory location, when referred to by threads from the same process. Variables on the stack however are local to threads, because each thread has its own stack, residing in a different memory location. Sometimes it is desirable that two threads referring to the same static or global variable are actually referring to different memory locations, thereby making the variable thread local, a canonical example being the C error code variable errno. If it is possible to make at least a memory address sized variable thread local, it is in principle possible to make arbitrarily sized memory blocks thread local, by allocating such a memory block and storing the memory address of that block in a thread local variable.
  • スレッド局所記憶(英: Thread local storage, TLS)は、静的もしくは大域的なメモリをスレッドごとに局所的に使用するためのコンピュータプログラミングの方法である。 プロセス内のスレッドはすべてアドレス空間を共有しており、同じプロセスのスレッドから参照する際、静的変数やグローバル変数は同じメモリ番地に配置される。 一方スタック上の変数はすべてのスレッドが自分のスタックを持つためスレッドに対して局所的であり、異なるメモリ番地に存在する。 同じ静的変数・グローバル変数を参照する二つのスレッドが(変数をスレッドに対して局所的にすることで)実際には異なるメモリ番地を参照できることが望ましい場合がある。たとえば典型的な例として C のエラーコードを格納する変数 errno がある。 少なくともメモリアドレスを格納できるサイズの変数をスレッドに対して局所的にすることが可能なら、メモリブロックを確保し、そのメモリアドレスをスレッドローカルな変数に格納すれば、原理的には任意のサイズのメモリブロックをスレッド局所にすることが可能である。
dbpprop:hasPhotoCollection
dbpprop:javadocSeProperty
  • ThreadLocal
  • java/lang
dbpprop:reference
dbpprop:wikiPageUsesTemplate
rdfs:comment
  • Thread-local storage (TLS) is a computer programming method that uses static or global memory local to a thread. This is sometimes needed because all threads in a process share the same address space. In other words, data in a static or global variable is normally always located at the same memory location, when referred to by threads from the same process. Variables on the stack however are local to threads, because each thread has its own stack, residing in a different memory location.
rdfs:label
  • Thread-local storage
  • スレッド局所記憶
owl:sameAs
skos:subject
foaf:page
is dbpprop:redirect of