develooper Front page | perl.ithreads | Postings from May 2008

Re: p5p summary: Improving threads::shared ?

Thread Previous | Thread Next
From:
Jerry D. Hedden
Date:
May 5, 2008 06:54
Subject:
Re: p5p summary: Improving threads::shared ?
Message ID:
1ff86f510805050653j54a17058rb8aa2823748c7bc@mail.gmail.com
Dean Arnold wrote:
> Alas, there's one catch that the current T::Q
> implementation doesn't cover: recursive structures:

Oh, crud.  Thanks for catching that.

> Or maybe using a fieldhash to key the original ref thats
> being cloned, do a quick lookup, and if it exists, then
> skip it

That was my thought, too.  I'll work on it.

>  Momentary insanity: Why not reuse the existing perl_clone
>  code ?

Egads!  I've no clue about this.

> Would an assignment op overload work?  I.e., if the LHS
> was already shared(), then the = overload would do the
> deepcopy? Or would that break the XS tie/magic side of the
> code?

I had the same idea.  I can't think of why it might conflict
with anything the XS code does (but that thought doesn't
have much to back it up).

What are your thoughts regarding structures that mix shared
and non-shared elements?  Should a whole separate clone be
made, or should that shared portions (i.e., refs) be used in
the copy?  (I'm thinking the latter, while messier, makes
more sense.)

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