G
Guest
Hi,
I am new to Multithreading in .NET and like to seek some guidance on the
following:-
Some Background
---------------------
I wrote a Data Acquisition program (usings Sockets) that monitor and get
data from a few Industrial Machines.
I need to query their Internal Relays and Data Register for status and
progress of each Job being assigning to those machine.
Then I need to update MsSQL with the data return back from those machines.
An additional Client Browser program I wrote, will actually query the MsSQL
for the data and update the UI. At the time the client get the data, it may
be a half a minutes outdated, but it is OK.
Client Browser <----> MsSQL <----> Data Acquisition ----> Industrial Machines
My Questions:
----------------
1) How do I write a multithreading routine that can run by itself and query
the Machines every n-seconds ?
2) Since the routine to capture the data from each machine is the same, is
it neccessary to create one thread for each machine or just one single thread
for
all the machines ?
3) After I got the data, should I update my MsSQL from the UI thread or from
the worker thread ?
4) What is the best way to communicate back to my client browser, which is
an exe by itself, that the data in the MsSQL has been updated and tell it to
refresh its UI?
I am using MsSQL 2000, VB.NET 2003, XP for Client Browser, Windows Server
2003 for Data Acquisition.
Thank You,
mfwoo
I am new to Multithreading in .NET and like to seek some guidance on the
following:-
Some Background
---------------------
I wrote a Data Acquisition program (usings Sockets) that monitor and get
data from a few Industrial Machines.
I need to query their Internal Relays and Data Register for status and
progress of each Job being assigning to those machine.
Then I need to update MsSQL with the data return back from those machines.
An additional Client Browser program I wrote, will actually query the MsSQL
for the data and update the UI. At the time the client get the data, it may
be a half a minutes outdated, but it is OK.
Client Browser <----> MsSQL <----> Data Acquisition ----> Industrial Machines
My Questions:
----------------
1) How do I write a multithreading routine that can run by itself and query
the Machines every n-seconds ?
2) Since the routine to capture the data from each machine is the same, is
it neccessary to create one thread for each machine or just one single thread
for
all the machines ?
3) After I got the data, should I update my MsSQL from the UI thread or from
the worker thread ?
4) What is the best way to communicate back to my client browser, which is
an exe by itself, that the data in the MsSQL has been updated and tell it to
refresh its UI?
I am using MsSQL 2000, VB.NET 2003, XP for Client Browser, Windows Server
2003 for Data Acquisition.
Thank You,
mfwoo