/--- On Tue, Sep 05, 2000 at 10:57:30PM -0400, Chaim Frenkel wrote:
| >>>>> "JH" == Jarkko Hietaniemi <[EMAIL PROTECTED]> writes:
|
| >> Now, "all" that needs to be taken care of, is make sure that
| >> the final
| >> assignment from the localized and changed variables to their
| >> outer-scoped counterparts happens in *one step*, i.e. no task
| >> switching
| >> while this is going on.
|
| JH> Well, that can't be done. (I assume that by 'task switching'
| you mean
| JH> here 'thread switching') Or, if it can, it *shouldn't* be
| done.
| JH> Threads run on their own until they yield, they decide to
| synchronize
| JH> and/or join, or they exit. Note the "they decide".
\---
It is a very interesting problem, and this maybe out of my
profession, but I think we need to try to solve this, because it
will worth later!
My suggestions:
1,
If we use locks for transactions, then we need a deadlock detection,
which is (in the simplest case): timeout. It can be implemented very
easily.
2,
Releasing the lock after the end of transaction has no problem (I
think), because we can hold the lock on the variables until we
finishes all the COMMITS and TIE_COMMITS, and then we can start
releasing the locks. If a task-switching occures in this cycle, then
nothing interresting happens: half of the variables are usable by
others, half ot that is not. Anyone can try to use that, and may
succeed. Next thread-switch to our thread will continue to release
the locks until all the locks are released.
I still think that we can implement this in a quite simple way IF we
assume we already designed our perl interpreter to thread-safe.
If you still have objections, share with us!
dLux
--