[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multithread in Visual Basic



PureBytes Links

Trading Reference Links

The terminology is a bit off in your question, which may make the answers
you get a bit confusing...  Most of my experience is in the UNIX world, but
the concepts are the same.

There are 3 concepts involved in what you asked for:
- processor (CPU of the computer)
- process (a running instance of a program)
- thread (a sequence of instructions within a process)

The number of processors (actual chips in your computer) is rather
irrelevant to the solution to asked about -- except for execution speed of
course.  If you're computer has multiple processes, the operating system
can actually execute more than one thread and/or process at a time (rather
than swap them out to give the illusion of multitasking)

You could run one ~process~ (minus the "or") for analyzing and another
process for getting stock quotes.  In this case, they could very well be
two seperate VB programs.  In this case you would need to look into some
communication means for them to talk together (to pass the data).

Threads...  This is only needed when you want one executable with a common
memory area to split up and do two (or more) things at once.  Processes can
split up into multiple processes or multiple threads.  Running multiple
threads and multiple processes are similar except that threads share the
same variables and such.  Because variables and such are shared,
multithreaded programming can be more complex (or dangerous) and you have
to be concerned that all libraries that you use support multithreading.

My ~guess~ is that VB doesn't do multi-threading.  Most C++ environments
will (I don't recall if it's part of the standard).

If you don't understand these terms, you'd probably be best off starting
with multi-processes to reduce your learning curve.


...I just reread your question.  If you meant "processor" as in computer
(i.e. use one computer for getting data and another computer for
analyzing), that would be a different beast.  In that case, threads would
do you no good.  You'd need to write two seperate programs and find a way
to comunicate between the two computers.


At 01:22 AM 5/19/99 -0400, HP Wei wrote:
>I realize that there are a lot of Visual Basic gurus
>on this list.  So, I'd like to post this question here.
>To develop a program which uses
>one processor for getting stock quote and another
>processor for analyzing, we need multithread. 
>My question is:
>can Visual Basic do this?  Or do we need to resort
>to C++?  
>If VB can do this, can you point me to some references?
>Thanks,
>HP Wei
>
>
>
>