www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2005/01/02/07:41:11

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 <rich AT phekda DOT gotadsl DOT co DOT uk>
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: <nl8bt0dmp86bl0u788bc1i98l0plk2tipn AT 4ax DOT com> <200501010119 DOT j011JVxi015678 AT speedy DOT ludd DOT ltu DOT se> <b24ct0djfmkn9sq8tjr2df792rfhdf4d0e AT 4ax DOT com> <01c4efef$Blat.v2.2.2$353e15e0 AT zahav DOT net DOT il> <s6jdt0di1q4p006d6ucf7fd10i5isiqb7o AT 4ax DOT com> <01c4f053$Blat.v2.2.2$e18729e0 AT zahav DOT net DOT il>
In-Reply-To: <01c4f053$Blat.v2.2.2$e18729e0@zahav.net.il>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
>>Date: Sat, 01 Jan 2005 09:27:08 -0700
>>From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
[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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019