[sheepdog] [PATCH v4 0/4] improve reference counting of data structures

Liu Yuan namei.unix at gmail.com
Thu Jul 11 05:09:22 CEST 2013


On Thu, Jul 11, 2013 at 10:48:09AM +0900, Hitoshi Mitake wrote:
> Current sheep uses raw int and uatomic_{inc,dec} for reference
> counting of data structures. This is not a good practice because we
> can simply increment or decrement with ++ or -- operators of C because
> these counters has a type of int. It causes typical multithreading
> programming errors.
> 
> This patch implements a new data structures, refcnt_t, for reference
> counting. refcnt_t can be used for structs which can be get or put by
> multiple threads. This leverage compiler support for detecting bad
> operations and manipulated safely than previous reference counters
> whose types are raw integer.
> 
> And in the last patch of this series, one bug is removed which is
> found by this feature.
> 
> v4:
>  - introduce compiler.h for solving the cyclic dependency of util.h
>    and logger.h

Applied, thanks

Yuan



More information about the sheepdog mailing list