久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <tfoot id='iAb8H'></tfoot>
        <bdo id='iAb8H'></bdo><ul id='iAb8H'></ul>
      <i id='iAb8H'><tr id='iAb8H'><dt id='iAb8H'><q id='iAb8H'><span id='iAb8H'><b id='iAb8H'><form id='iAb8H'><ins id='iAb8H'></ins><ul id='iAb8H'></ul><sub id='iAb8H'></sub></form><legend id='iAb8H'></legend><bdo id='iAb8H'><pre id='iAb8H'><center id='iAb8H'></center></pre></bdo></b><th id='iAb8H'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iAb8H'><tfoot id='iAb8H'></tfoot><dl id='iAb8H'><fieldset id='iAb8H'></fieldset></dl></div>
    2. <small id='iAb8H'></small><noframes id='iAb8H'>

      <legend id='iAb8H'><style id='iAb8H'><dir id='iAb8H'><q id='iAb8H'></q></dir></style></legend>

        C++11 中是否有并發(fā)容器?

        Are there any concurrent containers in C++11?(C++11 中是否有并發(fā)容器?)
      1. <small id='Hw0kc'></small><noframes id='Hw0kc'>

            <bdo id='Hw0kc'></bdo><ul id='Hw0kc'></ul>
              <legend id='Hw0kc'><style id='Hw0kc'><dir id='Hw0kc'><q id='Hw0kc'></q></dir></style></legend>

              <tfoot id='Hw0kc'></tfoot>
              1. <i id='Hw0kc'><tr id='Hw0kc'><dt id='Hw0kc'><q id='Hw0kc'><span id='Hw0kc'><b id='Hw0kc'><form id='Hw0kc'><ins id='Hw0kc'></ins><ul id='Hw0kc'></ul><sub id='Hw0kc'></sub></form><legend id='Hw0kc'></legend><bdo id='Hw0kc'><pre id='Hw0kc'><center id='Hw0kc'></center></pre></bdo></b><th id='Hw0kc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Hw0kc'><tfoot id='Hw0kc'></tfoot><dl id='Hw0kc'><fieldset id='Hw0kc'></fieldset></dl></div>

                    <tbody id='Hw0kc'></tbody>
                1. 本文介紹了C++11 中是否有并發(fā)容器?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  特別是,我正在尋找阻塞隊(duì)列.C ++ 11中有這樣的東西嗎?如果沒(méi)有,我的其他選擇是什么?我真的不想再深入到線程級(jí)別了.太容易出錯(cuò)了.

                  In particular, I am looking for a blocking queue. Is there such a thing in C++11? If not, what are my other options? I really don't want to go down to the thread level myself anymore. Way too error-prone.

                  推薦答案

                  根據(jù) Diego Dagum來(lái)自 Microsoft 的 Visual C++ 團(tuán)隊(duì):

                  一個(gè)反復(fù)出現(xiàn)的問(wèn)題(好吧,其中之一)是關(guān)于 STL 容器的以及它們是否是線程安全的.

                  A recurrent question (well, one of the many) is about STL containers and whether they are thread safe.

                  在這里用 Stephan 的話來(lái)說(shuō),事實(shí)是它們不是,不是作為bug 但作為一個(gè)特性:擁有每個(gè) STL 的每個(gè)成員函數(shù)容器獲取內(nèi)部鎖會(huì)破壞性能.作為一個(gè)通用的、高度可重用的庫(kù),它實(shí)際上不會(huì)提供正確性之一:放置鎖的正確級(jí)別是由程序在做什么決定.從這個(gè)意義上說(shuō),個(gè)人成員函數(shù)往往不是那么正確的級(jí)別.

                  Taking Stephan’s words here, the reality is that they aren’t, not as a bug but as a feature: having every member function of every STL container acquiring an internal lock would annihilate performance. As a general purpose, highly reusable library, it wouldn’t actually provide correctness either: the correct level to place locks is determined by what the program is doing. In that sense, individual member functions don’t tend to be such correct level.

                  并行模式庫(kù) (PPL) 包括幾個(gè)容器提供對(duì)其元素的線程安全訪問(wèn):

                  The Parallel Patterns Library (PPL) includes several containers that provide thread-safe access to their elements:

                  • concurrent_vector Class 是一個(gè)序列容器類(lèi),允許隨機(jī)訪問(wèn)任何元素.它支持并發(fā)安全的追加、元素訪問(wèn)、迭代器訪問(wèn)和迭代器遍歷操作.
                  • concurrent_queue Class 是一個(gè)序列容器類(lèi),它允許首先-in, first-out 訪問(wèn)其元素.它支持一組有限的并發(fā)安全操作,例如 push 和 try_pop,僅舉幾例.
                  • The concurrent_vector Class is a sequence container class that allows random access to any element. It enables concurrency-safe append, element access, iterator access and iterator traversal operations.
                  • The concurrent_queue Class is a sequence container class that allows first-in, first-out access to its elements. It enables a limited set of concurrency-safe operations, such as push and try_pop, to name a few.

                  一些示例此處.

                  也很有趣:http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html.

                  這篇關(guān)于C++11 中是否有并發(fā)容器?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Why do two functions have the same address?(為什么兩個(gè)函數(shù)的地址相同?)
                  Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復(fù)制構(gòu)造的?)
                  mixing templates with polymorphism(混合模板與多態(tài)性)
                  When should I use the keyword quot;typenamequot; when using templates(我什么時(shí)候應(yīng)該使用關(guān)鍵字“typename?使用模板時(shí))
                  Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標(biāo)準(zhǔn)庫(kù))
                  gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數(shù)模板,而 clang 不能)
                  <tfoot id='Ro2Ra'></tfoot>
                  • <small id='Ro2Ra'></small><noframes id='Ro2Ra'>

                  • <i id='Ro2Ra'><tr id='Ro2Ra'><dt id='Ro2Ra'><q id='Ro2Ra'><span id='Ro2Ra'><b id='Ro2Ra'><form id='Ro2Ra'><ins id='Ro2Ra'></ins><ul id='Ro2Ra'></ul><sub id='Ro2Ra'></sub></form><legend id='Ro2Ra'></legend><bdo id='Ro2Ra'><pre id='Ro2Ra'><center id='Ro2Ra'></center></pre></bdo></b><th id='Ro2Ra'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ro2Ra'><tfoot id='Ro2Ra'></tfoot><dl id='Ro2Ra'><fieldset id='Ro2Ra'></fieldset></dl></div>
                      <bdo id='Ro2Ra'></bdo><ul id='Ro2Ra'></ul>

                          <tbody id='Ro2Ra'></tbody>

                          1. <legend id='Ro2Ra'><style id='Ro2Ra'><dir id='Ro2Ra'><q id='Ro2Ra'></q></dir></style></legend>
                            主站蜘蛛池模板: 国产欧美视频在线观看 | 日本不卡一区二区 | 久久伊人国产 | 婷婷免费视频 | 久久精品小视频 | 日韩在线免费视频 | 成人av一区二区三区在线观看 | 波多野结衣乳巨码无在线观看 | 欧美日本在线观看 | 国产三级久久 | 国产人成一区二区三区影院 | 亚洲成人一区二区 | 中文字幕精品在线观看 | 日韩av一二三区 | 日本在线网站 | 视频在线一区二区 | 国产精品高清在线观看 | 国产伦精品一区二区三区四区免费 | 中文字幕一区二区三区在线观看 | 日韩精品网站 | 亚洲高清毛片一区二区 | 成人欧美视频 | 欧美激情亚洲 | 日韩黄色影院 | 黄色国产网站 | av色在线 | 欧美黄视频 | 久久精视频 | 可以看毛片的网站 | 久久久久久久网 | 亚洲欧洲综合 | 亚洲九九夜夜 | 国产精品一区在线播放 | 色综合色综合网色综合 | 日韩黄色在线观看 | 五月婷色| 欧美mv日韩mv国产 | 国产精品成人国产乱 | av不卡在线播放 | 国产一区二区日韩 | av片免费观看 |