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

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

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
January 26, 2001 08:58
Subject:
gethostbyname (was Re: Does perl really need to use sigsetjmp? (18% performance hit))
Message ID:
20010126165845.L71639@plum.flirble.org
On Sun, Jan 21, 2001 at 05:02:21PM +0000, Alan Burlison wrote:
> Kinda both.  Perl5 threads are irredeemably broken, and IMHO should be
> excised from the source as soon as possible - leaving them in only gives
> the mistaken impression that they might actually work some day.  The
> MT-unsafe behaviour of the current eval mechanism when used with threads
> is just one of the reasons why they are so broken.

And another. We're using gethostbyname. To quote an online Sun manpage:

The functions gethostbyname() , gethostbyaddr() , and gethostent() use
static storage that is reused in each call, making these functions unsafe
for use in multi-threaded applications.

The functions gethostbyname_r() , gethostbyaddr_r() , and gethostent_r()
provide reentrant interfaces for these operations.

[however, I don't know whether that many platforms provide the latter's
functionality, and if so if they even use the same names]

How many other non thread-safe interfaces is perl5 using?

[actually, is that important - how much of C's undefined behaviour is
perl5 source actually relying on]

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