• <i id='lQrut'><tr id='lQrut'><dt id='lQrut'><q id='lQrut'><span id='lQrut'><b id='lQrut'><form id='lQrut'><ins id='lQrut'></ins><ul id='lQrut'></ul><sub id='lQrut'></sub></form><legend id='lQrut'></legend><bdo id='lQrut'><pre id='lQrut'><center id='lQrut'></center></pre></bdo></b><th id='lQrut'></th></span></q></dt></tr></i><div id='lQrut'><tfoot id='lQrut'></tfoot><dl id='lQrut'><fieldset id='lQrut'></fieldset></dl></div>
      <bdo id='lQrut'></bdo><ul id='lQrut'></ul>
  • <legend id='lQrut'><style id='lQrut'><dir id='lQrut'><q id='lQrut'></q></dir></style></legend>

    1. <tfoot id='lQrut'></tfoot>
    2. <small id='lQrut'></small><noframes id='lQrut'>

      1. Windows 的 Boost Mutex 实现

        Boost Mutex implementation for Windows(Windows 的 Boost Mutex 实现)

              <tbody id='Ottki'></tbody>
            <legend id='Ottki'><style id='Ottki'><dir id='Ottki'><q id='Ottki'></q></dir></style></legend><tfoot id='Ottki'></tfoot>
              <bdo id='Ottki'></bdo><ul id='Ottki'></ul>

              <small id='Ottki'></small><noframes id='Ottki'>

                <i id='Ottki'><tr id='Ottki'><dt id='Ottki'><q id='Ottki'><span id='Ottki'><b id='Ottki'><form id='Ottki'><ins id='Ottki'></ins><ul id='Ottki'></ul><sub id='Ottki'></sub></form><legend id='Ottki'></legend><bdo id='Ottki'><pre id='Ottki'><center id='Ottki'></center></pre></bdo></b><th id='Ottki'></th></span></q></dt></tr></i><div id='Ottki'><tfoot id='Ottki'></tfoot><dl id='Ottki'><fieldset id='Ottki'></fieldset></dl></div>
                  本文介绍了Windows 的 Boost Mutex 实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  据我所知,在旧版本的 Boost boost::mutex 中,Windows 的实现是使用临界区完成的.但是在 Boost 1.51 的最新版本中,我发现现在互斥锁的实现是基于事件的.

                  As far as I know in old versions of Boost boost::mutex implementation for Windows was done using critical sections. But in the newest version of Boost 1.51 I discovered that now mutex implementation is based on Events.

                  有人知道这种变化背后的原因是什么吗?是因为性能原因吗?临界区会被弃用吗?

                  Does anybody know what is the rational behind this change? Was it done because of performance reasons? Do critical sections become deprecated?

                  推荐答案

                  通过使用 boost,我们总是有最好的方法而不做任何改变,这不是很好吗?在新版本的 boost 中,boost::mutex 被实现为一个自旋锁,但在 Windows 事件的帮助下避免忙等待,并且该事件只会在需要时创建,因此它非常轻量级并且具有非常高的性能并且还使 boost 能够使用这个轻量级的 mutex 进行定时等待!我觉得这个很棒

                  Isn't it wonderful that by using boost we always have best approach with no change? In new version of boost, boost::mutex is implemented as an spinlock but with the help of a windows event to avoid busy wait and that event will only created if needed, thus it is very light weight and have a very high performance and also enable boost to use this light weight mutex for timed wait! I think this is excellent

                  这篇关于Windows 的 Boost Mutex 实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to limit the number of running instances in C++(C++中如何限制运行实例的数量)
                  Using boost::asio::async_read with stdin?(将 boost::asio::async_read 与 stdin 一起使用?)
                  How to find out what dependencies (i.e other Boost libraries) a particular Boost library requires?(如何找出特定 Boost 库需要哪些依赖项(即其他 Boost 库)?)
                  What#39;s the purpose of a leading quot;::quot; in a C++ method call(引导“::的目的是什么?在 C++ 方法调用中)
                  Boost Spirit x3: parse into structs(Boost Spirit x3:解析为结构体)
                  How boost auto-linking makes choice?(boost自动链接如何做出选择?)
                • <tfoot id='rTTeL'></tfoot>

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

                          <small id='rTTeL'></small><noframes id='rTTeL'>

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