<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Cross Platform Thread Local Storage</title>
	<atom:link href="http://blog.fishingcactus.com/index.php/2009/07/20/cross-platform-thread-local-storage/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fishingcactus.com/index.php/2009/07/20/cross-platform-thread-local-storage/</link>
	<description>We don't create games that look like others; we don't create games that play like others</description>
	<lastBuildDate>Tue, 07 Feb 2012 06:14:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: julien.hamaide</title>
		<link>http://blog.fishingcactus.com/index.php/2009/07/20/cross-platform-thread-local-storage/comment-page-1/#comment-2853</link>
		<dc:creator>julien.hamaide</dc:creator>
		<pubDate>Mon, 21 Dec 2009 13:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fishingcactus.com/index.php/2009/07/20/cross-platform-thread-local-storage/#comment-2853</guid>
		<description>While ending the next posts, I considered your comments.

For the assert, I agree and the improved code will include this security.

For your second thought, a shutdown is necessary for each thread. For a system where threads are static ( which is the case for most games ), I agree. But if you want to create and destroy thread on the fly, the memory used for each thread may become huge. As usual, all depends on the way the system is used.</description>
		<content:encoded><![CDATA[<p>While ending the next posts, I considered your comments.</p>
<p>For the assert, I agree and the improved code will include this security.</p>
<p>For your second thought, a shutdown is necessary for each thread. For a system where threads are static ( which is the case for most games ), I agree. But if you want to create and destroy thread on the fly, the memory used for each thread may become huge. As usual, all depends on the way the system is used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjoern Knafla</title>
		<link>http://blog.fishingcactus.com/index.php/2009/07/20/cross-platform-thread-local-storage/comment-page-1/#comment-2218</link>
		<dc:creator>Bjoern Knafla</dc:creator>
		<pubDate>Wed, 12 Aug 2009 08:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fishingcactus.com/index.php/2009/07/20/cross-platform-thread-local-storage/#comment-2218</guid>
		<description>Finally found the time to read your very useful article.

Nice idea to put your own entry array into a platform thread local storage key-slot.

Two thoughts crossed my mind:
- Perhaps add a debug static var (get/setCalled) into the class that is set to true after get/set has been called to detect if the user tries to add new slots after starting to use the TLS and assert in their constructor then. This way it would be easier to spot if a user tries to dynamically add new slots though this should only happen once at initialization time and before calling set/get (casting / assigning).

- I am undecided if I would put StartupOnThread into the Initialize function (and CleanupOnThreadExit into Finalize) to make it harder to forget them. Possibly I would just add a RAII guard to initialize the TLS system when entering main() and auto-shutdown it on leaving.

I am looking forward to your next article. Wondering if you will specialize ThreadLocalStorage for primitive types and pointers while the non-specialized version will than handle other classes/structs. Or do you prevent non-pointer qualified types to types with a sizeof greater than sizeof(void*) so you don&#039;t have to handle memory allocation yourself?

Thank you for sharing your work and finding the time to write articles about it! Highly appreciated!

Cheers,
Bjoern</description>
		<content:encoded><![CDATA[<p>Finally found the time to read your very useful article.</p>
<p>Nice idea to put your own entry array into a platform thread local storage key-slot.</p>
<p>Two thoughts crossed my mind:<br />
- Perhaps add a debug static var (get/setCalled) into the class that is set to true after get/set has been called to detect if the user tries to add new slots after starting to use the TLS and assert in their constructor then. This way it would be easier to spot if a user tries to dynamically add new slots though this should only happen once at initialization time and before calling set/get (casting / assigning).</p>
<p>- I am undecided if I would put StartupOnThread into the Initialize function (and CleanupOnThreadExit into Finalize) to make it harder to forget them. Possibly I would just add a RAII guard to initialize the TLS system when entering main() and auto-shutdown it on leaving.</p>
<p>I am looking forward to your next article. Wondering if you will specialize ThreadLocalStorage for primitive types and pointers while the non-specialized version will than handle other classes/structs. Or do you prevent non-pointer qualified types to types with a sizeof greater than sizeof(void*) so you don&#8217;t have to handle memory allocation yourself?</p>
<p>Thank you for sharing your work and finding the time to write articles about it! Highly appreciated!</p>
<p>Cheers,<br />
Bjoern</p>
]]></content:encoded>
	</item>
</channel>
</rss>

