This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Thread-, Signal- and Cancellation-safety documentation
- From: Rich Felker <dalias at aerifal dot cx>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 8 Apr 2013 12:28:59 -0400
- Subject: Re: Thread-, Signal- and Cancellation-safety documentation
- References: <orppym7okv dot fsf at livre dot home> <20130326064347 dot GL20323 at brightrain dot aerifal dot cx> <51628981 dot 8030406 at redhat dot com>
On Mon, Apr 08, 2013 at 11:10:25AM +0200, Florian Weimer wrote:
> On 03/26/2013 07:43 AM, Rich Felker wrote:
> >I know your work is just documenting existing practice, but unless
> >there's a clause in POSIX (and now, C11 too, since C11 has threads)
> >which allows this, I think the underlying issue should be fixed. The
> >cleanest fix I can envision would be atomically replacing the pointer
> >to the locale object once the new one is prepared. This would
> >eliminate the need for readers to lock anything.
>
> So we don't deallocate locale data, ever? Then this might work.
I don't see a clean way to deallocate it without making things slow.
> Straightforward rwlocks for the character classification functions
> wouldn't work because even a shared lock results in hardware-level
> contention, killing performance.
Exactly. Character-classification functions only need LC_CTYPE though.
This is why I'm suggesting the above-described approach.
Rich