Hi experts, i wanna ask u about thread. i've a problem in threading, i've had webservice that contain 3 method, such as : ReceiveDataStatic, ReceiveDataInvestor, and ReceiveDataValidator.
When the client want to use this service, they can use these methods at the same time. I've confused about the performance of my application,so i've made some thread like this : :~
[WebMethod]
public void ReceiveDataStatic(object obj)
{
ClassMessage o = new ClassMessage();
o.ProcessMessage(obj);
}
[WebMethod]
public void ReceiveDataInvestor(object obj)
{
ClassMessage o = new ClassMessage();
o.ProcessMessage(obj);
}
[WebMethod]
public void ValidatorDataInvestor(object obj)
{
ClassMessage o = new ClassMessage();
o.ProcessMessage(obj);
}
public void ProcessMessage(object obj)
{
switch (type)
{
case "Data Static":
oThread1 = new Thread(ParseDataStatic);
oThread1.Start(obj);
break;
case "Data Investor":
oThread2 = new Thread(ParseDataInvestor);
oThread2.Start(obj);
break;
case "Inventory Validation":
oThread3 = new Thread(ParseDataInvValidation);
oThread3.Start(obj);
break;
}
}
Hhhmmm.. i think, this my trick.. :~ As we know, to process something is based on FIFO (First In, First Out). So, if one client want to use "ReceiveDataStatic" first, the message that is reveived by this method will be processed as early as possible. And how, if other client using other method, mmm.. we assume they use "ReceiveDataInvestor" method at the same time?? Is this thread can run at the same time (we must remember about FIFO)?? (i mean that 2 threads can run simultaneously.)
Is there any suggestion or the best way for this problem..?? help me please.. :confused: