Re: [PATCH 2 of 2] Core: add ngx_atomic_store() and ngx_atomic_load()

2016-09-17 Thread Maxim Dounin
Hello! On Fri, Sep 16, 2016 at 02:43:49PM -0700, Piotr Sikora wrote: > Hey Maxim, > > > The "*(lock) == 0" check here is just an optimization, it only > > ensures that the lock is likely to succed. > > Yes, and use of the ngx_atomic_load() doesn't affect that. > > Namely, in the

Re: [PATCH 2 of 2] Core: add ngx_atomic_store() and ngx_atomic_load()

2016-09-16 Thread Piotr Sikora
Hey Maxim, > The "*(lock) == 0" check here is just an optimization, it only > ensures that the lock is likely to succed. Yes, and use of the ngx_atomic_load() doesn't affect that. Namely, in the micro-benchmarks I did (heavy contention - 100 threads trying to acquire lock, update value, release

Re: [PATCH 2 of 2] Core: add ngx_atomic_store() and ngx_atomic_load()

2016-09-12 Thread Maxim Dounin
Hello! On Wed, Aug 17, 2016 at 05:29:32PM -0700, Piotr Sikora wrote: > # HG changeset patch > # User Piotr Sikora > # Date 1471265532 25200 > # Mon Aug 15 05:52:12 2016 -0700 > # Node ID 40765d8ee4dd29089b0e60ed5b6099ac624e804e > # Parent

[PATCH 2 of 2] Core: add ngx_atomic_store() and ngx_atomic_load()

2016-08-17 Thread Piotr Sikora
# HG changeset patch # User Piotr Sikora # Date 1471265532 25200 # Mon Aug 15 05:52:12 2016 -0700 # Node ID 40765d8ee4dd29089b0e60ed5b6099ac624e804e # Parent 2f2ec92c3af93c11e195fb6d805df57518fede7c Core: add ngx_atomic_store() and ngx_atomic_load(). Those functions