Again: Native threads

Frank Mehnert Frank.Mehnert at mchp.siemens.de
Thu Mar 27 01:29:18 PST 1997


Hi Kaffe hackers,

hoping that native threads get implemented sometimes in kaffe here are
two suggestions in changing the code. I think Posix threads are a good
basis for implementation. 

1) intsDisable/intsEnable and LOCK/UNLOCK may be replaced by spinlocks
   but the spin should be locked only for a short time. Such big areas
   like in kaffe/kaffevm/findClass.c should not be saved by spin locks.
   In particular if a spin lock is activiated and the running thread
   blocks on a mutex or condvar we have a deadlock. In Tim's thread
   implementation the thread switching also works if ints are disabled.

2) the mutex implementation of some Posix threads differs from Tim's
   mutexes: If one mutex is locked then it can't be locked again by
   the same thread, otherwise there we get an deadlock. With Tim's
   mutexes one thread *may* get a mutex a second time.

This time I have ported Kaffe on Chorus (scaleable Realtime OS) and
I didn't need any assembler instructions (Chorus runs ony several
platforms, my target was an i486). While the GC is running nothing
else runs (LOCK=SpinLock, UNLOCK=SpinUnLock).

Frank

Frank Mehnert
email: Frank.Mehnert at mchp.siemens.de



More information about the kaffe mailing list