<?xml version="1.0" encoding="windows-1252"?>
<node id="1005146" title="Re: Thread safe equivalent of LINUX touch command" created="2012-11-22 10:11:06" updated="2012-11-22 10:11:06">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;What do you mean by "thread-safe"? 

&lt;p&gt;If two threads attempt to touch the same file, first one will succeed(*), and then the other will succeed(*). 

&lt;P&gt;Of course, it will be impossible to know &lt;i&gt;which thread&lt;/i&gt; succeeded first (or last), but the files timestamps will have changed.

&lt;p&gt;And whichever order they do it in, the file will have been touched twice as programmed. 

&lt;P&gt;How do you want to define "not thread-safe"?

&lt;p&gt;(*)Where "success" is defined as altering the timestamps on the file to some value.

&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1005135</field>
<field name="parent_node">
1005135</field>
</data>
</node>
