By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,576 Members | 1,932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,576 IT Pros & Developers. It's quick & easy.

Multi-Threading

P: n/a
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()
Feb 13 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Guru" <ru*****@interference.nitwrote in message
news:1k*************@news.alt.net...

<snipped>

Oh, and one other thing, what if the application was using SQL Command ,
Business and Data Access Layer objects and there was no DataTable in the
solution period in your narrow you are a real programmer mindset.

Let's get your vast expertise on that, since you needed to run your mouth.
One shoe doesn't fit all situations. And as far as I am concerned, you were
totally out of line here.
Feb 13 '08 #2

P: n/a
"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message
news:e5**************@TK2MSFTNGP05.phx.gbl...
>
"Guru" <ru*****@interference.nitwrote in message
news:1k*************@news.alt.net...

<snipped>

Oh, and one other thing, what if the application was using SQL Command ,
Business and Data Access Layer objects and there was no DataTable in the
solution period in your narrow you are a real programmer mindset.

Let's get your vast expertise on that, since you needed to run your mouth.
One shoe doesn't fit all situations. And as far as I am concerned, you
were totally out of line here.
The solution is as simple as you are... fix the SQL.

Eat that, cat cornholer.
Feb 13 '08 #3

P: n/a

"Guru" <ru*****@interference.nitwrote in message
news:eB**************@TK2MSFTNGP05.phx.gbl...
"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message
news:e5**************@TK2MSFTNGP05.phx.gbl...
>>
"Guru" <ru*****@interference.nitwrote in message
news:1k*************@news.alt.net...

<snipped>

Oh, and one other thing, what if the application was using SQL Command ,
Business and Data Access Layer objects and there was no DataTable in the
solution period in your narrow you are a real programmer mindset.

Let's get your vast expertise on that, since you needed to run your
mouth. One shoe doesn't fit all situations. And as far as I am concerned,
you were totally out of line here.

The solution is as simple as you are... fix the SQL.

Eat that, cat cornholer.
Yeah right -- LOL, don't put your John Brown behind parts in my face you
young lunatic American. Now, you go crawl back into your hole that you came
out of acting like a crazy person.

And one wonders why the rest of the world hates America. Well, with
lunatics like you running around in it ready to play cowboy and attack
anything that moves with no provocation, I see the reason, and I am
American. :)

Feb 14 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.