[devel] Re: perl-5.8.0-alt0.3 (important)

Anton V. Boyarshinov =?iso-8859-1?q?boyarsh_=CE=C1_ru=2Eecho=2Efr?=
Вт Окт 22 10:25:07 MSD 2002


Добрый день

On Tue, 22 Oct 2002 02:52:28 +0400
Mikhail Zabaluev <mhz на altlinux.org> wrote:

> Hello Anton,
> 
> On Mon, Oct 21, 2002 at 10:00:00AM +0400, Anton V. Boyarshinov
> wrote:
> >
> > > Угу. Всё-таки неприспособленные к threads библиотеки -- это
> > > анахронизм, который надо изживать.
> > 
> > Идеализм тоже надо изживать. Кому анахронизм, а кому без них
> > -- никак.
> 
> Здесь нужны примеры.

http://www.perl.com/pub/a/2002/09/04/threads.html?page=4

Modules

In general, unless a module has been specifically vetted as
thread safe it cannot be used in a threaded program. Most pure
Perl modules should be thread safe but most XS modules are not.
This goes for core modules too!

An earlier version of the elevator simulator used Time::HiRes to
allow for fractional sleep() times. This really helped speed up
the simulation since it meant that elevators could traverse more
than one floor per second. However, on further investigation (and
advice from Nick Ing-Simmons) I realized that Time::HiRes is not
necessarily thread safe. Although it seemed to work fine on my
machine there's no reason to believe that would be the case
elsewhere, or even that it wouldn't blow up at some random point
in the future. The problem with thread safety is that it's
virtually impossible to test for; either you can prove you have
it or you must assume you don't!

Из этого следует что большинство модулей с С кодом не
thread-safe.
Антон
-- 
mailto:boyarsh на mail.ru
mailto:boyarsh на ru.echo.fr
 10:20am  up 6 days, 23:18,  3 users,  load average: 0.21, 0.24,
0.25



Подробная информация о списке рассылки Devel