I’d like for someone to tell me the pros (and cons) for using the post function. Why and when should I prefer using post and why/when should I not want to use it?
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.
Post is very useful when you want the callback to occur essentially now, but not in the current context. Reasons might include:
The current context is holding locks and you want the function to be called after they have been released. This would allow the function to acquire those locks itself without causing a deadlock.
The call stack might be very deep
The current thread might be inappropriate for the function in some other way, and post is a convenient way of scheduling the function in another thread.