lua-users home
lua-l archive

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



On 10 Oct 2006, at 13:07, Mike Pall wrote:

Hi,

David Jones wrote:
This assumes that updates to each of hookmask and hook will take
place atomically.  There's no guarantee of that.  On some
architectures an update of hook may consist of two writes (to two
halves of a 64-bit quantity say) and a re-ordered write to hookmask
may appear in between them.

Please. If updates to a pointer sized quantity (32 bit on 32 bit
systems, 64 bit on 64 bit systems) are non-atomic, fire the CPU
designer team. AFAIK none of the 64 bit multi-core machines on
the market do this.

Oh I see. When you said thread-safe you meant thread-safe on Intel Linux. Right. All The World's A Vax. Well, I totally agree with you in that case.

C on AS/400 is typically implemented with 16-byte pointer values. I doubt that they're atomic.

The charming world of C in the DOS era had plenty of examples where the pointer size was 32-bits but the word size was 16-bits.

It's also not unusual for function pointers to be twice as wide as your average data pointer.

drj