Hmm... I just noticed that in the version of your patch that I have at
least, the creator thread can have both countLock and headLock at the
same time, I tried to avoid any one thread grabbing more than one lock
at the same time... is that possible?

Ahh, I see if we don't synchronize both headLock and countLock we have a
possible NPE we would have to check... disgusting.

/me ponders

--Brandon

On Sat, 09/27/03 at 19:09:15 -0400, Edward J. Huff wrote:
> On Sat, 2003-09-27 at 15:06, Brandon Low wrote:
> > I agree with your patch, and you're right that since the creator thread
> > is the _only thing anywhere_ that calls create and destroy my changes
> > were unneeded.
> 
> Your confusion demonstrates the need to move that code into the
> body of the loop.  Fine grained locking is hard to get right.
> 
> > 
> > You might want to make the wait in the tail of the loop 1000 (didn't see
> > that in your patch, sorry if I missed it, I'm not very good at reading
> > context diff, only udiff)
> 
> I just typed CTRL-X v = into emacs to get the patch.  
> I'll figure out how to make it use -u by default.
> The wait 1000 change was in.
> 
> > 
> > Go ahead and commit your version (with possibly 1000 ms wait).
> 
> If you can believe it, there was another bug.  I referred to
> available outside of synchronized(countLock)...  Fixed it to
> use a snapshot of available before unlock.  Also added some
> more comments (that's when I discovered the bug).  Then
> I found another.  Inserting the destroyThread function
> (which had a return statement) was tricky and I got it
> wrong the first time, and the second time...
> 
> I'm running a node with the changed version now and will commit
> the changes later today.
> 
> -- Ed Huff
> 



> _______________________________________________
> Devl mailing list
> [EMAIL PROTECTED]
> http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl
_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to