[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] Re: 2870: TSVNCache deadlock

From: Will Dean <svn_at_indcomp.co.uk>
Date: 2005-03-25 20:10:51 CET

At 19:51 25/03/2005 +0100, you wrote:

>* When creating the threads in TSVNCache, you should use _beginthreadex()
>instead of CreateThread()? _beginthreadex() initializes the C runtime
>library, and calls to the C lib are only allowed when you created the
>thread with one of the beginthread() functions. You do call runtime
>functions in TSVNCache, don't you (I have not checked)? I think the risk
>of deadlocks is one possible result if you fail to do so (hint hint ;-))

This is originally my fault, and is because I threw the named-pipe server
together from a SDK sample... I don't know if there are more threads now,
also being created wrongly.
It may have become more of a problem recently as the cache code has got
much more complicated and may do more CRT stuff. It certainly ought to be
fixed.

>* In the shell extension part, you use blocking pipe access. That means
>there may be situations where the ReadFile/WriteFile calls block forever.
>Maybe you should switch to overlapped I/O there and let the pipe
>transaction timeout after some time. This might prevent the explorer
>deadlock if the cache is hanging.

Possibly, but as I always say when these things come up, we should fix the
problem in the cache, not paper over it. There's no reason why the cache
shouldn't respond properly (or terminate, breaking the pipe and hence the
blocking read), and I would be concerned that the additional complexity of
going to overlapped I/O would create other hazards. But it might be worth
doing once the cache is working properly, at least to prevent annoying
Explorer hangs, which many people don't know how to get out of. I don't
ever see shell hangs on earlier versions of the cache, except when the
cache hits assertions (I run a debug build, of a version which is very
buggy if you delete files or folders.)

>* Is there a particular reason for not using TransactNamedPipe() on the
>client side? Just curious...

I didn't know anything about it - it looks like it would be a good idea,
though I suspect that any perf improvement on a local machine will be
minor. If I ever get free enough of my current work commitments I would
play with adding it, though I expect Steve will get there before me on
current form.

Cheers,

Will

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Fri Mar 25 20:12:20 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.