Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

Re: Python-Dev Digest, Vol 76, Issue 83

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


wa2n39 at gmail

Nov 10, 2009, 4:21 AM

Post #1 of 1 (155 views)
Permalink
Re: Python-Dev Digest, Vol 76, Issue 83

Unreg
------Pesan Asli------
Dari:python-dev-request [at] python
Pengirim:python-dev-bounces+wa2n39=gmail.com [at] python
Ke:python-dev [at] python
Balas Ke:python-dev [at] python
Perihal:Python-Dev Digest, Vol 76, Issue 83
Terkirim:10 Nov 2009 03:00

Send Python-Dev mailing list submissions to
python-dev [at] python

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-dev
or, via email, send a message with subject or body 'help' to
python-dev-request [at] python

You can reach the person managing the list at
python-dev-owner [at] python

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-Dev digest..."


Today's Topics:

1. Re: Retrieve an arbitrary element from asetwithoutremoving it
(Nick Coghlan)


----------------------------------------------------------------------

Message: 1
Date: Tue, 10 Nov 2009 20:51:19 +1000
From: Nick Coghlan <ncoghlan [at] gmail>
To: "Martin v. L?wis" <martin [at] v>
Cc: python-dev [at] python
Subject: Re: [Python-Dev] Retrieve an arbitrary element from
asetwithoutremoving it
Message-ID: <4AF945A7.5090904 [at] gmail>
Content-Type: text/plain; charset=ISO-8859-1

Martin v. L?wis wrote:
>> I'm not sure, but isn't that thread-unsafe?
>
> You are right; it's thread-unsafe.
>
> I would fix it by catching the RuntimeError, and retrying. Given the
> current GIL strategy (including proposed changes to it), it won't happen
> two times in a row, so the number of retries would be bounded.

It's also one of the major reasons for not sharing mutable containers
between threads if you can avoid it (and serialising access to them if
you can't)

Cheers,
Nick.

--
Nick Coghlan | ncoghlan [at] gmail | Brisbane, Australia
---------------------------------------------------------------


------------------------------

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev


End of Python-Dev Digest, Vol 76, Issue 83
******************************************


Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.