From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22026 invoked by alias); 15 Dec 2010 16:42:22 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 22015 invoked by uid 22791); 15 Dec 2010 16:42:20 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org From: Tom Tromey To: sami wagiaalla Cc: Project Archer Subject: Re: [[inferior events] partial cleanup for copy_py_list References: <4D08E57D.4000200@redhat.com> Date: Wed, 15 Dec 2010 16:42:00 -0000 In-Reply-To: <4D08E57D.4000200@redhat.com> (sami wagiaalla's message of "Wed, 15 Dec 2010 10:57:49 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2010-q4/txt/msg00043.txt.bz2 Tom> I think it should probably use an iterator to go through the list. Tom> Otherwise it is susceptible to a bug where another thread changes the Tom> list while we are iterating over it. Sami> Hmm I did not know we had the option of using a safe iterator. If we Sami> do then that eliminates the need for copy_py_list in the first place; Sami> copy_py_list is used to make the call back of listeners safe against Sami> one listener editing the list during the iteration by removing an Sami> element. TBH, I am not totally sure how things work in this area. One option would be to use the existing convenience function PyList_AsTuple, and just trust the Python core to get it right. Tom