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 3457918
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:55:08+00:00 2026-05-18T09:55:08+00:00

i have (want) to execute a search request to multiple sources. Now i’ve done

  • 0

i have (want) to execute a search request to multiple sources.
Now i’ve done some multithreading in the past, but it was all fire and forget.

Now what i want to do, is to spin up 3 identical requests on 3 different objects, wait until they are all ‘done’ (and that gives me the first question: how do they say ‘i’m done’, and then collect all the data thet’ve sent me.

So in pseudo code i have this interface:

interface ISearch
    SearchResult SearchForContent(SearchCriteria criteria)

So in code i create the three search services:

ISearch s1 = new SearchLocal();
ISearch s2 = new SearchThere();
ISearch s3 = new SearchHere();

And then call SearchForContent(SearchCriteria criteria) on all three of them, in a multihreaded / async way

and the they all come back to me with their SearchResult and after they are ALL done, i process their SearchResult objects.

I hope these lines of text kindof makes you get what is in my head 🙂

i’m working on a ASP.Net 3.5 C# project.

  • 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-05-18T09:55:09+00:00Added an answer on May 18, 2026 at 9:55 am

    Create AutoResetEvent and pass them to WaitHandle.WaitAll()

    There is an example here.

    Basically:

    1) You create an AutoResetEvent for each search and pass false to its constructor.

    2) Create the threads and run search for each one and at the end, call Set on the AutoResetEvent in the finally block. It is very important that calling Set is done inside the finally block otherwise WaitAll() will be waiting indefinitely.

    3) In the code right after you have spawned the threads, you call WaitHandle.WaitAll() and pass all those AutoResetEvent to it. This code will wait until all is finished.

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

Sidebar

Related Questions

I have some code that I want to execute as follows. But I keep
i have a file contain list of path now i want to execute command
I have a form in Excel with a combo box control. I want the
I'm not sure why but I haven't really been able to find the right
I am not sure what is the best strategy for this. I have a
Just as some background, I intend to write an Excel add-in with .NET that
Yes, this might sound like a newbie question but there's a TWIST! ( And
I recieved a crash report from MadExcept from a user. The Exception was Invalid
I am working on a wordpress theme and need to select posts that are
I'm writing a program in Ruby that downloads a file from an RSS feed

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.