[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gwydion & threads



Andreas Bogk <andreas@andreas.org> writes:

> IIRC, assignments don't need to be atomic.

Ok, at least the Fun-O documentation says otherwise, and I can't find
the original threads proposal anymore.

The good news is that assignment *is* atomic, even in the presence of
a separate type pointer.  This is because data and type are stored
together in a descriptor_t structure on the heap, and assignments to
variables and slots just assign the descriptor_t pointer.

Slot assignment looks like this:

L_temp_2.heapptr = tZliteral.heapptr;
L_temp_2.dataword.l = 23;
SLOT(L_bar.heapptr, descriptor_t, 4) = L_temp_2;

and variable assignment like this:

L_temp_3.heapptr = tZliteral.heapptr;
L_temp_3.dataword.l = 42;
tZtZbaz = L_temp_3;

Andreas

-- 
"In my eyes it is never a crime to steal knowledge. It is a good
theft. The pirate of knowledge is a good pirate."
                                                       (Michel Serres)