10
Comments
  • 2
    That exception mostly occurs not because of multithreading but because you are editing the ArrayList inside a for each loop. Any chance that's what you are doing?
  • 1
    @bdhobare I know.
    But in my case it really was a multithreading problem.
    The list was altered by a thread listening for incoming network-traffic, which occours *when it wants* while the list is constantly iterated over.

    Because i don't want a buffer-list it threw CME sometimes.:b

    Synchronized and all that shit didn't work as expected..

    Got shit done by now, the CopyOnWriteList is pretty nice for now.
  • 0
    @PenguinRage i know, i know, but the ~rage~ is still real.:D
  • 0
    @PenguinRage oh really, a data race since elements can not be inserted atomically to a vector in c++ makes sense when I tell you it happened, but it's definitely not intuitive. When something's not intuitive the problem is with the language and not with you (although you can overcome language problems with experience, like people overcomed IE6 by learning all the css hacks)
  • 0
    @PenguinRage yes but what I just did is to question the paradigm, there are other ways to deal with concurrency except for explicit mutexes, which may and should be used in most common use cases, maybe all of them except for writing an OS
Add Comment