У меня есть (хочу) выполнить поисковый запрос к нескольким источникам. 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.