multi-threading question !

G

Guest

Hi,

I have a scenario wherein my parent app (dll) needs to make multiple Web
Service calls. Since the web service calls are independent, I thought that
triggering them off in different threads would be a better idea and save the
overall component execution time. The main component thread would wait for
all the thread to finish execution and then complete the processing
requirement. Based on my understanding I am under the impression that
"semaphores" is the way to go..

I have seen examples of how to initialize, increment and release a semaphore
usage. I'm stuck however in how do I make the parent thread wait for all the
threads to complete execution ?

Regards.
 
B

Brian Gideon

Hi,

I have a scenario wherein my parent app (dll) needs to make multiple Web
Service calls. Since the web service calls are independent, I thought that
triggering them off in different threads would be a better idea and save the
overall component execution time. The main component thread would wait for
all the thread to finish execution and then complete the processing
requirement. Based on my understanding I am under the impression that
"semaphores" is the way to go..

I have seen examples of how to initialize, increment and release a semaphore
usage. I'm stuck however in how do I make the parent thread wait for all the
threads to complete execution ?

Regards.

No need for a semaphore here. Just call the webservice method
asynchronously by invoking the BeginXXX and EndXXX version of the
call. It will return an IAsyncResult object that you can use to wait
for it to complete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multi-Threading 9
threading question 1
Basic Threading question 19
VB.net and threading 4
VB.Net - Multi-Threaded Model Having Problems.. 1
Threading question.... 4
Threading Issue 1
Connection limit 10

Top