From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 22 Oct 2002 10:25:07 +0400 From: "Anton V. Boyarshinov" To: devel@altlinux.ru Subject: Re: [devel] Re: perl-5.8.0-alt0.3 (important) In-Reply-To: <20021021225228.GE14359@mhz.mikhail.zabaluev.name> References: <20021016014557.GA29249@homestead.turbinal.org> <20021017081412.GB22143@mhz.mikhail.zabaluev.name> <20021018014056.GA4494@homestead.turbinal.org> <20021018222612.GA2153@mhz.mikhail.zabaluev.name> <20021018234241.GA5988@homestead.turbinal.org> <20021019093846.GA54@mhz.mikhail.zabaluev.name> <20021021060106.F0CA32B515@mail.ru.echo.fr> <20021021225228.GE14359@mhz.mikhail.zabaluev.name> Organization: Wanadoo Technologes X-Mailer: Sylpheed version 0.8.1 (GTK+ 1.2.10; i586-alt-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit Message-Id: <20021022062611.6AFC22B515@mail.ru.echo.fr> Sender: devel-admin@altlinux.ru Errors-To: devel-admin@altlinux.ru X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: devel@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: List-Post: Добрый день On Tue, 22 Oct 2002 02:52:28 +0400 Mikhail Zabaluev 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