This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/2056] avoid locking within foreach iteration for maps & pmaps


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]