A bug with automatic variables and finally

Erik Schnetter erik.schnetter at student.uni-tuebingen.de
Fri May 9 03:56:35 PDT 1997


On Thu, 8 May 1997, Gary Howland wrote:

> 
> > Why should they?  C++ is not multithreaded.  And variables that live
> > across exceptions have to be declared "volatile" (is this correct?). 
> > There is no such "volatile" modifier for local variables in Java, resp. 
> > every local variable is "volatile". 
> 
> There is a "volatile" keyword in Java, but I don't think it does anything
> at present.  Perhaps we will have to explicitly use volatile at some point
> in the future, allowing compilers to make certain optimisations.

There are "volatile" fields in objects, but there are no volatile local
variables.  Fields, however, were not the problem that this thread
originally was about.  It was about which local variables have to be
preserved across an exception.  That has primarily nothing to do with
multithreading either. 

Kaffe stores some local variables temporarily in machine registers.  This
is of course necessary for speed.  The big question is now: After an
exception occured, and when the exception handler has been entered, how
does the program know which values are in what registers? 

The solution (as has been discussed so far) is that Kaffe seems to have to
do a little bit more bookkeeping. 

-erik

-----
Erik Schnetter, erik.schnetter at student.uni-tuebingen.de

Arthur C. Clarke saw the future.
	He knew it would be run by huge computers.
		And he was right.		Just not about the size.



More information about the kaffe mailing list