{"id":32943,"date":"2005-12-16T10:00:10","date_gmt":"2005-12-16T10:00:10","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/12\/16\/when-hyperthreading-is-enabled-all-the-processors-are-virtual\/"},"modified":"2005-12-16T10:00:10","modified_gmt":"2005-12-16T10:00:10","slug":"when-hyperthreading-is-enabled-all-the-processors-are-virtual","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20051216-10\/?p=32943","title":{"rendered":"When hyperthreading is enabled, all the processors are virtual"},"content":{"rendered":"<p>A common problem when answering technical questions is that people sometimes ask a question that can&#8217;t or shouldn&#8217;t be answered because it is based upon a misunderstanding. What&#8217;s particularly frustrating is when they <strong>insist<\/strong> that you answer their question as posed, even when you try to explain to them that their question is itself flawed.<\/p>\n<p> It&#8217;s as if somebody asked you the question, &#8220;Do I have to use the remote control to lock my kangaroo?&#8221; You could answer the question literally (&#8220;No&#8221;), but the person asking the question would walk away with the wrong conclusion (&#8220;Wow, kangaroos are self-locking!&#8221;). <a href=\"http:\/\/blogs.msdn.com\/rflaming\/\"> Robert Flaming<\/a> recalls <a href=\"http:\/\/blogs.msdn.com\/rflaming\/archive\/2005\/10\/01\/476154.aspx\"> a similar analogy I made with balsa wood and nails<\/a>. <\/p>\n<p> Here&#8217;s an example of a question that betrays misunderstanding. <\/p>\n<blockquote class=\"m\"><p> I just enabled hyperthreading on my dual-Xenon machine, and Task Manager now shows four processors instead of two. Which of them are the physical processors and which are the virtual ones? <\/p><\/blockquote>\n<p> When you turn on hyperthreading, each individual physical processor acts as if it were two virtual processors. From Task Manager&#8217;s point of view, the computer has four virtual processors. The two virtual processors associated with each physical processor are completely equivalent. It&#8217;s not like one is physical and one is virtual. They are both virtual and compete equally for a share of the one physical CPU. When you set processor affinities, you set them to virtual processors. <\/p>\n<p> To find out which virtual processors are associated with the same physical processor, you can call <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/dllproc\/base\/getlogicalprocessorinformation.asp\"> the <code>GetLogicalProcessorInformation<\/code> function<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common problem when answering technical questions is that people sometimes ask a question that can&#8217;t or shouldn&#8217;t be answered because it is based upon a misunderstanding. What&#8217;s particularly frustrating is when they insist that you answer their question as posed, even when you try to explain to them that their question is itself flawed. [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-32943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>A common problem when answering technical questions is that people sometimes ask a question that can&#8217;t or shouldn&#8217;t be answered because it is based upon a misunderstanding. What&#8217;s particularly frustrating is when they insist that you answer their question as posed, even when you try to explain to them that their question is itself flawed. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/32943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=32943"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/32943\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=32943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=32943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=32943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}