From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5213 invoked by alias); 5 Jan 2006 22:35:42 -0000 Received: (qmail 5191 invoked by uid 48); 5 Jan 2006 22:35:40 -0000 Date: Thu, 05 Jan 2006 22:35:00 -0000 Message-ID: <20060105223540.5190.qmail@sourceware.org> From: "hunt at redhat dot com" To: systemtap@sources.redhat.com In-Reply-To: <20051214214948.2056.hunt@redhat.com> References: <20051214214948.2056.hunt@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug translator/2056] avoid locking within foreach iteration for maps & pmaps X-Bugzilla-Reason: AssignedTo Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00023.txt.bz2 ------- Additional Comments From hunt at redhat dot com 2006-01-05 22:35 ------- OK, now I see the source of the misunderstanding. foreach (i in foo) printf("count of foo[%d] = %d\n", i, @count(foo[i])) generates code like this: write_lock() _stp_pmap_agg() write_unlock() read_lock() foreach { write_lock() _stp_pmap_get_ix() write_unlock() } read_unlock() ------------- The problem is the write)lock() needs to go away and instead use _stp_map_get_ix(_stp_pmap_get_agg(global_foo), i) _stp_pmap_agg() is much more effcient that calling _stp_pmap_get_xx() for each index. In fact I consided not even including the _stp_pmap_get functions in the runtime. -- http://sourceware.org/bugzilla/show_bug.cgi?id=2056 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.