<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Mon, 17 Aug 2026 11:43:16 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Rob Harris - 2009-07-15 14:17:50</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>&lt;b&gt;Best&lt;/b&gt; write-up on "volatile" I've read.  "Easy to fix!" false-starts made me laugh out loud.</description><guid isPermaLink="true">912ce61296c3c13802ccc4e95c7912dc</guid><pubDate>Wed, 15 Jul 2009 14:17:50 GMT</pubDate></item><item><title>mikeash - 2009-07-14 22:38:02</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>It would make no difference. It's still a different value in memory, even if it's part of the same struct. The "as if" rule remains unchanged. The compiler can still make these assignments happen in any order and the result is still "as if" they happened in the order specified by the program.</description><guid isPermaLink="true">d9e37e0d532d6b2f62cb8aa225d4dc65</guid><pubDate>Tue, 14 Jul 2009 22:38:02 GMT</pubDate></item><item><title>Anonymous - 2009-07-14 19:50:39</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>Excellent series, Mike. One question (that may reveal my ignorance of such things): in the block
&lt;br /&gt;
&lt;br /&gt;gSharedStructure.foo = ...;
&lt;br /&gt;gSharedStructure.bar = ...;
&lt;br /&gt;gSharedStructure.baz = ...;
&lt;br /&gt;gFlag = 1;
&lt;br /&gt;
&lt;br /&gt;would changing the gFlag variable to be part of the structure be enough to make gFlag have the "dependency" on the structure, and thus solve the problem?</description><guid isPermaLink="true">1ac49ace605dc0cd48826661598ae03a</guid><pubDate>Tue, 14 Jul 2009 19:50:39 GMT</pubDate></item><item><title>mikeash - 2009-07-11 08:14:01</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>Lockless shared data can be really nice if you do it right. It's just extremely tricky. Certainly it makes a great case for avoiding it if you don't need it, and for minimizing it as much as you can when you do. However, if you can restrict the shared-data code to a single piece of the app (e.g. a reusable data structure) then it's much more sane. You still have to be really really careful in that one section, but once it's up and running you can then use the API it exposes without any worry.</description><guid isPermaLink="true">974726078c3e3fb104d65ee9f8c0bff6</guid><pubDate>Sat, 11 Jul 2009 08:14:01 GMT</pubDate></item><item><title>Carl Harris - 2009-07-11 05:57:47</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>@Carl Harris:  s/no much/now much/
&lt;br /&gt;</description><guid isPermaLink="true">363316ad440ba68bc58a6b60620e8674</guid><pubDate>Sat, 11 Jul 2009 05:57:47 GMT</pubDate></item><item><title>Carl Harris - 2009-07-11 05:56:56</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>Excellent series!  The details around interleaving and "as if" in both the compiler and the hardware have always been a bit of mystery to me -- no much less so!  Of course, the whole of part 3 makes an outstanding case for avoiding the use of lockless shared data altogether.  :-)</description><guid isPermaLink="true">9adbb8f316f72cbed8d39daf646a0381</guid><pubDate>Sat, 11 Jul 2009 05:56:56 GMT</pubDate></item><item><title>natevw - 2009-07-11 01:55:03</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>@mikeash: Thanks, this series has been quite interesting and will be a helpful reference in the future too!
&lt;br /&gt;
&lt;br /&gt;@Steve Madsen:
&lt;br /&gt;I suspect you might be right, the combination of new language syntax and a helpful runtime in GCD may have a profound influence on many programming tasks. There's a "Technology Brief" linked from the bottom right of the Grand Central marketing blurb here, if you hadn't seen it:
&lt;br /&gt;&lt;a href="http://www.apple.com/macosx/technology/#grandcentral"&gt;http://www.apple.com/macosx/technology/#grandcentral&lt;/a&gt;
&lt;br /&gt;</description><guid isPermaLink="true">2d7fb9682ec33c934eca2583a45d372c</guid><pubDate>Sat, 11 Jul 2009 01:55:03 GMT</pubDate></item><item><title>Vyacheslav Zakovyrya - 2009-07-11 00:52:13</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>Thanks for this. One more reason to use message passing concurrency to avoid all these troubles</description><guid isPermaLink="true">a5236aa0b3becf0fed7b259eb55d341b</guid><pubDate>Sat, 11 Jul 2009 00:52:13 GMT</pubDate></item><item><title>Steve Madsen - 2009-07-10 22:06:16</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2009-07-10-type-specifiers-in-c-part-3.html#comments</link><description>This was an excellent series. This week's brought a smile to my face, having spent several years writing network kernel code and device drivers, sometimes learning the hard way about volatile, memory barriers and instruction reordering.
&lt;br /&gt;
&lt;br /&gt;I don't have the Developer Preview, but I'd put money down that Grand Central in Snow Leopard is going to turn me into an old man ("In my day...").</description><guid isPermaLink="true">54ad41de0e1745dd95489778f9370baf</guid><pubDate>Fri, 10 Jul 2009 22:06:16 GMT</pubDate></item></channel></rss>
