Hi Levente,
On Sat, Dec 31, 2016 at 11:45 AM, Levente Uzonyi leves@caesar.elte.hu wrote:
Hi Eliot,
I'm no expert in C programming, but I suppose a global counter could be used to ensure that no other threads have modified the array before swapping the pointers.
I think one uses exactly the strategy you used in the Smalltalk code, namely: if the structure needs growing, create a grown initialised copy, and then do a test-and-set to update the pointer.
Btw, I thought that object pinning would make it possible to get rid of the external semaphore table altogether. We need different plugin code for that, but I think it would be simpler and more efficient.
Well, I think pinning should help with a number of things. But I don't see how it suffices here. Making signal thread-safe is probably quite difficult, so the indirect request signal/grant signal scheme that the external semaphore table provides is convenient. What am I missing?
Why is #at:put: not thread-safe? Isn't it a primitive, so that no
suspension point occurs provided both arguments are valid?
Ah, good point! That's not obvious :-). I'll change my comment :-) Cool, man!
Happy New Year!
Levente
Have a great year! And good wishes to everyone!
_,,,^..^,,,_ best, Eliot