I need to allow task execution after main thread exits. Is it possible?
Or I should use Thread class explicitly for this purpose?
I need to allow task execution after main thread exits. Is it possible? Or
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 could write your own task scheduler to schedule tasks on non-threadpool-threads… but a simpler option would probably be to start a foreground thread which just waits for the relevant tasks to complete.
(It’s hard to give a code sample as you haven’t shown how the tasks are started etc, but it should be fairly easy.)