[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: commit: ldap/servers/slapd/overlays rwm.c



Pierangelo Masarati wrote:
Howard Chu wrote:
Yes, I saw that. I ignored it because I figured only a single instance of rwm can be active at a time. I guess this isn't quite true; if rwm is configured above the glue overlay, and also configured on individual subordinate databases, there would be a clash. I'll change this to just use a tmpalloc'd callback.
That was what my initial idea wanted to avoid, because it seemed to me a waste of resources to malloc something fixed size that needs to be used all times the same, so using the thread keys seemed to me the most obvious solution. Then the multiple instance per thread execution became possible, but I was too lazy to change it. Maybe there's a better approach, but I couldn't figure it out. All in all, malloc'ing a callback is done all times in bind, right now (maybe it could be eliminated there as well... what's more expensive: a thread key lookup or a malloc on the slab?)

A slab malloc is usually faster. It's hard to get meaningful timings for these functions on my system because their average profiled execution time is less than one microsecond, which is the finest resolution my profiler can return. Would have to test on a slower CPU to get more accurate timings...


--
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/