|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Bordet, Simone
|Sent: Tuesday, October 17, 2000 3:30 PM
|To: 'jBoss Developer'
|Subject: RE: [jBoss-Dev] mutex?
|
|
|Hey Marc,
|
|> Simone,
|>
|> can you justify in detail why the mutex for the locking? it
|> doubles the lookup times...
|
|Take Stateful Instance Int'r. You can't do
|
|EnterpriseContext ctx = container.getInstanceCache.get(id);
|synchronized (ctx) {...}
|
|since the ctx can be passivated between the 2 rows.

yes but this is the double locking that Vadim Tkachenko did for me at the
time when reading my code and seeing the same thing :)))

in other words (I dont' remember exactly how it worked) is that you synch on
the ctx (the passivation MUST acquire a sync lock (I hope it does)) and then
once you have it you make sure it is not passivated, or something like
that...

we will see

marc

|It can be passivated because isLocked is false and the TX may not be set.
|
|Given this, I also used it for entity, but your previous solution (sync'ing
|the cache object) seems OK, even faster (but I don't feel comfortable - I
|don't know why anyway... :-)
|
|If I throw apart my feelings, I'd say we can use the cache also
|for stateful
|and hence remove totally the mutex.
|I'll think some more on this, I will post doubts (if I'll have any).
|
|Regards,
|
|Simon
|
|


Reply via email to