-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Vinu
Message 1 in Discussion
Hi, I have an unusal situation working with worker threads. I am having a very tight
deadline and would really appreciate help on this . The scenario is as follows. I
have a COM API object which facilitates Asking for Stock Quotes and Place Orders
namely GenericFieldCodeValueCommandX. This DLL is provided by the Service Provider.
Issue : This object if instantiated through the main Thread gets instantiated
instantly. But if one of the worker threads call this function and with in the
function if its instantiated or referenced it just gets stuck up. My application
which I am developing talks to couple of other such Service Providers. In order to
facilitate this I have the following architecture created. Environment : VB.Net 1.0
Class GetRSPInfo
Private threadrRSP1 As Thread
Private threadRSP2 As Thread
Private threadRSP1_Start As New ThreadStart(AddressOf RSP1Connect)
Private threadRSP2_Start As New ThreadStart(AddressOf RSP2Connect) Function
getRSPData (Parameter : dataset containing command blocks to be sent to each Service
Provider ) Returns
dataset after each Service Provider populates as reply to the command block with in a
specific time limit threadRSP1 = New Thread(threadRSP1_Start)
threadRSP2 = New Thread(threadRSP2_Start) threadRSP1.Start
threadRSP2.Start
CurrThread.Sleep(System.TimeSpan.FromSeconds(30))
threadRSP1.Abort
threadRSP1.Join
threadRSP2.Abort
threadRSP2.Join
Return the populated Dataset End Function Public Sub RSP1Connect
RSP1Adapter = New GenericFieldCodeValueCommandX()
AddHandler RSP1Adapter.OnCommandComplete, AddressOf
RSP1Adapter_OnCommandComplete or RSP1Adapter.Data = "abcd"
At this point while executing this line where the object get instantiated
, or any place where the object get referenced it just gets stuck up. How
ever if the instantiation is done with the main thread that is with in the procedure
"GetRSPData" the instantiation goes off smoothly. End Sub
Private Sub GTAdapter_OnCommandComplete()
Populate dataset with the results from the RSP
end sub Public Sub RSP2Connect Send the data through a MSMQ to
another service and collect data. This is processed properly End Sub Thanks
in advance Regards Vinod
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]