William Hart <whart...@gmail.com> added the comment:

Vinay:

No, I haven't tried this in multi-threaded applications.  You're correct
that this would require locks around the global data.

--Bill

On Thu, Mar 10, 2011 at 3:16 AM, Vinay Sajip <rep...@bugs.python.org> wrote:

>
> Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment:
>
> Bill,
>
> I was looking at this patch again, and I'm not sure about thread safety.
> The correctness of the caching depends on manager.status, which is state
> which is potentially shared across threads. There are no interlocks around
> it, so with the patch as it stands, ISTM it's possible in a multi-threaded
> application to get stale information. Has your patch been used in
> multi-threaded applications?
>
> ----------
>
> _______________________________________
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue11369>
> _______________________________________
>

----------
Added file: http://bugs.python.org/file21107/unnamed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11369>
_______________________________________
Vinay:<br><br>No, I haven&#39;t tried this in multi-threaded applications.  
You&#39;re correct that this would require locks around the global 
data.<br><br>--Bill<br><br><div class="gmail_quote">On Thu, Mar 10, 2011 at 
3:16 AM, Vinay Sajip <span dir="ltr">&lt;<a 
href="mailto:rep...@bugs.python.org";>rep...@bugs.python.org</a>&gt;</span> 
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 
1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><br>
Vinay Sajip &lt;<a 
href="mailto:vinay_sa...@yahoo.co.uk";>vinay_sa...@yahoo.co.uk</a>&gt; added the 
comment:<br>
<br>
</div>Bill,<br>
<br>
I was looking at this patch again, and I&#39;m not sure about thread safety. 
The correctness of the caching depends on manager.status, which is state which 
is potentially shared across threads. There are no interlocks around it, so 
with the patch as it stands, ISTM it&#39;s possible in a multi-threaded 
application to get stale information. Has your patch been used in 
multi-threaded applications?<br>

<div><div></div><div class="h5"><br>
----------<br>
<br>
_______________________________________<br>
Python tracker &lt;<a 
href="mailto:rep...@bugs.python.org";>rep...@bugs.python.org</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue11369"; 
target="_blank">http://bugs.python.org/issue11369</a>&gt;<br>
_______________________________________<br>
</div></div></blockquote></div><br>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to