I have in my function BeginInvoke() and I don't use the EndInvoke() so this function end before the new thread,
So what happen with resources of the thread, the return value and out Argument of the function called,
When their Memory Released ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit ChoudharyPosted Feb 10, 2011, 6:59 AM
Liat AshkenaziPosted Feb 10, 2011, 7:27 AM
Liat AshkenaziPosted Feb 10, 2011, 6:15 AM
* "which point the GC will clean this info from memory", but it will clean it evenatlly ?
* "seperate child thread that was created during the BeginInvoke will be keep waiting for EndInvoke if it has already done its execution." till when?? I dont have endInvoke() cause I dont wait for the thread. So when the thread dies?
Amit ChoudharyPosted Feb 10, 2011, 6:03 AM
The CLR keep the information itself for all such runtime information so your results will remain in memory. I don't know at which point the GC will clean this info from memory. but It'll wait for an EndInvoke so that i can return back the results.
"your thread must be either got block or go on wait." This doesn't mean your mail worker thread got block but the seperate child thread that was created during the BeginInvoke will be keep waiting for EndInvoke if it has already done its execution.
Hope it make sense.
Liat AshkenaziPosted Feb 10, 2011, 5:52 AM
thanks for your answer,
but still I dont undrstand something.
I can use beginInvoke without endInvoke. and I dont get bake the function results.
so the results dont save in the memory at all, right?
"your thread must be either got block or go on wait."
what you mean in that?
Amit ChoudharyPosted Feb 10, 2011, 5:15 AM
Please go through this article here for Asynchronous programming.
If you use BeginInvoke() without EndInvoke() then your thread must be either got block or go on wait.
I found few more articles of your interest
http://weblogs.asp.net/justin_rogers/articles/126345.aspx
http://msdn2.microsoft.com/en-us/library/ms810439.aspx
Hope this helps you.
Please mark "Do you like this post" if it helps you.