Click here to Skip to main content
15,935,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have 3 thread:

Thread 1: get data from DB1
Thread 2: get data from DB2
Thread 3: get data from DB3

How to write my program runs:
- Start Thread 1, Thread 2, Thread 3
- Run Thread 1
- After finishing Thread 1 run Thread 2
- After finishing Thread 2 run Thread 3
- After finishing Thread 3 and run again Thread 1

Can you help me?????
Posted

It makes no sense, because it defeats the purpose of threading. Create one thread (if you even need it) and run the sequence. Anyway, you need to learn using threads in general. Start here:
http://msdn.microsoft.com/en-us/library/ms173178%28v=vs.100%29.aspx[^].

Please feel free to ask particular question if you face any problems.

—SA
 
Share this answer
 
Comments
[no name] 1-Apr-12 12:22pm    
5!
Sergey Alexandrovich Kryukov 1-Apr-12 12:28pm    
Thank you, Pranit.
--SA
SAKryukov is right. You should use threading only if you want to run something in parallel. If they are going to run one after another, no need of threading.
 
Share this answer
 
Seems like a bad design or you are not clear about what you want to do. All you need to do is have thread one get the data from the database. You have not provided any information that would require 3 threads to get data from 3 separate databases.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900