When a thread starts, who decides the status of thread; whether it is alive or dead?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You haven’t said, but I’m assuming that you’re referring to the Thread.IsAlive property in .NET.
This property is set automatically by the framework itself. Basically, when you go
Thread.Start(), the framework runs a bit of code that sets up the thread to be ready to run (including settingIsAlivetotrue), opens atry...catchblock and calls your delegate. When your delegate returns (or an exception is thrown) there is more code inside the framework that executes to tear down the thread (and setIsAlivetofalse).