multi-threading question !

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UmF2aSBTaGFua2Fy?=

    #1

    multi-threading question !

    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
  • Brian Gideon

    #2
    Re: multi-threading question !

    On Sep 16, 10:48 am, Ravi Shankar <shankych...@ne wsgroup.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.

    Comment

    Working...