Are lambda expressions multi-threaded?
Say when you write a mathematical formula as a lambda method, when you pass it to another method, would it be multi-threaded?
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.
Not 100% clear on what you’re asking.
Are you asking if lambdas are naturally run on a different thread?
If so no, they are just another instance of System.Delegate and run on the main thread unless specifically asked to do otherwise.
Are you asking if they are safe to run on multiple threads?
This is a question that can only be answered by knowing the contents of the lambda expression. They are not inherently thread safe. In my experience the are much less likely to be thread safe than you would expect.