[Kaffe] core dump while running kaffe.

Godmar Back gback at cs.utah.edu
Mon Mar 22 15:33:03 PST 1999


> 
> Godmar Back writes:
> >  That wouldn't work with native threads or on an smp where disabling
> > switches is impossible or very expensive.
> 
> So how are enterUnsafeRegion()/leaveUnsafeRegion(), which do exactly
> this, going to work?
> 

enter/leaveUnsafeRegion block signals for the current process, which has
the side effect of preventing context switches that stem from asynchronous
events such as time slice expiration, timer expiration, or I/O readiness
in the uniprocessor, user-level jthread implementation.

Disabling signals does not have the effect of locking out other threads
on a native thread implementation such as linux-threads, because the kernel
schedules the threads in this case.  This has two consequences:

First, it means that we must use other means to stop other threads where
this is necessary.  It is necessary when starting a gc.
We use a signalling mechanism like Boehm's gc does.  It's a pain, it's
expensive, and the current code in the CVS doesn't always work.
Then again, the native thread implementation of the Linux JDK also 
doesn't always work.  (Try running GCTest with it).

Second, using native threads means using thread-safe libraries.  There's 
no need for enter/leaveUnsafeRegion as is when using our own user-level
thread implementation.  This is so because we use jthreads in conjunction 
with a C library that's unaware of this fact.

	- Godmar



More information about the kaffe mailing list