Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Multi-threading

Multi-threading

Scheduled Pinned Locked Moved C#
helpdatabasedata-structures
3 Posts 3 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MAW30
    wrote on last edited by
    #1

    I have all my data stored in DataTables, when I run my program using multi-threading I get an error message. I don't remember the exact wording but, it said index out of bounds of the array. However it does not appear to be out of bounds. When I run the program without using the multi-threading everything is fine. Also, most of my methods are static, I lock the datatables when loading data. I can't find where the problem exist, because where I believe the program line failed it does not show it as being out of bounds. Any help would be greatly appreciated, thanks in advance. Michael

    L D 2 Replies Last reply
    0
    • M MAW30

      I have all my data stored in DataTables, when I run my program using multi-threading I get an error message. I don't remember the exact wording but, it said index out of bounds of the array. However it does not appear to be out of bounds. When I run the program without using the multi-threading everything is fine. Also, most of my methods are static, I lock the datatables when loading data. I can't find where the problem exist, because where I believe the program line failed it does not show it as being out of bounds. Any help would be greatly appreciated, thanks in advance. Michael

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you're deleting in one thread while retrieving in another, you can get an out of bounds if you don't protect against it.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      1 Reply Last reply
      0
      • M MAW30

        I have all my data stored in DataTables, when I run my program using multi-threading I get an error message. I don't remember the exact wording but, it said index out of bounds of the array. However it does not appear to be out of bounds. When I run the program without using the multi-threading everything is fine. Also, most of my methods are static, I lock the datatables when loading data. I can't find where the problem exist, because where I believe the program line failed it does not show it as being out of bounds. Any help would be greatly appreciated, thanks in advance. Michael

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Without seeing the code it's impossible for anyone to tell you what's going on.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups