Multi-Threading

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am having problems with Multi-threading and write to Key Access
Database

I have a log file that and collecting infomation from

getting the info is a problem or is writing it the database, the log
files a big and it takes time to read down as it get further in to log
said, a 100,000 line in

I have changed it to mutli-threading which almost works, the problem
is when writing data to the table. I get dup keys and the whole
stops, this does not happen with the single thread app.

basically i want each thread to wait until thread before finish its
write to the database.

ie.
thread 1 waits for thread 0 to finish writing to table
thread 2 waits for thread 1 to finsih writing to table
thread 4 waits for ..........

during this each for the thread have collected the data they need to
write to the table.

Here is the line code to

Dim intcount As Integer = 1, intcount1 As Integer =
fNoOfLines(fileNm)
Dim AppThreads(4) As Thread
Dim WebData(intcount1) As DoWork

Do Until intcount > intcount1

WebData(Thread) = New DoWork

'################################

Code collecting data is here
################################

'# Setup and start new thread
AppThreads(Thread) = New Thread(AddressOf
WebData(Thread).sWriteWebUsage)
AppThreads(Thread).Start()
System.Threading.Thread.Sleep(15)
intcount = intcount + 12
Loop

I removed all the code that does the data collecting as it works
fine,

I believe my problem is at the Appthreads(thread).start()
.



Relevant Pages

  • Re: Ping Howard
    ... staff to go out and do the collecting, and if this database is as goosed as ... Also transit reading' of ID, monitoring passing motorists, pedestrians who ... address, which will work for honest citizens whose chip was misread, but not ...
    (uk.business.agriculture)
  • Re: Multi-Threading
    ... wanted to know what is the missing synchronization code you should add... ... Dim WebDataAs DoWork ... Do Until intcount> intcount1 ... I removed all the code that does the data collecting as it works ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Multi-Threading
    ... Dim WebDataAs DoWork ... Do Until intcount> intcount1 ... I removed all the code that does the data collecting as it works ...
    (microsoft.public.dotnet.languages.vb)
  • AIX customer billing system.
    ... A hosting company needs to invoice its customers as per machine usage ... Has anyone tried writing any codes for collecting such info and ...
    (comp.unix.aix)
  • Formatting numbers
    ... We have one database that they are constantly reformatting their ... At first they were wanting us to format the fields so they could not ... collecting over 100 values for each person. ...
    (comp.databases.ms-access)