Re: [OpenSER-Devel] concurrency issues in lcr

2008-05-16 Thread Juha Heinanen
Dan Pascu writes: > IMO this is a poor design to have the internal consistency of the program > depend on the way an external MI command is issued. i agree that there those operations should be locked. i just have not had any need for locking in the environment where i use those modules. impr

Re: [OpenSER-Devel] concurrency issues in lcr

2008-05-16 Thread Dan Pascu
On Friday 16 May 2008, Juha Heinanen wrote: > Dan Pascu writes: > > This line in reload_gws() is not atomic: > > > > (*lcrs_ws_reload_counter)++; > > > > An atomic counter should be used for that, otherwise the value of > > lcrs_ws_reload_counter may end up with the wrong value if 2 > >

[OpenSER-Devel] concurrency issues in lcr

2008-05-15 Thread Juha Heinanen
Dan Pascu writes: > This line in reload_gws() is not atomic: > > (*lcrs_ws_reload_counter)++; > > An atomic counter should be used for that, otherwise the value of > lcrs_ws_reload_counter may end up with the wrong value if 2 concurrent > processes modify it in a narrow time window.

[OpenSER-Devel] concurrency issues in lcr

2008-05-15 Thread Dan Pascu
This line in reload_gws() is not atomic: (*lcrs_ws_reload_counter)++; An atomic counter should be used for that, otherwise the value of lcrs_ws_reload_counter may end up with the wrong value if 2 concurrent processes modify it in a narrow time window. The same is true for the lines above