[OpenJDK 2D-Dev] Question regarding surface locking

Roman Kennke roman.kennke at aicas.com
Tue Mar 24 20:03:07 UTC 2009

Hi there,

I see in X11SurfaceData, that we lock and unlock on the global AWT lock.
AFAICS, the purpose of this lock is to prevent race conditions on the
surface data (like: t1 reads, t2 reads, t1 writes back, t2 writes back
-> BUMM). Is it really necessary to lock on a global lock, wouldn't a
lock on the surface do the same job? I'm thinking when you have
animations on several surfaces in parallel (like in the Java2Demo), it
might be more efficient to have a finer grained lock. Or are there other
pitfalls attached here?


Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-48
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt

More information about the 2d-dev mailing list