Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
atomicity guarantees for threaded code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-10-30 (00:32)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] atomicity guarantees for threaded code
On Sat, Oct 30, 2004 at 09:54:37AM +1000, skaller wrote:

> > As long as the reference write is atomic, which it is going to be, I would
> > suspect this is safe.  It probably would even be safe if multiple threads
> > updated the reference, but you might just drop entries.
> It isn't clear though. On x86 you can have 1 byte alignment
> for an address. What happens if:

But, a reference in ocaml will always be in a block, which will always be
aligned.  Even x86 will be atomic with a 32-bit transfer that is aligned.