develooper Front page | perl.perl5.porters | Postings from November 2003

Re: dealing with objects cloning under ithreads

Thread Previous | Thread Next
From:
Tels
Date:
November 14, 2003 16:05
Subject:
Re: dealing with objects cloning under ithreads
Message ID:
200311150105.29174@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

>2) here is an example of a trivial program which will either hang or segfault 
>depending on your malloc implementation:
>
>package main;
>use threads;
>use GTop;
>$Foo::gtop = GTop->new;
>threads->new(sub { print "thread started\n";})->detach for (1..3);
>
>here all 3 threads get a copy $Foo::gtop, and then try to destroy it (4 
>times). Only the first one does it successfully, as gtop returns an object 
>which is a wrapper around a C struct. If you don't have GTop, replace it with 
>some other class which returns a similar object and you will see what the 
>problem is.

I think Math::BigInt::GMP would fall under this... oh...

Cheers,

Te"never used threads"ls

- -- 
 Signed on Sat Nov 15 01:04:21 2003 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "My glasses, my glasses. I cannot see without my glasses." - "My glasses,
 my glasses. I cannot be seen without my glasses."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP7Vtx3cLPEOTuEwVAQGl/gf/SDESVRRA51hQ4sb42z/tUNbR4AGdlJRs
ZD35wkNYqTmAKFtHnMu9DVyxCLuItDUnXMw5FWlFaKeZx3XvuFEA/x4q42Bnj0Bo
a+Vgek7wWJ+mRl6/Oebh1nQCiiB9vqns+QOz0Kzo4/kI6fMwGUdGaQxhrhIpqsaI
MYAKslzeattdH8zOdYkzIRX116uxgyjaRumZJLEJ9Xsm3hvxtPPahIbdzUOCJ5YT
QbsjGM4S8z1whuVYLMJ0bihq+hwjq6wjuHJI02EnBglzXlWAm7y8Hxbti0VIIT/x
/cEgqsMaqI6mgGecb76iVhw+DekupPxVXzpxhth++CWgF/I1Ht2R1Q==
=SDHe
-----END PGP SIGNATURE-----


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