Re: [Sablevm-developer] Threading support in SableVM
Brought to you by:
egagnon
From: Archie C. <ar...@de...> - 2004-02-19 20:42:24
|
Chris Pickett wrote: > I started looking at the POSIX 1003.1c (pthreads) spec (it's > available online) and also at the comp.programming.threads FAQ (1 Mb > html file kills Mozilla on my machine, better to download) ... and > discovered a few interesting things: > > 1) The only way to ensure cache coherency in a portable manner is to use > the pthreads synchronization functions (e.g. lock and unlock). So I > think that means there is no need for us to consider the Linux kernel > cache flush architecture, nor any processor-specific cache flush > instructions. On a related note: Java semantics imply a read barrier at MONITORENTER and a write barrier with MONITOREXIT. With fat locks, you get this automatically because they are implemented using pthread mutexes. But with thin locks where there is no contention, technicallly SableVM is at fault because it doesn't explicitly impose the read/write barriers (does it?). On i386 it works out anyway because I think the compare-and-swap sequence enforces a memory barrier. But in general that's not true. I could be wrong about all this but this what memory recalls. -Archie __________________________________________________________________________ Archie Cobbs * CTO, Awarix * http://www.awarix.com |