dcsimg
Results 1 to 6 of 6

Thread: Getting System.ArgumentOutOfRangeException and System.AggregateException error

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2013
    Posts
    35

    Getting System.ArgumentOutOfRangeException and System.AggregateException error

    Name:  4Aj6oBc.png
Views: 563
Size:  39.4 KB

    I am getting those errors while i perform a Parallel.For task on my listview. I do not always get these errors but sometimes i do also if you want to know what listview actually contains i am connection to a server(live) and all the usernames are listed on listview

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    22,948

    Re: Getting System.ArgumentOutOfRangeException and System.AggregateException error

    do you remove listview items in the Parallel.For loop?

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2013
    Posts
    35

    Re: Getting System.ArgumentOutOfRangeException and System.AggregateException error

    Quote Originally Posted by .paul. View Post
    do you remove listview items in the Parallel.For loop?
    Not in the Parallel.For loop but since im connectiong to a live stream users might connect and disconnect any time though im not deleting anything on purpose.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    22,948

    Re: Getting System.ArgumentOutOfRangeException and System.AggregateException error

    that is probably the problem...

  5. #5

    Re: Getting System.ArgumentOutOfRangeException and System.AggregateException error

    It's a race condition. You start the For loop with, say 9 people (indexes 0, 1, 2, 3, 4, 5, 6, 7, and 8). While the loop is running, person 8 disconnects. So now, you only have 0 through 7. However, your for loop is still configured to go to 8. There's the problem.

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2013
    Posts
    35

    Re: Getting System.ArgumentOutOfRangeException and System.AggregateException error

    @.paul. @formlesstree4 Ahh i see thnx seems like i shouldnt multithread the listview in this case unless i can do something to avoid the said issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width