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
Joined
Sep 6, 2004
Messages
661
Helped
66
Reputation
132
Reaction score
12
Trophy points
1,298
Activity points
7,153
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'?
 

jmantilla

Junior Member level 2
Joined
Oct 4, 2004
Messages
20
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Colombia
Activity points
206
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.
 

jmantilla

Junior Member level 2
Joined
Oct 4, 2004
Messages
20
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Colombia
Activity points
206
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.
 

ben123

Member level 1
Joined
Aug 27, 2003
Messages
32
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
372
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...
 

ben123

Member level 1
Joined
Aug 27, 2003
Messages
32
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
372
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.
 

raj_rohit10

Advanced Member level 4
Joined
Jul 14, 2004
Messages
100
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Activity points
891
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...
 

DrDolittle

Full Member level 3
Joined
Sep 24, 2004
Messages
162
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Location
Within arm's reach
Activity points
1,443
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
 

nicleo

Advanced Member level 2
Joined
Sep 6, 2004
Messages
661
Helped
66
Reputation
132
Reaction score
12
Trophy points
1,298
Activity points
7,153
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)?
 

Antharax

Full Member level 4
Joined
Dec 31, 1999
Messages
208
Helped
14
Reputation
28
Reaction score
1
Trophy points
1,298
Activity points
2,865
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
 

sshahid47

Advanced Member level 4
Joined
Nov 5, 2004
Messages
101
Helped
15
Reputation
30
Reaction score
2
Trophy points
1,298
Activity points
974
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.
 

ashish sharma

Full Member level 2
Joined
Jul 6, 2004
Messages
132
Helped
9
Reputation
18
Reaction score
5
Trophy points
1,298
Activity points
1,120
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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top