[Mono-dev] Ldap and Threading

JD Conley jd.conley at coversant.net
Thu Jan 26 12:37:55 EST 2006

> > 2. The rest of the patch deals with correct catching and
> > passing of the
> > exceptions thrown in the "working" thread to the "user" thread. This
> > definitely solves the "hang" issue, but does nothing with the cause
> > those exceptions. So the route bug(s) remain (correct me if
> > I'm wrong).
> I believe you are correct to the limits of my understanding, but I do
> some
> changes in the MessageAgent.cs and MessageVector.cs classes that are
> locking
> related. Mostly around using the collections SyncRoot instead of the
> collection
> object itself for the lock. My assumption when I reviewed the code was
> that
> these changes provided a more reliable lock on the collection and as
> prevented the race when accessing the returned messages.

I used the SycRoot so that I could cleanly use a synchronized internal
list in MessageVector and still have critical sections around loops.
This was very important. One of the exceptions was caused due to that
collection being changed by an add or remove operation while another
thread was doing a loop.

For better understanding of relevant changes I found my original patch
to the Novell library. It's attached. Again, this was to the previous
version of the lib, so you shouldn't apply it directly any current tree.
I submitted this in August and started some threads here about getting
it integrated, but that went nowhere. Here's the link to the Novell
Forge item:

To summarize, most of the relevant changes were for better background
error handling, moving around critical sections slightly to fix some
race conditions, and properly synchronizing the MessageVector

-JD Conley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jd-ldap.diff
Type: application/octet-stream
Size: 16514 bytes
Desc: jd-ldap.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060126/bc72b6a9/attachment.obj 

More information about the Mono-devel-list mailing list