develooper Front page | perl.perl5.porters | Postings from January 2001

Re: gethostbyname (was Re: Does perl really need to use sigsetjmp? (18% performance hit))

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
January 26, 2001 14:38
Subject:
Re: gethostbyname (was Re: Does perl really need to use sigsetjmp? (18% performance hit))
Message ID:
20010126223803.B27676@plum.flirble.org
On Fri, Jan 26, 2001 at 02:40:05PM -0600, Jarkko Hietaniemi wrote:
> > It depends on your platform--some have threadsafe gethost* calls and don't 
> > need the _r version, and some don't. (And some aren't threadsafe but don't 
> > have _r versions...)
> 
> And don't foolishly think that there is only one set of _r variants
> out there.  There are several different signatures for getpwnam_r,
> for example.
> 
> > It's pretty much a crapshoot, unfortunately.
> 
> Alan would drop -shoot :-)

Alan has expressed his feelings on C++, Perl's "API" and the implementation
of threads most everywhere. Dan doesn't like C, and I'm starting to agree.
Jarkko and I both despise the standards committee for long long in C99
(but I think I start to understand how a standards committee works, and hence
can see why it happens)
Is there any language we actually all like? :-)

> >From Todo:
> 
>         the _r-problem: for all the {set,get,end}*() system database
>              calls (and a couple more: readdir, *rand*, crypt, *time,
>              tmpnam) there are in many systems the _r versions
>              to be used in re-entrant (=multithreaded) code
>              Icky things: the _r API is not standardized and
>              the _r-forms require per-thread data to store their state

So we've traded the insecurity of csh globbing for tread non-safety
of readdir calls in File::Glob?
[I don't have a problem with this - I think it's the right choice. But I
like to know what assumptions are underlying things]

Is it worth adding a question to Configure, default to [n], to ask if
the gethostent() is thread safe?
And if not, conditionally protect all the pp ops with a mutex if threading
is compiled in?

Or are there more important things to put effort into?
[like doing the whole thing properly for perl6]

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About