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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 10, 2011, 1:59 AM EST
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 10, 2011, 12:15 AM EST
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.
Liat Ashkenazi18 reputationPosted Feb 10, 2011, 12:52 AM EST
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 ChoudharyRank #145 · 15.8K reputationPosted Feb 10, 2011, 1:03 AM EST
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 Ashkenazi18 reputationPosted Feb 10, 2011, 1:15 AM EST
* "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?
Liat Ashkenazi18 reputationPosted Feb 10, 2011, 2:27 AM EST