Solved

Threading

Posted on 2000-03-24
3
233 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
ID: 2657073
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
ID: 2686656
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
ID: 2699266
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

895 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

12 Experts available now in Live!

Get 1:1 Help Now