01-06-05 20.06, skrev Jenda Krynicky p� [EMAIL PROTECTED] f�ljande:
>> This will break the normal behaviour people expect from fork(), this problem
>> is a problem incommon with fork() on external objects in the unix world
>> (fork with DBI for example can be very bad).
>
> You mean "uncommon" ?
>
> I have to admit I have no experience with fork() in the Unix world at
> all :-( And I don't have any Unix handy to try it.
>
> What does it do if you fork with DBI?
>
> Here under Win2k+iThreads it crashes even if I use the
> handle only in parent thread. I guess some properties are objects as
> well.
Sorry has in common with, the same problem applies to fork().
Why does it crash, I mean if it isn't used in two threads it should crash?
What DBD?
>> I am not sure fixing an
>> autosemantic for this without fixing it in the fork world would be a good
>> thing. If you speak about a fix for people using ithreads. How should we do
>> it? Undef every object that has not declared itself to be safe? The user
>> must explicitly tell us what objects to null, and then that nulling could be
>> implmented by a wrapper object or class that listens for the CLONE callback.
>
> You are right. If someone knows what is he doing (or he thinks he
> does ;-) he will do the necessary dirty tricks. Others should wait
> till the module is updated.
>
> Sorry to bother.
OTOH people are asking this for fork() aswell. We were discussing this on
#perl the other day. A general solution where you could register for objects
to become null on fork() would be nice.
Using weakrefs I think this is doable. You hand it the ref it should void.
And then after the fork you tell it to empty those objects. (This needs XS)
>> And what should that default CLONEr be? We cannot clone the C struct behind
>> it :).
>>
>> Artur
>
> Sure. That could only be something that would actualy not clone the
> object. I have to admit I don't know how's that cloning implemented
> or what would be possible.
>
> Thanks for the info. Jenda
People should just keep asmuch data aspossible in the perl space and let us
clone it :)
I think it would be nice for a module to be able to declare itself
threadsafe. Not realy sure what the best approach is!
Artur