Patch: General locking (was Possible deadlock and solution)

David Relson relson at osagesoftware.com
Wed Oct 2 03:27:25 CEST 2002


<x-flowed>
Gyepi,

FWIW, it's O.K. by me.

I do have a question on the release list code.  I notice that locks are 
released in reverse order of their acquisition.  Is the order 
important?  Would there be any problem in reversing the order?

The reason that I ask is that Eric's multi-list code uses a singly linked 
list, which has a distinct order for the processing.  Merging your code and 
his will be easy if the order doesn't matter, a bit more difficult if the 
order _does_ matter.

Please advise.

David

At 08:44 PM 10/1/02, Gyepi SAM wrote:
>On Tue, Oct 01, 2002 at 07:49:21PM +0200, Matthias Andree wrote:
> > > On Tue, Oct 01, 2002 at 03:25:17PM +0200, Matthias Andree wrote:
> > > +  for (; n > 0; n--){
> > > +    db_lock_release(vhandle_list[n - 1]);
> > > +  }
> >
> > while(--n >= 0) {
> >   db_lock_release(vhandle_list[n]);
> > }
> >
> > saves the subtraction. Not that it matters unless you lock dozens of
> > those.
>
>I does not matter, but it's better style, in this context.
>
>If there are no objections, I'd like to commit the general locking code.
>
>-Gyepi

</x-flowed>



More information about the bogofilter-dev mailing list