Discussion:
store locking patch
pfelt-Urct4Ww6//Pz1n+
2010-03-05 15:22:02 UTC
Permalink
all,
here is a patch to the locking in store. this speeds up delivery a ton
by creating one lock per store and storing it in a hash. this also
appears to fixes the deadlock that exists somewhere in store (which
prompted the patch).

todo is change the mutex to a rwlock which glib also provides.

i ran it overnight with no issues on my server. please test it and let
me know.
pfelt-Urct4Ww6//Pz1n+
2010-03-06 06:03:46 UTC
Permalink
ok.
here is a better version. i've added back the object so that we can
eventually make the locking smarter.
Post by pfelt-Urct4Ww6//Pz1n+
all,
here is a patch to the locking in store. this speeds up delivery a ton
by creating one lock per store and storing it in a hash. this also
appears to fixes the deadlock that exists somewhere in store (which
prompted the patch).
todo is change the mutex to a rwlock which glib also provides.
i ran it overnight with no issues on my server. please test it and let
me know.
_______________________________________________
Bongo-devel mailing list
https://mail.gna.org/listinfo/bongo-devel
h***@public.gmane.org
2010-03-06 17:02:03 UTC
Permalink
Post by pfelt-Urct4Ww6//Pz1n+
ok.
here is a better version. i've added back the object so that we can
eventually make the locking smarter.
I quite like the look of some of this. I wish in a way the location stuff
could be done automatically by macro or something, but then, that's
probably trying to be too clever for now.

I promise when I get back I'll have a go at re-doing the store design
doc - we have some diagrams and things in SVN, but they're probably a
bit out of date.

I only have two questions, based on a short glance at the patch (I
looked harder at the first one when we talked the other day):

1. is the lock type really needed for unlocking? If so, what happens
when you get it wrong?

2. is it possible to promote locks from read-only to read-write? I'm
not sure if that was part of the original design or not, but I don't
think the API prevents it.

I also think in general we should try to think about ways in which we
can detect the locking stuff "going wrong" - deadlock detection, that
kind of thing - at least for some kind of debugging mode. Cogitating
further, the test suite idea is definitely something we should try
to do, particularly in the store I think.

This is all meat for further discussion though; I quite like the patch
you posted :)

Ta

Alex

(waiting in a computer room for his better half to finish Facebooking...)
pfelt-Urct4Ww6//Pz1n+
2010-03-09 03:52:16 UTC
Permalink
Post by h***@public.gmane.org
1. is the lock type really needed for unlocking? If so, what happens
when you get it wrong?
i was looking at the XplRWLock (which i'd like to replace with glibs if i
can). both have calls for a read vs a write lock. if we use that we'll
need the type for the unlock.
Post by h***@public.gmane.org
2. is it possible to promote locks from read-only to read-write? I'm
not sure if that was part of the original design or not, but I don't
think the API prevents it.
it is not possible to promote currently since i really don't have read and
write locks. i don't believe that either rwlock allows foro promotion
Post by h***@public.gmane.org
I also think in general we should try to think about ways in which we
can detect the locking stuff "going wrong" - deadlock detection, that
kind of thing - at least for some kind of debugging mode. Cogitating
further, the test suite idea is definitely something we should try
to do, particularly in the store I think.
i like the idea of a test suite on this most definately.

Loading...