I found that thread which created by RegisterCache class uses too much
CPU (almost like rtp processors)
RegisterCache.cpp:
234 void _RegisterCache::run()
235 {
236 struct timespec tick,rem;
237 tick.tv_sec = (REG_CACHE_SINGLE_CYCLE/1000000L);
238 tick.tv_nsec = (REG_CACHE_SINGLE_CYCLE - (tick.tv_sec)*1000000L)
* 1000L;
239
240 running.set(true);
241
242 gbc_bucket_id = 0;
243 while(running.get()) {
244 gbc(gbc_bucket_id);
245 gbc_bucket_id = (gbc_bucket_id+1);
246 gbc_bucket_id &= (REG_CACHE_TABLE_ENTRIES-1);
247 nanosleep(&tick,&rem);
248 }
249 }
(gdb) bt
#0 0x00007ffff79c9acd in nanosleep ()
#1 0x00007fffbf390b1d in _RegisterCache::run (this=0x7eb180)
#2 0x000000000050a7d3 in AmThread::_start (_t=0x7eb180)
#3 0x00007ffff79c2e0e in start_thread (arg=0x7fff97cfc700)
#4 0x00007ffff6a0b0fd in clone ()
(gdb) frame 1
#1 0x00007fffbf390b1d in _RegisterCache::run (this=0x7eb180)
252 int ret = nanosleep(&tick,&rem);
(gdb) p tick
$1 = {
tv_sec = 0,
tv_nsec = 9765000
}
(gdb) p tick.tv_nsec/1e6
$2 = 9.7649999999999988
So the loop body is executed every ~9ms. Seems like this is too often.
Is it normal ?
I realized the idea to distribute the load evenly and avoid racing,
but it would be better check all buckets at one time or use linked list
of active aliases instead of full pass on the hash table,
otherwise it uses too much CPU even if no aliases registered.
--
Best Regards
Michael Furmur
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev