This is the mail archive of the java-discuss@sources.redhat.com 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]

Re: Precise GC (was Re: cannot build libjava/gnu/gcj/xlib/natClip.cc)


Cedric Berger wrote:
> try {
>   sql.open()
>   sql.use()
> } finally {
>   <<<--- For example here, A ThreadDeath() is thrown and abort the thing --->>>>
>   <<<--- are you protected against that? --->>>>
>   sql.close()
> }
> 
> The problem of ThreadDeath is that he can appends anywhere,
> anyplace, at any bytecode.

I understand your point.  I'm not arguing that Thread.stop is safe.  There
certainly exist applications in which I wouldn't dare invoke stop() on a random
thread.  In our case I accept the risk because

1) I know what the thread is doing
2) I don't attempt to recover; my intent is to abort the thread and (hopefully)
allow other threads to continue normally
3) The app isn't mission critical; safety is valuable but not paramount.

It is very unlikely (but possible, I admit) that the unresponsive thread is
executing a finally block when I stop it.  It is far more likely to just clean
up and exit.  That happens to be good enough for us.  (IOW our customer doesn't
pay us for more safety than that :\)

--
Jeff Sturm
jeff.sturm@commerceone.com

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