Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8389483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:44:23+00:00 2026-06-09T18:44:23+00:00

I saw few people call function using syntax like: Parallel.Invoke(() => Method1(yourString1),() => Method2(youString2));

  • 0

I saw few people call function using syntax like:

Parallel.Invoke(() => Method1(yourString1),() => Method2(youString2));

And few people write code like:

Task myFirstTask = Task.Factory.StartNew(() => Method1(5));
Task mySecondTask = Task.Factory.StartNew(() => Method2("Hello"));

So my question is when one should use Parallel.Invoke() and when one should create instance of Task class and call StartNew() method.

Parallel.Invoke() looks very handy.so what is the significance of using Task class & StartNew() method………put some light and tell me the importance of different approach for same kind of job means call two function parallel with two different syntax.

i never use before the Task Parallel library. so there could be some hidden reason for using two approach for calling function. please guide me in detail. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:44:24+00:00Added an answer on June 9, 2026 at 6:44 pm

    Well, Parallel.Invoke will block until both of the new tasks have completed.

    The second approach will start two new tasks, but not wait for them to be completed. You could await them manually, or in C# 5 the new async/await feature will help you “wait” asynchronously.

    It really depends what you want to do. If you want your thread to block until all the tasks have finished, Parallel.Invoke is handy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i did a few searches and i saw a few people try to do
I saw few examples over internet of Hibernate using transaction.commit() for select statements. Below
I am a beginning practitioner in Scala and I saw a few different syntax
i saw few android apps got the interface similar with itune(as attached), user can
Today I saw a demonstration of the episerver cms and it had a few
I remember that at some point, I saw a programming challenge where people were
How do I run a MySQL Query in Java? I saw a few examples
I have read a few posts about people putting in either their own icons
I searched SO and saw a few questions posted on the topic, but I
I saw a few answers to this issue, and I get it — you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.