Jerry D. Hedden wrote:
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.)
I agree. That most closely matches perl_clone behavior, ie., preserving shared variables between threads. I don't know that its messier, but it will certainly need to be documented. BTW: have you looked into reusing or integrating with any of the Clone modules ? At present, I don't think they handle shared variables, but they're the usual mechanism for cloning structures, and a couple of them use XS for performance. - Dean