在C 11
,將線程 - 本地變量的單獨副本分配給了它。 These variables can be accessed by all threads, but any modifications made to a particular thread-local variable are only visible to the thread that created it.
Thread-local variables add a new storage duration category to the existing ones:Automatic (exists within a function or block)Static (exists for the lifetime of the program)
Dynamic (allocated on the heap)
Thread-local (exists for the lifetime of a specific thread)
免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3