By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

multi-threading question !

P: n/a
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.
--
Ravi Shankar
Sep 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sep 16, 10:48 am, Ravi Shankar <shankych...@newsgroup.nospam>
wrote:
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.
--
Ravi Shankar
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.

Sep 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.