Solved

Threading

Posted on 2000-03-24
3
232 Views
Last Modified: 2010-05-02
I have to create a set of threads (say 5 threads)to which I should be able to pass queries.Each thread should be able
to process a single query.once a thread has finished its process I should be able to pass next query. AllThese threads which I'm creating should be in
single exe and the query should be passed from different exe.How to do this?
note: if i make any thing exe.that
default will be one thread.i don't
want this extra thread.
0
Comment
Question by:rose15
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
wpsjr1 earned 50 total points
Comment Utility
If you are using VB5 SP3 its possible to use CreateThread API.  However, this might not be a good idea ( see the article on threading by Daniel Appleman at http://www.desaware.com ) Other possibilities are an AX EXE set for Thread per object, or Matt Curlands sample on vbaccelerator at: http://vbaccelerator.com/codelib/tlb/threadapi_source.zip

It looks like Threading will become much easier when VB7 comes out.  I can't wait!  :)

Good Luck.

Paul

p.s.  I have a BAS module that allows Thread creation in VB5 SP3 if you like.
0
 
LVL 10

Expert Comment

by:caraf_g
Comment Utility
Threading without rocket science.

http://homepage.eircom.net/~carafa/TEMP/AWXB.zip

Explanation / order of compilation
AWXB02MSG.exe - (ActiveX.exe, one thread for all objects) Messaging application that will take care of sending messages between spawned threads and the main application.
AWXB01Thread.dll - The code that will be run in each separate thread
AWXB04Starter.exe - (ActiveX.exe, one thread per object) Application that will take care of creating each new thread.
AWXB03Test.exe - Standard exe. Main application / test bed.

Hope this helps.

0
 
LVL 10

Expert Comment

by:caraf_g
Comment Utility
Oh great stuff... Why exactly did wpsjr1 deserve a "D"?

If you're going to give someone a shitty grade you could at least explain yourself.

And I'm sure that if you'd given wpsjr1 a chance, wpsjr1 would have been happy to explain the details of the proposed solution to your problem.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now