httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: Non-threadsafe functions used in threads? (1.3, 2.0)
Date Thu, 07 Oct 1999 23:20:19 GMT
fwiw, in NSPR they just replaced all the time code with their own code...
which gets rid of the portability nightmare... but that lands you in a
localisation nightmare instead...

i'm like totally surprised that readdir() isn't threadsafe!

Dean

On Mon, 27 Sep 1999, Manoj Kasichainula wrote:

> David Colasurdo, one of the local AS/400 guys, found a few
> non-threadsafe functions in use in the core. For example, we use
> ap_get_time in http_log.c, which uses ctime. ctime generally uses a
> statically allocated buffer, meaning that threads can overwrite each
> other's values. Here are the ones that I know or suspect are used
> during threaded execution:
> 
> ctime
> getgrgid
> getgrnam (in ap_gname2id; not used in the Apache distribution but it's
>           an API call)
> gethostbyaddr
> gethostbyname (API func: ap_get_virthost_addr)
> getpwnam
> getpwuid
> gmtime
> inet_ntoa
> localtime
> rand
> readdir
> strtok
> 
> Single Unix provides _r functions for many of these, but I don't know
> yet if the pthreads spec requires it.
> 
> I'm guessing that most of these will have to be dealt with in APR. But
> I'm guessing some of these (i.e. ctime) are potential bugs on Windows
> in 1.3, too.
> 
> -- 
> Manoj Kasichainula - manojk@raleigh.ibm.com
> IBM, Apache Development
> 


Mime
View raw message