> > no, you would only use a small number like 8. this is similar to how other
> > concurrent data structures work. e.g. the ConcurrentHashMap does not
> > have a single field for the size. it keeps the size per segment and 
> > therefore
> > allows updates to happen concurrently on different segments.
> 
> Don't these data-structures use locking for each segment to ensure
> consistency? How would you ensure that the same problem doesn't occur
> on the per-segment mod count then? AFAIU, without locking we only
> reduce the probability of the problem happening. Is that a
> satisfactory solution?

ideally there wouldn't be any modCount. but you are right, a per-segment mod
count doesn't solve the problem entirely, it only reduces the probability.

it would be possible to 'guarantee' an update of the permission store with
infinite retries, but then we may run into a liveness problem. what if one 
update
always loses because of a conflict?

Regards
 Marcel

Reply via email to