This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: criticalsections are very fast / pooling mutexes / how does hash-sync work?


On 23 Dec 2001, Adam Megacz wrote:
> Hrm, shouldn't the one that's there for Linux-x86 work? It's just
> straight asm, no system calls...

Look at how JV_HASH_SYNCHRONIZATION and SLOW_PTHREAD_SELF are defined in
posix-threads.h.  The latter is a fallback for targets that don't keep
a fast thread pointer.  (For Win32 you can consider using TLS, e.g.
TlsGetValue(_Jv_ThreadKey).  I don't know how TLS is implemented on
Windows nor what it costs.)  You'll need to port these definitions to
win32-threads.h.

Also look at the spin() function in natObject.cc.  This has some
assumptions that are only true of Linux, i.e. minimum usable sleep
duration.  (I'd prefer this function move to the threads interface... it
isn't suitable for Win32 as-is, nor Solaris for that matter.)

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]