Martin Stjernholm, Roxen IS @ Pike  developers forum wrote:
>o  Noncyclic things are no longer destructed and freed immediately. In
>   particular, it means code like this no longer would work:

>   void foo() {
>     Thread.MutexKey my_lock = my_mutex->lock();
>     ... do some work ...
>     // my_lock falls out of scope here when the function exits, so
>     // the lock is released right away.

Why would the actual freeing of memory need to synchronous with the
running of the destructors?
Ideally I'd expect the destructors to be called just like in C++: whenever
the variables go out of scope.
The actual freeing of the space to return it to the heap can be delayed
until the gc finds it.

This can be solved at the compiler level, without changes in Pike
applications.  It also then supports the level of least surprise, which is
always a good thing.

This would immediately get rid of all the dangling filedescriptors everywhere.
-- 
Sincerely,
           Stephen R. van den Berg.

"Even if man could understand women, he still wouldn't believe it."
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
              • ... Per Hedbor () @ Pike (-) developers forum
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
          • M... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
            • ... Martin Stjernholm, Roxen IS @ Pike developers forum
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
              • ... Martin Bähr
              • ... Marcus Agehall (Roxen IS) @ Pike (-) developers forum
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
          • R... Stephen R. van den Berg
            • ... Martin Stjernholm, Roxen IS @ Pike developers forum
              • ... Stephen R. van den Berg
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
  • Re: Multi-cpu desi... Martin Stjernholm, Roxen IS @ Pike developers forum

Reply via email to