Interrupted IO and AWT

Per Bothner per@bothner.com
Tue Mar 21 12:39:00 GMT 2000


Jeff Sturm <jsturm@sigma6.com> writes:

> Tom, I think you mentioned once the use of locks for Java string
> concatenation:
> 
> String f(int i) {
>   return "f(" + i + ") called";
> }
> 
> That method will normally do a monitorenter/monitorexit twice.  Lock
> avoidance may eliminate the useless locks in string contentation
> completely.

That is certainly a special case we can do by just having the compiler
emit non-locking calls.  That should be straight-forward to fix.

We can also "inline" the StringBuffer on the stack (though not
necessarily the buffer's data, of course), by using a special
(non-Java) C++ class.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


More information about the Java mailing list