This is the mail archive of the java-discuss@sourceware.cygnus.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: Interrupted IO and AWT


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/

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