Rickard Oberg wrote:
>
> Hey
>
> > <THIS IS CRAZY>
> <snip>
>
> Hm.. yeah, that was new to me.. not sure yet if it's counterintuitive or
> not...
>
> aanyway, let's do it another way then :-) Simply replace the mutex with a
> semaphore. I have done this now, but due to my limited dev environment at
> the moment I can't test it (not even compile it). I have attached it below,
> so if it looks ok to you Sebastien can put it in and test it with the stress
> tests.
>
> The basic idea is to use semaphore primitives instead of a code section
> mutex. This allows the synchronized blocks to be short instead of long (i.e.
> synchronization is only in the semaphore primitives), and it is easier to
> interleave with synchronized blocks. See code for details.
>
> The lock and unlock primitives are at the end. These should be moved to the
> cache so that they can be used by the passivation thread as well.
>
> Seems ok? Have I missed something in this new design/code?
Hi,
This lock is on the whole cache. This means that once it is locked,
NOBODY can enter the cache, even with a different context. For stateful
beans, this solution won't work since activation reads from file, for
entity there must be a lower contention solution.
Sebastien