Re: Lots of context switches with shared array

[email protected] (Thomas Karcher) Tue, 23 Sep 2008 19:42:37 +0200
Newsgroups perl.ithreads
Message-ID <1222191757.5444.60.camel@localhost>
--=-vGfbuxTLYmd7WR4HKrnh
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi Dean,

> > Thanks for the enlightening answer. Do you think it is possible to
> > "trick" threads::shared's lock with a reference to the array, i. e. the
> > reference is shared but the array itself isn't?
> Not certain how you intend to do that ? Are you intending to write your
> own XS implementation ? Keep in mind that a shared ref must point to

No, that's too much and not an option for me.

> a shared variable, ie, a shared variable can't be used as a ref to
> a private variable.

Right, that kills the idea ... too bad. Thanks for your comments.


If someone from the ithreads development team is listening: I guess this
is an issue worth considering to have a solution for ... e. g. a
thread-safe array (similar to Thread::Queue) or a more fine-granular
locking mechanism for shared arrays ... not that I really thought it
through :)


Regards,
Thomas



--=-vGfbuxTLYmd7WR4HKrnh
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkjZKo0ACgkQiMyIQtYO79z62wCg73t3cs+HhgmGfhtsFosR8PmK
sT4An0sA2GuraMsb+jU85IL0Kd2WZo+R
=MaFF
-----END PGP SIGNATURE-----

--=-vGfbuxTLYmd7WR4HKrnh--