X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Message-ID: <41D7EBDB.3060105@phekda.gotadsl.co.uk> Date: Sun, 02 Jan 2005 12:40:59 +0000 From: Richard Dawe User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en, de, fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: More complaints from tests/libclink/check References: <200501010119 DOT j011JVxi015678 AT speedy DOT ludd DOT ltu DOT se> <01c4efef$Blat.v2.2.2$353e15e0 AT zahav DOT net DOT il> <01c4f053$Blat.v2.2.2$e18729e0 AT zahav DOT net DOT il> In-Reply-To: <01c4f053$Blat.v2.2.2$e18729e0@zahav.net.il> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Eli Zaretskii wrote: >>Date: Sat, 01 Jan 2005 09:27:08 -0700 >>From: Brian Inglis [snip] >>I don't think we need to worry explicitly about threads within these >>functions. > > > ??? Then why do we need to have reentrant functions? We could simply > provide a wrapper around the old code with the signature required by > Posix. Regarding reentrancy vs. threading, SUSv3 says this for strtok(): "The strtok() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe." So we could ignore threads. strtok_r() is more generally useful. I find it irritating occasionally that you can only use strtok() on one string at a time. strtok_r() removes this restriction. It will save people implementing your own re-entrant strtok(). I can't really comment on the other *_r() functions, though. We can make the non-reentrant functions thread-safe. Is it worth it? Functionally having a thread-safe strtok() seems a little pointless. It may be worthwhile to save the people implementing thread libraries some work. E.g.: For strtok(), we'd put a mutex around it, and stub out the mutex functions. Bye, Rich =] -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek