libthr: switch thread and sleepq memory allocator to crt from libc malloc There are more complex interactions between malloc and libthr initialization that can happen if libthr functions are called from ELF object' constructors, before libthr is initialized. Break the dependencies loop by using the private allocator with controlled init. Reported by: yuri pthread_mutex_trylock(): init libthr if needed Reported by: yuri libthr: use atomic_add_int() instead of atomic_fetchadd_int() the return value is ignored.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Switching to __thr_calloc() in _thr_alloc() basically means that the rtld allocator will always be used to allocate thread structures. Could that become a problem (perf, memory fragmentation, etc.)?
Comment Actions
So far it was not a problem for mutexes. I am not even sure how to measure what you are asking, because threads are cached.
Having fast but mal-functional allocator is not a good deal IMO.
Comment Actions
Well, it's more of a bootstrapping problem than "malfunction", else I agree with you. I'm asking in case that would trigger the need for more work in that area, but given your answer that seems unlikely.