[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: SteveKing <steveking_at_gmx.ch>
Date: 2005-03-25 20:31:00 CET

Will Dean wrote:
> 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.

You don't have to use _beginthread() anymore instead of CreateThread().
The MSDN states:
A thread that uses functions from the static C run-time libraries should
use the beginthread and endthread C run-time functions for thread
management rather than CreateThread and ExitThread. Failure to do so
results in small memory leaks when ExitThread is called. Note that this
is not a problem with the C run-time in a DLL.

Note the last sentence: "not a problem with the C run-time in a DLL" -
which is what we use. So this can't be the reason for a lock.

>> * 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.

Seems I too have to learn that there are API's which I never heard of ;)

I'll have a look at this one.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
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:31:33 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.