File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Possible to have ConcurrentModificationException with multiple threads? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Possible to have ConcurrentModificationException with multiple threads?" Watch "Possible to have ConcurrentModificationException with multiple threads?" New topic
Author

Possible to have ConcurrentModificationException with multiple threads?

V Pinto
Greenhorn

Joined: Aug 06, 2011
Posts: 4
Hi!

Given the following code


Given that at any time an external thread can call remMethod() will I ever get a ConcurrentModificationException regarding the iterator it? I made the current thread to get the lock over the hash object when iterating so, in my understanding, even if an external thread tries to run remMethod() while iterating, wont be possible to get such an exception... I'm missing something?

Regards,RG
 
jQuery in Action, 2nd edition
 
subject: Possible to have ConcurrentModificationException with multiple threads?
 
Similar Threads
yield() on synchronized code
Threads question-15 needs justification
ConcurrentModificationException and for loops
start()-Method in Thread class
Parent Thread gets the same object lock has child threads? Confused!!