Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 May 2015 12:55:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-threads@FreeBSD.org
Subject:   [Bug 200138] [PATCH] Fixed sthread-specific array allocation conflict incurred in libthr by some foreign malloc libraries
Message-ID:  <bug-200138-16-HLGPu8Bl9J@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-200138-16@https.bugs.freebsd.org/bugzilla/>
References:  <bug-200138-16@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200138

--- Comment #14 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to yuri from comment #13)
Around a 2-3KB of data for the thread is not a burden, comparing with the >=1M
userspace thread stack allocated for each thread.  Also, I believe that any
non-trivial threading program does use thread-specific data, not least because
libc uses per-thread keys in nss and locale code.

But I can suggest to either use the standard libc malloc(3), which does not
have the problem, or direct mmap(2) calls.  The later would result in some
overhead due to unused part of the page for specific array, but this could not
be important, since keys are used rarely, according to you previous reply.

I tend to think that the mmap(2) is preferred, but __malloc() use would also be
fine.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-200138-16-HLGPu8Bl9J>