This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] strcpy optimizations
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: andi at firstfloor dot org, libc-alpha at sourceware dot org
- Date: Tue, 29 Jan 2013 13:30:09 -0800
- Subject: Re: [RFC] strcpy optimizations
- References: <20130129201542.GA23023@domone.kolej.mff.cuni.cz>
On 01/29/13 12:15, OndÅej BÃlka wrote:
> I need to know if it is safe for example to use pblendvb
> on high 8 bytes while other thread modifies lower 8 bytes?
Why wouldn't it be safe? If two threads strcpy into the same
buffer, or one strcpies from a buffer while another is
strcpying into that buffer, the resulting behavior is undefined,
so the GNU C library can do what it likes. It shouldn't
matter whether pblendvb is atomic; you should be able to use it.
> Third question is what usage is worth optimizing. When I looked how
> firefox(biggest usage on my computer) most of calls are used to copy
> a english dictonary. I do not know what is used strncpy in font
> configuration which also takes considerable portion
strncpy should be lower priority, I'd say. Typically, a program
that uses strncpy doesn't care all that much about performance.