G
Guest
i Currently have a vb.net application that iterates through a selected
directory structure. I have 6 threads running all iterating through
different folders and does an insert into sql database. The 7th thread would
start sporadically at best sometimes not at all. I would like to use the
threadpool but am not sure where to start. I am currently using this code.
Friend WithEvents df As MCS.Parser
' CREATE THREAD
Thread1 = New System.Threading.Thread(AddressOf
df.StartIndexing)
Thread1.Priority = Threading.ThreadPriority.Highest
Thread1.Start()
if i have a list of 15 directories to iterate through how do i go about
limiting it to 6 and as a thread becomes available kick off the iteration of
the next. Currently i instantiate 6 objects and 6 threads so i do the above
6 times and i don't like it. If anyone has an inkling to enlighten me and
can pull me from the pit of stupidity it would be much appreciated.
JimK
directory structure. I have 6 threads running all iterating through
different folders and does an insert into sql database. The 7th thread would
start sporadically at best sometimes not at all. I would like to use the
threadpool but am not sure where to start. I am currently using this code.
Friend WithEvents df As MCS.Parser
' CREATE THREAD
Thread1 = New System.Threading.Thread(AddressOf
df.StartIndexing)
Thread1.Priority = Threading.ThreadPriority.Highest
Thread1.Start()
if i have a list of 15 directories to iterate through how do i go about
limiting it to 6 and as a thread becomes available kick off the iteration of
the next. Currently i instantiate 6 objects and 6 threads so i do the above
6 times and i don't like it. If anyone has an inkling to enlighten me and
can pull me from the pit of stupidity it would be much appreciated.
JimK