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

Re: [patch, suggestion, notes] for Applying CAutoHandle (r21053, r21058)

From: Oto BREZINA <otik_at_printflow.eu>
Date: Sun, 27 Mar 2011 21:21:51 +0200

On 2011-03-27 11:44, Stefan Küng wrote:
>
> Wow! Thanks for all your comments.
my pleasure
> Here my thoughts on those:
>
> return value in CDirWatchInfo::CloseDirectoryHandle(): the return value
> is nowhere used, so it's ok to change the value to true in case the
> handle could be closed properly.
Ok, I just was not sure.
> TSVNCache.cpp: reload protection mutex wasn't closed before: that worked
> before too since the mutex is released by the OS automatically when the
> process finishes. Only now with the CAutoHandle we close it ourselves.
Though that.
> Closing thread handles is not necessary since those are pseudo-handles,
> and most people don't even use those (i.e., ignore the return value of
> the beginthreadex function).
So when you use _beginthreadex, for running short running threads, you
can allocate lot handlers (pseudo one)?
What means pseudo handler - don't found that related to this function?
You can not close it? It get lost object once thread end, so it will
point nowhere .. ?
It means you can exhaust system this way? will check once will have more
time. Not an issue for limited number of thread however may be
interesting when lot created.
I read this http://msdn.microsoft.com/en-us/library/kdzttdcb.aspx - get
not much for this issue. (you should not use CloseHandle on _beginthread
handler what is NOT our case)
http://stackoverflow.com/questions/1775822/out-of-memory-on-beginthreadex here
is stated that CloseHandle should be called.
Of course you may really on OS expect it closes all handles on exit.
The question is: When you can close thread handle? Immediately after
creating or after thread finishes? If you can close it immediately i
there any gain ?
There are many thread created from main threads, is ok - by
documentation - to close those handles imediatly? It works, but ...

Side question: why you don't pass NULL on *thrdaddr parameter?

> Stefan

-- 
Oto BREZINA, Printflow s.r.o., EU
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2714593
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-03-27 21:24:13 CEST

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.