This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] |
Phil Edwards wrote:
Short answer: Unwanted behavior since this leads to large amounts of unused allocated memory over time.However we cannot use the pthread_alloc implementation (from SGI) since we are also maintaining an application wide hash_map of objects for caching purposes (i.e. when one thread has completed a specific request, that result is copied into the hash_map and when another thread modifies data that was part of building the cached result this record is removed from the cache by that thread). This means that the thread deleting objects from the hash_map will take ownership for that memory...
I'm confused by the last sentence; is that the behavior you want, or the behavior you don't want?
:) I agree. What would be a really "nice to have" feature in the pthread_alloc is a way of defining this behavior (return freed memory to thread specific free list or global).One solution would be to have both global and thread specific free lists, such as the implementation at http://www.bti.net/cgi-bin/bti/show_header.pl?file=bti_thread_alloc.h
That does look interesting, although I'm instinctively frightened by user code that declares all its stuff inside namespace std...
Ok...When thinking about this, the next question would be how to improve "per thread locality" and this is _really_ new stuff to me, but from what I have read so far can make a huge difference on MP machines...
Yep. From what I've heard, half the C++ community is pressuring the committee to add threading support, and the other half is pressuring them to leave it out (because if the committee specifies something stupid, everyone loses).
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |