Boost C++ Libraries: Ticket #4773: boost::this_thread::sleep(Microsecond Resolution) https://svn.boost.org/trac10/ticket/4773 <p> You cannot manage a thread for a process that needs to update at once per millisecond when the resolution of waiting is this low. If a process takes 3 microseconds you can wait arbitrarily for 1.003ms. </p> <p> If you expand this arbitrary method to a process that takes 0997micro seconds to complete you can spend 1.997ms running a cycle making a process run at half the speed required. </p> <p> Game Logic and any process that needs to respond on the millisecond has to poll currently and only be timed to account for lag in any well written software it is good practice and economical to wait where appropriate. You can waste 0.999% of a second of energy per second per thread otherwise. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4773 Trac 1.4.3 viboes Thu, 28 Oct 2010 18:03:38 GMT type changed https://svn.boost.org/trac10/ticket/4773#comment:1 https://svn.boost.org/trac10/ticket/4773#comment:1 <ul> <li><strong>type</strong> <span class="trac-field-old">Patches</span> → <span class="trac-field-new">Feature Requests</span> </li> </ul> <p> Moved to Feature request as there is no patch attached. </p> Ticket viboes Wed, 17 Nov 2010 20:24:49 GMT cc set https://svn.boost.org/trac10/ticket/4773#comment:2 https://svn.boost.org/trac10/ticket/4773#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> </ul> <p> Please could you provide a test that helps to clearly identify the issue? In this way you will help the Boost community. </p> Ticket dominicstreeter@… Thu, 18 Nov 2010 09:52:20 GMT <link>https://svn.boost.org/trac10/ticket/4773#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4773#comment:3</guid> <description> <p> I am afraid that this ticket is somewhat redundant. The issue was I believed that microsecond timing was necessary to control millisecond interactions precisely on standard hardware. </p> <p> The reason there is no microsecond timing despite the resolution being addressable now is because even windows 7 professional does not manage or support control of threading on a microsecond level. Its an inherent limitation of the way the operating system is designed. I don't imagine any OS designed for standard commercial use has this as a standard resolution because not all hardware has a high performance counter and so it would be bad practice to try and use such a counter for generic timing. I also found ways around the limitation despite being mildly less precise and efficient they work perfectly. The only real method available is a spin lock cycle. </p> <p> I apologise for the confusion! In future tickets I will also provide an example application to try and explain the issue. </p> <p> Thank you for your time! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 27 Nov 2010 16:15:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4773#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4773#comment:4</guid> <description> <p> I guess you are not requesting the library to use spin locks when waiting for some thing to occur. You can do it yourself. </p> <p> If I've understood we can close the ticket, isn't it? </p> </description> <category>Ticket</category> </item> <item> <author>dominicstreeter@…</author> <pubDate>Sat, 27 Nov 2010 17:37:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4773#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4773#comment:5</guid> <description> <p> Yes close the ticket by all means. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 02 Dec 2011 05:36:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4773#comment:6 https://svn.boost.org/trac10/ticket/4773#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> See also <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6195" title="#6195: Feature Requests: c++11 compliance: Provide the standard time related interface using ... (closed: fixed)">#6195</a> Provide the standard time related interface using Boost.Chrono </p> Ticket