[IronPython] Array Access Problem

Drew Moore drew at astro.pas.rochester.edu
Wed May 11 22:53:54 CEST 2005


Jim Hugunin wrote:

>
>Because of the way that value types work, there's no difference between
>the results of
>  apt[0].X = 0    and   apt[0] = Point(0, apt[0].Y)
>
>The big question is how important it is that both of the following are
>equivalent.
>  apt[0].X = 0    and    tmp = apt[0]; tmp.X = 0
>  
>
Just curious, maybe I'm off base...
Is concurrency a concern here?
Can instances of value types be shared between threads? (Perhaps 
different languages?)
If so, what if another thread is concurrently modifying a different 
member of the underlying struct?

If the client code 'just changes one attribute', but in actuality the 
entire structure gets written back, it may make for some very 
hard-to-pin-down bugs.

(if this might happen, maybe immutable value types aren't so bad.)

Drew



More information about the Ironpython-users mailing list