Multi-Threading

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Barkingmadscot

    Multi-Threading

    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(file Nm)
    Dim AppThreads(4) As Thread
    Dim WebData(intcoun t1) As DoWork

    Do Until intcount intcount1

    WebData(Thread) = New DoWork

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

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

    '# Setup and start new thread
    AppThreads(Thre ad) = New Thread(AddressO f
    WebData(Thread) .sWriteWebUsage )
    AppThreads(Thre ad).Start()
    System.Threadin g.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(thre ad).start()
  • Mr. Arnold

    #2
    Re: Multi-Threading


    "Guru" <running@interf erence.nitwrote in message
    news:1krcae.sr6 .19.1@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.


    Comment

    • Guru

      #3
      Re: Multi-Threading

      "Mr. Arnold" <MR. Arnold@Arnold.c omwrote in message
      news:e5wRzwmbIH A.4144@TK2MSFTN GP05.phx.gbl...
      >
      "Guru" <running@interf erence.nitwrote in message
      news:1krcae.sr6 .19.1@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.


      Comment

      • Mr. Arnold

        #4
        Re: Multi-Threading


        "Guru" <running@interf erence.nitwrote in message
        news:eBOvuXpbIH A.4696@TK2MSFTN GP05.phx.gbl...
        "Mr. Arnold" <MR. Arnold@Arnold.c omwrote in message
        news:e5wRzwmbIH A.4144@TK2MSFTN GP05.phx.gbl...
        >>
        >"Guru" <running@interf erence.nitwrote in message
        >news:1krcae.sr 6.19.1@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. :)

        Comment

        Working...