<?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: Synchronizable objects for C++</title>
	<atom:link href="http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/</link>
	<description>A technical blog from Daniel Rákos (aka aqnuep)</description>
	<lastBuildDate>Tue, 07 Sep 2010 12:08:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Rákos</title>
		<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/comment-page-1/#comment-179</link>
		<dc:creator>Daniel Rákos</dc:creator>
		<pubDate>Mon, 26 Apr 2010 14:51:08 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=120#comment-179</guid>
		<description>Right. I was thinking also about the same thing. I did finally using inheritance just to put some OO into it, but actually you&#039;re right, composition would have been a better choice anyway. Thanks for the comment!</description>
		<content:encoded><![CDATA[<p>Right. I was thinking also about the same thing. I did finally using inheritance just to put some OO into it, but actually you&#8217;re right, composition would have been a better choice anyway. Thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry</title>
		<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/comment-page-1/#comment-178</link>
		<dc:creator>Dmitry</dc:creator>
		<pubDate>Mon, 26 Apr 2010 09:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=120#comment-178</guid>
		<description>class Synchronizable: protected Mutex  - suppose nonpublic inheritance isn`t necesary, better to use containment (see Herb Sutter`s &quot;Exceptional C++&quot; for details)</description>
		<content:encoded><![CDATA[<p>class Synchronizable: protected Mutex  &#8211; suppose nonpublic inheritance isn`t necesary, better to use containment (see Herb Sutter`s &#8220;Exceptional C++&#8221; for details)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Rákos</title>
		<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/comment-page-1/#comment-47</link>
		<dc:creator>Daniel Rákos</dc:creator>
		<pubDate>Fri, 12 Feb 2010 23:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=120#comment-47</guid>
		<description>&lt;blockquote&gt;I wouldn’t bother with the define, mine looks something like this:&lt;/blockquote&gt;
I agree. However the define makes the code more readable and clearly defines the scope of the synchronization so is less error prone.</description>
		<content:encoded><![CDATA[<blockquote><p>I wouldn’t bother with the define, mine looks something like this:</p></blockquote>
<p>I agree. However the define makes the code more readable and clearly defines the scope of the synchronization so is less error prone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/comment-page-1/#comment-46</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 12 Feb 2010 23:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=120#comment-46</guid>
		<description>I wouldn&#039;t bother with the define, mine looks something like this:

{
  Lock lock(mutex);
  ... do stuff while locked
}</description>
		<content:encoded><![CDATA[<p>I wouldn&#8217;t bother with the define, mine looks something like this:</p>
<p>{<br />
  Lock lock(mutex);<br />
  &#8230; do stuff while locked<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Rákos</title>
		<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/comment-page-1/#comment-19</link>
		<dc:creator>Daniel Rákos</dc:creator>
		<pubDate>Wed, 03 Feb 2010 11:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=120#comment-19</guid>
		<description>Yes, you&#039;re right.

The definition of synchronized is definitely missing the class name, sorry for the mistake, I&#039;ll correct it. It should be *static_cast&lt;cls*&gt;(this);. It is just a mistake arising from HTML.

Anyway, I&#039;m a bit unsure whether an if statement will be satisfactory. Are you sure it will be exception safe with it? Btw, maybe you&#039;re right. Unfortunately this for loop idea came from the original author, I haven&#039;t thought I can further improve that one, but if statements should act in exception cases in the same way as for cycles, so your point is probably right. I&#039;ll check it out at home.

Thanks for the helpful response and sorry that I&#039;ve posted incorrect information, just I was in a hurry yesterday. I will be more careful in the future :)</description>
		<content:encoded><![CDATA[<p>Yes, you&#8217;re right.</p>
<p>The definition of synchronized is definitely missing the class name, sorry for the mistake, I&#8217;ll correct it. It should be *static_cast&lt;cls*&gt;(this);. It is just a mistake arising from HTML.</p>
<p>Anyway, I&#8217;m a bit unsure whether an if statement will be satisfactory. Are you sure it will be exception safe with it? Btw, maybe you&#8217;re right. Unfortunately this for loop idea came from the original author, I haven&#8217;t thought I can further improve that one, but if statements should act in exception cases in the same way as for cycles, so your point is probably right. I&#8217;ll check it out at home.</p>
<p>Thanks for the helpful response and sorry that I&#8217;ve posted incorrect information, just I was in a hurry yesterday. I will be more careful in the future <img src='http://rastergrid.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jörg</title>
		<link>http://rastergrid.com/blog/2010/02/synchronizable-objects-for-c/comment-page-1/#comment-18</link>
		<dc:creator>Jörg</dc:creator>
		<pubDate>Wed, 03 Feb 2010 09:34:24 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=120#comment-18</guid>
		<description>Hi,

good article, but there is a typo in definition of synchronized(cls). Maybe it should read:   ...= *static_cast(this); ...

It is also possible to remove the  &quot;bool _release;&quot; from Lock.
Instead define an &quot;operator bool ()&quot; as &quot;{ return true ; }&quot;
and redefine synchronized(obj) as

#define synchronized(obj)  if (Lock obj##_lock = *obj)

Hope this helps.

Looking forward to your next post

Jörg</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>good article, but there is a typo in definition of synchronized(cls). Maybe it should read:   &#8230;= *static_cast(this); &#8230;</p>
<p>It is also possible to remove the  &#8220;bool _release;&#8221; from Lock.<br />
Instead define an &#8220;operator bool ()&#8221; as &#8220;{ return true ; }&#8221;<br />
and redefine synchronized(obj) as</p>
<p>#define synchronized(obj)  if (Lock obj##_lock = *obj)</p>
<p>Hope this helps.</p>
<p>Looking forward to your next post</p>
<p>Jörg</p>
]]></content:encoded>
	</item>
</channel>
</rss>
