Read record information in to some time of storage (array, queue, etc.) called myStorage. Then create a subroutine called Process() like the pseudo code below.
Public thr1, thr2, thr3 As New System.Threading.Thread(Ad
Public myRecords 'Declare whatever type of storage you choosse to use.
Sub Main()
thr1.Start
thr2.Start
thr3.Start
End Sub
Sub Process()
beginThread:
'Synclock allows you to block access to an object from other threads until you release it
Synclock myRecords
'See if there is still a records left in myRecords to process
'If a record is available
'Get record information and remove the record from myRecords so that it can not be accessed by other threads once myRecords is released
End Synclock
If not (record is nothing) then
'Process Record
End if
System.Threading.Thread.Sl
GoTo beginThread 'Will start process all over again
End Sub
Main Topics
Browse All Topics





by: WorkingJourneymanPosted on 2005-09-14 at 13:20:55ID: 14884497
Sounds like a job for a thread pool, which is a facility built in to .Net. There are probably loads of PAQs on EE dealing with the subject. Just search on "thread pool" or "threadpool".