This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/2056] avoid locking within foreach iteration for maps & pmaps
- From: "hunt at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 5 Jan 2006 22:35:40 -0000
- Subject: [Bug translator/2056] avoid locking within foreach iteration for maps & pmaps
- References: <20051214214948.2056.hunt@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.