{"id":391,"date":"2012-08-18T10:50:10","date_gmt":"2012-08-18T01:50:10","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=391"},"modified":"2014-02-06T23:42:35","modified_gmt":"2014-02-06T14:42:35","slug":"sleepex%e3%81%a8queueuserapc%e3%81%ae%e5%89%b2%e3%82%8a%e8%be%bc%e3%81%bf%e3%83%91%e3%83%95%e3%82%a9%e3%83%bc%e3%83%9e%e3%83%b3%e3%82%b9","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/try\/391\/","title":{"rendered":"SleepEx\u3068QueueUserAPC\u306e\u5272\u308a\u8fbc\u307f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9"},"content":{"rendered":"<h2 id=\"content_1_0\">SleepEx  <a class=\"anchor_super\" id=\"l534ec84\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-07-13#l534ec84\" title=\"l534ec84\"> <\/a><\/h2>\n<p><a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpdllpro\/html\/_win32_sleepex.asp\" rel=\"nofollow\">MSDN<\/a>\u3092\u5f15\u7528\u3055\u305b\u3066\u3082\u3089\u3046\u3068\u3001SleepEx\u306f<\/p>\n<blockquote>\n<p class=\"quotation\">\u73fe\u5728\u306e\u30b9\u30ec\u30c3\u30c9\u3092\u4e2d\u65ad\u3057\u307e\u3059\u3002\u6b21\u306e\u6761\u4ef6\u306e\u3044\u305a\u308c\u304b\u304c\u6e80\u305f\u3055\u308c\u308b\u3068\u3001\u5b9f\u884c\u3092\u518d\u958b\u3057\u307e\u3059\u3002<br \/>\n\u2022I\/O \u5b8c\u4e86\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u3002<br \/>\n\u2022\u975e\u540c\u671f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u30b3\u30fc\u30eb\uff08APC\uff09\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u3001\u30b9\u30ec\u30c3\u30c9\u306e ACP \u30ad\u30e5\u30fc\u306b\u7f6e\u304b\u308c\u305f\u3002<br \/>\n\u2022\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u304c\u7d4c\u904e\u3057\u305f\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3042\u308b\u3002<!--more-->\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u51e6\u7406\u306a\u3069\u3067\u5b9a\u671f\u7684\u306b\u4f55\u304b\u3092\u3057\u305f\u3044\u6642\u306b\u3001Sleep\u3092\u4f7f\u3063\u3066\u305d\u308c\u3092\u884c\u3046\u3068\u3044\u3046\u65b9\u6cd5\u304c\u3042\u308b\u304c\u3001\u305f\u307e\u306b\u9014\u4e2d\u3067Sleep\u3092\u4e2d\u65ad\u3057\u305f\u3044\u6642\u304c\u3042\u308b\u3002\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u306f\u3053\u3061\u3089\u306e\u65b9\u304c\u3088\u3044\u3002<\/p>\n<p>\u3055\u3066\u4e2d\u65ad\u3059\u308b\u65b9\u6cd5\u3067\u3042\u308b\u304c\u3001\u4e0a\u306e\u5f15\u7528\u306e\u901a\u308aI\/O \u5b8c\u4e86\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570(ReadFileEx\u3084WriteFileEx)\u3084APC\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u304a\u304b\u308c\u305f\u5834\u5408\u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">QueueUserAPC  <a class=\"anchor_super\" id=\"s8e11675\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-07-13#s8e11675\" title=\"s8e11675\"> <\/a><\/h2>\n<p>\u3053\u3061\u3089\u3082<a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpdllpro\/html\/_win32_queueuserapc.asp\" rel=\"nofollow\">MSDN<\/a>\u3092\u5f15\u7528\u3055\u305b\u3066\u3082\u3089\u3063\u3066<\/p>\n<blockquote>\n<p class=\"quotation\">\u30e6\u30fc\u30b6\u30fc\u30e2\u30fc\u30c9\u975e\u540c\u671f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u547c\u3073\u51fa\u3057\uff08APC\uff09\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u3001\u6307\u5b9a\u3057\u305f\u30b9\u30ec\u30c3\u30c9\u306e APC \u30ad\u30e5\u30fc\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u3053\u308d\u3067\u3001\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u30e2\u30fc\u30c9\u306f\u4f55\u304b\u3068\u3044\u3046\u3068\u3001Windows\u306b\u306f\u30ab\u30fc\u30cd\u30eb\u30e2\u30fc\u30c9\u3068\u30e6\u30fc\u30b6\u30fc\u30e2\u30fc\u30c9\u304c\u3042\u308b\u3002\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u304c\u6271\u3048\u308b\u30e1\u30e2\u30ea\u30fb\u30ea\u30bd\u30fc\u30b9\u306a\u3069\u304c\u52d5\u3044\u3066\u3044\u308b\u30e2\u30fc\u30c9\u304c\u30e6\u30fc\u30b6\u30fc\u30e2\u30fc\u30c9\u3068\u3044\u3046\u308f\u3051\u3067\u3042\u308b\u3002\u3064\u307e\u308a\u5b89\u5168\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u5272\u308a\u8fbc\u307f\u3092\u3059\u308b\u4ed5\u7d44\u307f\u304c\u3053\u306eAPC(Asynchronous Procedure Call)\u306a\u306e\u3067\u3042\u308b\u3002<\/p>\n<p>\u3055\u3066\u3001\u5148\u307b\u3069\u306eSleepEx\u306fAPC\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u304a\u304b\u308c\u305f\u5834\u5408\u629c\u3051\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u306e\u3053\u3068\u3067\u3042\u3063\u305f\u304c\u3001QueueUserAPC\u306b\u3088\u308a\u305d\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_2\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6e2c\u5b9a  <a class=\"anchor_super\" id=\"p4e08dae\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-07-13#p4e08dae\" title=\"p4e08dae\"> <\/a><\/h2>\n<p>\u3055\u3066\u3001\u4e0a\u8a18SleepEx\u3068QueueUserAPC\u306e\u30b3\u30f3\u30d3\u30cd\u30fc\u30b7\u30e7\u30f3\u306b\u304b\u304b\u308b\u6f14\u7b97\u91cf\u3092<a href=\"http:\/\/soundengine.jp\/wordpress\/tips\/?p=361\">rdtsc(Read Time Stamp Counter)<\/a>\u3067\u6e2c\u3063\u3066\u307f\u305f\u3002<\/p>\n<p>\u30b3\u30fc\u30c9\u7684\u306b\u306f\u3001\u30a2\u30e9\u30fc\u3068\u53ef\u80fd\u306aSleepEx\u3068<\/p>\n<pre>SleepEx( INFINITE, TRUE );<\/pre>\n<p>\u4f55\u306e\u4e2d\u8eab\u306e\u306a\u3044\u95a2\u6570\u3092\u547c\u3076QueueUserAPC\u3067\u3042\u308b<\/p>\n<pre>QueueUserAPC( EmptyUserAPC, hThread, dwData );<\/pre>\n<p>\u3053\u308c\u3092100\u56de\u8a66\u884c\u3057\u3066\u305d\u306e\u5e73\u5747\u5024\u3068\u4e2d\u592e\u5024\u3092\u53d6\u3063\u3066\u307f\u305f\u3002\u7d50\u679c\u306f\u6b21\u306e\u901a\u308a\u3002<\/p>\n<div class=\"ie5\">\n<table class=\"style_table\" border=\"0\" cellspacing=\"1\">\n<tbody>\n<tr>\n<td class=\"style_td\">\u5e73\u5747\u5024<\/td>\n<td class=\"style_td\">36614<\/td>\n<\/tr>\n<tr>\n<td class=\"style_td\">\u4e2d\u592e\u5024<\/td>\n<td class=\"style_td\">21879<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u3055\u3066\u3001\u3053\u308c\u304c\u3069\u306e\u3050\u3089\u3044\u6f14\u7b97\u306b\u5f71\u97ff\u3059\u308b\u3082\u306e\u306a\u306e\u304b\u3068\u3044\u3046\u3068\u5b9f\u969b\u5927\u3057\u305f\u3053\u3068\u306f\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u304c\u308f\u304b\u308b\u3002\u6b21\u306e\u7a7a\u306e\u30eb\u30fc\u30d7\u3068\u540c\u3058\u3050\u3089\u3044\u306e\u6f14\u7b97\u30b3\u30b9\u30c8\u3067\u3042\u308b\u3002\u3053\u308c\u304c\u5927\u4f5321400\u3050\u3089\u3044\u3067\u3042\u3063\u305f\u3002<\/p>\n<pre>for( volatile int m = 0; m &lt; 3000; m++ )\r\n{\r\n}<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001Sleep( 1000 )\u3068\u3057\u3066rdtsc\u3092\u6e2c\u308b\u30682399873221.8\u3068\u306a\u308a\u307b\u307c\u30de\u30b7\u30f3\u306e\u5468\u6ce2\u6570(2.4GHz)\u3068\u540c\u3058\u306b\u306a\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SleepEx MSDN\u3092\u5f15\u7528\u3055\u305b\u3066\u3082\u3089\u3046\u3068\u3001SleepEx\u306f \u73fe\u5728\u306e\u30b9\u30ec\u30c3\u30c9\u3092 &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/try\/391\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-try"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":5,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":3295,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/391\/revisions\/3295"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}