<?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: Single program instance</title>
	<atom:link href="http://www.insecure.ws/2009/07/28/single-program-instance/feed" rel="self" type="application/rss+xml" />
	<link>http://www.insecure.ws/2009/07/28/single-program-instance</link>
	<description></description>
	<lastBuildDate>Wed, 25 Aug 2010 08:27:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Francesco Pretto</title>
		<link>http://www.insecure.ws/2009/07/28/single-program-instance/comment-page-1#comment-946</link>
		<dc:creator>Francesco Pretto</dc:creator>
		<pubDate>Sun, 28 Feb 2010 11:14:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.insecure.ws/?p=155#comment-946</guid>
		<description>Yup, I noticed the misunderstanding now. Would be cool to have a &#039;fcntl&#039; command similar to &#039;flock&#039;, so you can have a shell scripted critical section. I workarounded this using your python script and subprocess.call(&#039;critical-section.sh&#039;, shell=True). The same can certainly be done for the fcntl C program (but don&#039;t need now, so I didn&#039;t investigate more :) .

Thank you again.</description>
		<content:encoded><![CDATA[<p>Yup, I noticed the misunderstanding now. Would be cool to have a &#8216;fcntl&#8217; command similar to &#8216;flock&#8217;, so you can have a shell scripted critical section. I workarounded this using your python script and subprocess.call(&#8216;critical-section.sh&#8217;, shell=True). The same can certainly be done for the fcntl C program (but don&#8217;t need now, so I didn&#8217;t investigate more <img src='http://insecure.ws/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>Thank you again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kang</title>
		<link>http://www.insecure.ws/2009/07/28/single-program-instance/comment-page-1#comment-940</link>
		<dc:creator>kang</dc:creator>
		<pubDate>Thu, 25 Feb 2010 11:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.insecure.ws/?p=155#comment-940</guid>
		<description>you&#039;re correct about python, i haven&#039;t noticed it
about flock/fnctl, it is just a misunderstanding, the flock program achieves locking (using flock) by wrapping around the script. i clarified it ;)

thanks!</description>
		<content:encoded><![CDATA[<p>you&#8217;re correct about python, i haven&#8217;t noticed it<br />
about flock/fnctl, it is just a misunderstanding, the flock program achieves locking (using flock) by wrapping around the script. i clarified it <img src='http://insecure.ws/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesco Pretto</title>
		<link>http://www.insecure.ws/2009/07/28/single-program-instance/comment-page-1#comment-927</link>
		<dc:creator>Francesco Pretto</dc:creator>
		<pubDate>Thu, 11 Feb 2010 10:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.insecure.ws/?p=155#comment-927</guid>
		<description>Forgot: in 2) , the fp.close() in the PYTHON script.

Greetings,
Francesco</description>
		<content:encoded><![CDATA[<p>Forgot: in 2) , the fp.close() in the PYTHON script.</p>
<p>Greetings,<br />
Francesco</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesco Pretto</title>
		<link>http://www.insecure.ws/2009/07/28/single-program-instance/comment-page-1#comment-926</link>
		<dc:creator>Francesco Pretto</dc:creator>
		<pubDate>Thu, 11 Feb 2010 10:58:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.insecure.ws/?p=155#comment-926</guid>
		<description>Hello. Nice reference, but there are a couple of problems.

1) flock from util-linux is not a wrapper around fcntl() but flock(), a different and less flexible locking mechanism. This is a problem because the two mechanisms are mutually incompatible. At the moment, there&#039;s no shell wrapper for fcntl();
2) That fp.close() should actually remove the lock before entering the critical section. If you remove it, or move it just before the os.unlink(), the code should be fine.</description>
		<content:encoded><![CDATA[<p>Hello. Nice reference, but there are a couple of problems.</p>
<p>1) flock from util-linux is not a wrapper around fcntl() but flock(), a different and less flexible locking mechanism. This is a problem because the two mechanisms are mutually incompatible. At the moment, there&#8217;s no shell wrapper for fcntl();<br />
2) That fp.close() should actually remove the lock before entering the critical section. If you remove it, or move it just before the os.unlink(), the code should be fine.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
