Synchronization

Feb 15, 2009 at 3:06 PM
I'm taking a crack at writing a SessionStateProvider backed by SharedCache.  In the process it looks like I'm going to have to implement a distributed locking mechanism.  Is there an update method on the cache that is guaranteed to be atomic?  Right now I am doing a Remove() then Add().  However this violates one of the primary constraints of Lamport's Bakery Algorithm (writes are atomic).  That said, having a reliable distributed locking mechanism would be wicked cool. 
Coordinator
Feb 16, 2009 at 7:21 AM
Hi Jeffrey,

thanks for your post.

Implementation for this mechanism should be done over configuration. Once you have multible servers this scenario with a lockdown
will reduce response times therefore its currently implemented as async operation. Currently I'm working on WCF extensions for
SharedCache which should be done within the next 2 - 3 day's.

Are you somehow available over IM? It would be cool if we could discuss this over a session how we make this work.

Regards,
roni
Feb 16, 2009 at 1:24 PM
To be clear what I'm writing is a synchronization mechanism built on top of SharedCache to support a SessionStateStoreProvider.  Unfortunately the locking aspect of a SessionStateStoreProvider is not optional.  Implementing it as a no-op causes really bad things to happen quickly.  Specifically I've got a version of Lamport's Bakery Algorithm using SharedCache as the 'shared memory' mostly coded.
Feb 17, 2009 at 10:37 PM
Ok, so after some work on this it looks like Bakery is going to have too many problems due to id assignement.