> is that actually making code faster or is it only to make the logic of
> the problem you are discussing simpler?

The latter. Just to avoid complicating the example with an irrelevant
special case.

> what about possible code that expects this operation to fail?
> 
> mixed error = catch{ a[x] = i; };
> if (error)
>   write("ooops, we reached the end\n");

Yes, that'd be a compatibility problem too, strictly speaking. Don't
think it's very significant, so if #pike 7.8 solves it then it'd be
enough, imho. Do you expect it to be a real problem?


Anyway, Per pointed out in a personal response another much more
prevalent case, namely string concatenation:

  s += "foo";

Considering this, it's almost a requirement to figure out a way to
keep the single-ref-destructive-update optimizations for thread local
things referenced from the stack.

I'm toying with an idea to introduce a single bit for synchronous
refcounting: Consider a flag MULTI_REF which is set when a thing gets
its second ref (regardless whether the ref is from the stack or
elsewhere). Single-ref-destructive-update optimizations would then
only be done if it's cleared. It'd only be possible to clear it from
the gc, and it wouldn't be applicable if the thing is shared.
              • ... Per Hedbor () @ Pike (-) developers forum
              • ... 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