<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Reading Notebook: 18-August-09</title>
	<atom:link href="http://www.softwaregeneralist.com/2009/08/18/reading-notebook-18-august-09/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwaregeneralist.com/2009/08/18/reading-notebook-18-august-09/</link>
	<description>Connecting Software with Engineering, Science, Religion, Philosophy and Politics</description>
	<pubDate>Tue, 07 Feb 2012 23:41:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Dmitry Vostokov</title>
		<link>http://www.softwaregeneralist.com/2009/08/18/reading-notebook-18-august-09/#comment-179</link>
		<dc:creator>Dmitry Vostokov</dc:creator>
		<pubDate>Wed, 19 Aug 2009 22:58:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=70#comment-179</guid>
		<description>Thanks for clarification!
Dmitry</description>
		<content:encoded><![CDATA[<p>Thanks for clarification!<br />
Dmitry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Ionescu</title>
		<link>http://www.softwaregeneralist.com/2009/08/18/reading-notebook-18-august-09/#comment-175</link>
		<dc:creator>Alex Ionescu</dc:creator>
		<pubDate>Tue, 18 Aug 2009 14:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=70#comment-175</guid>
		<description>Keep in mind that handles must be multiples of 4, since the bottom 2 bits are sometimes used to contain Win32 flags associated with the underlying object (such as for file objects and completion ports).

Also, your calculation is slightly incorrect:

- First, the mid-level table has enough to store a "full page's worth of pointers", quoting from the book. PAGE_SIZE / 4 (for x86) is 1024 entries, not 512.
- Secondly, in order to maintain compatibility with Windows 2000, the amount of high-level tables is artificially constricted to the minimum required to describe Windows 2000's limit (256^3 ~ 16 million) based on the amount of handles described by mid and low level tables on the system. In this case, for x86, that number would be 32.

You can use the following definitions for a more "abstract" understanding:

#define LOW_LEVEL_ENTRIES   (PAGE_SIZE / sizeof(HANDLE_TABLE_ENTRY))
#define MID_LEVEL_ENTRIES   (PAGE_SIZE / sizeof(PHANDLE_TABLE_ENTRY))
#define HIGH_LEVEL_ENTRIES  (16777216 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES))

Regarding point #2, the book is unclear about this fact, and I will make sure that it is updated for the next edition -- nowhere is it explained why the limit is still 16 million even though theoretically, x86 could have much larger handle values.

--
Best regards,
Alex Ionescu</description>
		<content:encoded><![CDATA[<p>Keep in mind that handles must be multiples of 4, since the bottom 2 bits are sometimes used to contain Win32 flags associated with the underlying object (such as for file objects and completion ports).</p>
<p>Also, your calculation is slightly incorrect:</p>
<p>- First, the mid-level table has enough to store a &#8220;full page&#8217;s worth of pointers&#8221;, quoting from the book. PAGE_SIZE / 4 (for x86) is 1024 entries, not 512.<br />
- Secondly, in order to maintain compatibility with Windows 2000, the amount of high-level tables is artificially constricted to the minimum required to describe Windows 2000&#8217;s limit (256^3 ~ 16 million) based on the amount of handles described by mid and low level tables on the system. In this case, for x86, that number would be 32.</p>
<p>You can use the following definitions for a more &#8220;abstract&#8221; understanding:</p>
<p>#define LOW_LEVEL_ENTRIES   (PAGE_SIZE / sizeof(HANDLE_TABLE_ENTRY))<br />
#define MID_LEVEL_ENTRIES   (PAGE_SIZE / sizeof(PHANDLE_TABLE_ENTRY))<br />
#define HIGH_LEVEL_ENTRIES  (16777216 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES))</p>
<p>Regarding point #2, the book is unclear about this fact, and I will make sure that it is updated for the next edition &#8212; nowhere is it explained why the limit is still 16 million even though theoretically, x86 could have much larger handle values.</p>
<p>&#8211;<br />
Best regards,<br />
Alex Ionescu</p>
]]></content:encoded>
	</item>
</channel>
</rss>

