On 06/20/2012 07:09 PM, levin li wrote: > + pthread_mutex_lock(&sys->rw_object_mutex); > + pthread_cond_broadcast(&sys->rw_object_cond); > + pthread_mutex_unlock(&sys->rw_object_mutex); > + Use condition & mutex is overkill for this corner case and doesn't look right to me, since epoch is passed down from callers, this means caller asks read_object() to read exact object of the very *epoch*. We should honor this semantics or the caller shouldn't pass the epoch down, otherwise call should do error handling, not read_object() per se as a generic function. With further thinking on this problem, I think callers of read/write/remove_object() family might not necessarily need 'epoch' parameter and would better forward these requests to gateway code, which manages retry well in recovery phase. Thanks, Yuan |