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: Signal handling rewrite for Linux / i386


Is there any way we can preallocate the stack overflow exception, so that it
doesn't need to be allocated in the signal handler?

There are two problems with allocating it in the signal handler:

1) Either the garbage collector needs to understand sigaltstack, or you need
to use clever hacks in allocating the alternate stack in just the right
place.  Otherwise you could just set up SIGSEGV so that the thread stopping
signals are disabled in the handler, and thus the collector should never see
any of this, I think.

2) I suspect the alternate stack needs to be larger than you think, since
the collector may need to run in it.  If parallel collection is enabled, it
puts its local mark stack there, among other things.

Re: custom stacks:

The linuxthreads code for pthread_self() on some platforms gets much slower
if you use nondefault stack sizes.  Does anyone understand on what platforms
that still matters?  I believe it doesn't if you can reserve a register for
the thread pointer.

Hans


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