Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Does Visual Basic 6 support Thread Programming?

Status
Not open for further replies.

nicleo

Advanced Member level 2
Advanced Member level 2
Joined
Sep 6, 2004
Messages
661
Helped
66
Reputation
132
Reaction score
12
Trophy points
1,298
Activity points
7,150
Thread Programming

I heard about 'Thread Programming'. My P4 supports 'HyperThreading Technology'. Do you think both 'phrases' referred to the same technology?

Does Visual Basic 6 support 'Thread Programming'?
 

Re: Thread Programming

You can have multiple threads on VB6 by using ActiveX servers, if you want to have multiple thread I recommed C++ instead of VB, since you can manage concurrency, control object access, ...

Hyperthreading is not quite the same as multi-threading, on the first, your P4 actually acts as having more than one processor within your machine, for multiple threads, a process can perform more than one function "at the same time" taking time slices for each function.
 

Re: Thread Programming

You can have multiple threads on VB6 by using ActiveX servers, if you want to have multiple thread I recommed C++ instead of VB, since you can manage concurrency, control object access, ...

Hyperthreading is not quite the same as multi-threading, on the first, your P4 actually acts as having more than one processor within your machine, for multiple threads, a process can perform more than one function "at the same time" taking time slices for each function.
 

Re: Thread Programming

if you ask for standart exe files, of course its possible.

in vb6 you can create and control threads via apis. but it can be difficult.

no native support for threads in std exes.
there are still main problem if you choose api way...

vb5, vb6 uses tls for main objects. eg. ERR object (maybe most important)

if one thread you created sets ERR objects what will happen. even if you call api, err will be set (err.getlasterror indicates error status in everywhere).

one threads error status affects another thread. you can use tlb's (typelibrary) to stop this.

Use threads in vb in this manner only for ntservices, event signalling, waitings etc. otherwise very very difficult tast waiting you...
 

Re: Thread Programming

Note:
TLS : Thread Local Storage

VB5, VB6 uses TLS to store ERR object, APP objects etc.

this means accessing them from another threats may not good for your program.

sure that best way is using dlls.
 

Re: Thread Programming

Thread programming is different from intel HT technology...Thread programming is to create multiple thread using operating systems system calls...means it makes change in execution of proigramme by changing in os behaviour where as HT technology is implimented through hardware...
 

Re: Thread Programming

A friend of mine has recently written program for multiple thread for its application in a supercomputer and he has also recommended C++.....hope this helps

Regards
drdolittle
 

Thread Programming

If a software is written using 'thread programming' technique, will it work 'faster' (e.g. if the software is written to do some calculation)?
 

Re: Thread Programming

Running multiple Threads is just like doing multiple tasks yourself.

You can only do 1 task at the same time BUT you can switch between 2 tasks. Same is sort of true when you have 1 cpu.

When you do task 1 and have to wait 5 minutes after a while, then you can do 2 things:
- Wait untill you can proceed with task 1 (Single Threaded)
- Do Task 2 (Multi Threaded)
So in this case you speed up your processing.

But when you can do task 1 continuously. Then you have to suspend task 1 and start doing task 2. You loose the time you need for switching.
In this case you slow down your processing

Hyperthreading is emulating 2 processors running at the same time ;-)
When you have some spare fingers while doing task 1, you might use them to do parts of task 2 and do two tasks at the same time. But only females can do that!!! ;-)

Antharax
 

Thread Programming

hi,

If a software is written using 'thread programming' technique, will it work 'faster' (e.g. if the software is written to do some calculation)?

Yes, if u have multiple CPU's in ur m/c and u have programmed to utilize them,
No if u have a single CPU.
 

Thread Programming

f a software is written using 'thread programming' technique, will it work 'faster' (e.g. if the software is written to do some calculation)?


The answer to your question lies in the difference between multiprogramming and multitasking. A wordprocessor in which you type and simultaneously are doing a spell check on the written material is an good example of software using thread programming
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top