From: Nikodemus S. <nik...@ra...> - 2007-11-07 15:44:10
|
On 11/7/07, Nikodemus Siivola <nik...@ra...> wrote: > On 06 Nov 2007 19:20:30 +0200, Juho Snellman <js...@ik...> wrote: > > Is there a reason for distinguishing between synchronization and > > locking in these names? > > Not really. Or rather, I'm not sure which one it should be. Well, actually, there may be. 1. SYNCHRONIZED means "safe for concurrent access", and while this is implemented via locks right now, it need not be. 2. The alternative is not really LOCK-P, because the lock is there anyways, and WITH-LOCKED-HASH-TABLE can be used even with unsynchronized tables -- which makes perfect sense if the table in question is eg. always used in a context where the lock needs to be take around a larger segment then just the single access to the table. (Which is what synchronization right now means.) The best alternative to SYNCHRONIZED is AUTO-LOCK -- or at least the best that I can come up with so far. Cheers, -- Nikodemus |