Sorry, but the problem is not in my code:
void SubMethodnvoke()
{
...
DoWorkDelegate.BeginInvoke
...
}
If you want.
My question is:
Does the machine free a thread in background if you use WaitOne() or Sleep(10000) ?
I can't find any doc and I'm afraid if a thread really sleeps during 10000 and is not free by the system. It seems to me to be a really bad management of the ThreadPool threads, doesn't it ?
If I run more waiting threads than the pool threads limit, my app is dead.
Hope you understand what information I ask.
Main Topics
Browse All Topics





by: photowhizPosted on 2008-02-11 at 12:31:57ID: 20869939
That code cannot possibly work; waiter and DoWorkDelegate are uninitialized. You are not saving the AsyncResult from BeginInvoke, nor calling EndInvoke.
/KB/cs/Asy ncMethodIn vocation.a spx.
Of course WaitOne will block, that is its purpose. If you don't want to block don't call WaitOne.
There is a good introduction to asynchronous methods at http://www.codeproject.com