c# 3.0 - How can I execute different methods at the same time? -


in application using dataset , 4 methods below.

dataset ds=new dataset(); ds=businesslogiclayerobject.method1(a,b,c,d); ds=businesslogiclayerobject.method2(a,b,c,d,e); ds=businesslogiclayerobject.method3(a,b,c,d,e,f); ds=businesslogiclayerobject.method4(a,b,c,d,e,f,g,h); 

(a,b,c,d,e,f,g,h) parameters stored procedure in businesslogic layer. till did not implement threading concept executing 1 one.this takes lot of time result set in dataset.

how can execute above 4 methods @ same time?

help me.

regards, n.sriram

since using .net 3 make use backgroundworker take care of marshaling effort ui thread of other complexities of threading. not take care of locking; sure address locking aspect if needed.

backgroundworker worker = new backgroundworker(); worker.dowork += new doworkeventhandler(ongrabdata); worker.runworkercompleted += new runworkercompletedeventhandler(ongrabdatacompleted); worker.runworkerasync(new dataclass(a,b,c,d,e,f,g)); 

dataclass encapsulate parameters stored procedure access or perhaps pass delegate parameters can called within backgroundworker. either way backgroundworker should suffice in example provide simplistic threading behavior.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -