threading concept question-is this possible?

  • Thread starter Thread starter microsoft
  • Start date Start date
M

microsoft

Just researching threading and I'm sure we need to do more review of
available resources BUT I'm wondering if what we're looking for is actually
possible. If it is we can keep reading.

I know it's more complex than this but conceptually we want to have one set
of instructions (one SUB probably) and run that same set of instructions
several times each in its own thread accessing some shared information and
some information specific to that instance.

I've seen examples where there are basically different sets of instructions
and each run in it's own thread.

Thanks.
 
* "microsoft said:
Just researching threading and I'm sure we need to do more review of
available resources BUT I'm wondering if what we're looking for is actually
possible. If it is we can keep reading.

I know it's more complex than this but conceptually we want to have one set
of instructions (one SUB probably) and run that same set of instructions
several times each in its own thread accessing some shared information and
some information specific to that instance.

Yes, that's possible.
 
Hi,

you can call any static or instance method / property from threads, so
nothing prevents you from using this approach. The only issue as usual with
threads is synchronizing access to shared data.

HTH
Alex
 
Thanks. A follow-up question. In VB6 to accomplish what we are doing we
created an out-of-process ActiveX.exe which would load multiple instances.
We passed the information to it and ran many instances. Do you think
threading would be a better approach now that vb.net seems to able to handle
that?

(Basically the app gets data from another application (a live data feed for
several futures and stocks) and then passes this data as it arrives to
stored procedures in MSSQL2000 for processing and inserting into a couple of
tables).
 
microsoft said:
Thanks. A follow-up question. In VB6 to accomplish what we are doing we
created an out-of-process ActiveX.exe which would load multiple instances.
We passed the information to it and ran many instances. Do you think
threading would be a better approach now that vb.net seems to able to handle
that?

The ActiveX EXE approach in VB6 was a bit cumbersome and hard to get *just*
right, but very reliable once you got the hang of it.

But yeah, now that .NET supports threads natively there's no need to do
something like that. A single process with multiple threads will work just
fine in most cases.
 
* "microsoft said:
Thanks. A follow-up question. In VB6 to accomplish what we are doing we
created an out-of-process ActiveX.exe which would load multiple instances.
We passed the information to it and ran many instances. Do you think
threading would be a better approach now that vb.net seems to able to handle
that?

(Basically the app gets data from another application (a live data feed for
several futures and stocks) and then passes this data as it arrives to
stored procedures in MSSQL2000 for processing and inserting into a couple of
tables).

Yes, you could start multiple threads, each doing its work. You don't
need separate components to do that in .NET, you can do that within
your, for example, Windows Forms project.
 
Back
Top