Re: Spanning thread in WS Async Call

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Mohan Babu D" <MohanBabuD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D462EE79-E524-4EFC-A86C-B7E3792B5BCF@xxxxxxxxxxxxxxxx
Hi,
Here is my problem.

I am calling a web service asynchronously as follows

Registred the event handler as follows

_Data.GetDataCompleted += new MyNameSpace.GetDataCompleted
EventHandler(GetControlDataCompleted);


//Here is the call back method
void GetControlDataCompleted(object sender, GetDataCompletedEventArgs e)

{

//I get the some data from eventagrs e.

}

I want to span thread here to do some operation on the the result data and
then fill up some object. As this asyn call is on different thread ann even
if we span no of threadd, they will not executed as the calling async
thread's life cycles ends.

I'm sorry, I don't understand. Why don't you do your processing within the event handler? It will be called asynchronously, on a separate thread, when the GetData call completes.
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer

.



Relevant Pages

  • Re: Trouble with DeselectAll()
    ... DoCmdbehaves exactly like calling DeselectAll(), ... Calling DoCmdtwice also works. ... from an event handler seems to be what is broken. ...
    (microsoft.public.visio.developer)
  • Re: How to programmatically invoke Click event of the Button ?
    ... Or if I need to invoke an event of Label class? ... click event handler should call the TakeOrdermethod. ... you can call TakeOrderinstead of calling the ... was just calling your button's OnClick() method to do what the button was ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Idea
    ... its context object could be the control. ... that Sender is a requisite in every event handler, ... And I take it you mean the called code, not the calling code? ... > called in which you pass in a method pointer to set values in the ...
    (comp.lang.pascal.delphi.misc)
  • Re: Call Sub vs. fake a key press
    ... Rather then calling an event handler directly, ... > containing the code and that sub would be called from the If in the open ... > routine and from the stop routine. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Spanning thread in WS Async Call
    ... If I understand you, the issue is that, if you start more threads within the event handler, the request will be over by the time the other threads execute, and the state they are working on will disappear. ... Additional threads are good for only two things: improving utilization of unused CPUs and initiating I/O operations which can take advantage of unused I/O resources. ... John Saunders | MVP – Windows Server SystemConnected System Developer ...
    (microsoft.public.dotnet.framework.webservices)