java reentrant lock – key phrases

* seedless banana — all bananas are seedless. I believe most (All?) locks are reentrant. Lock interface has only 3 implementers.

* backward compatible — reentrant locks behave as [1] the synchronized keyword. So the reentrance feature is nothing new, just like “seedless” is nothing new for banana.

[1] Lock.java does offer a few more features such as unlock, lockInterruptibly and tryLock

* unacceptable design — i think many people talk about non-reentrant locks — if myThr already obtained lock1, and need to acquire it again, then the thread blocks!? but i think there’s no such non-reentrant lock in java. It’s an unacceptable design.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s