On several occasions I tried to access a java.util.LinkedList ll using two threads to write data to the beginning (using addFirst()) while trying to extract data from the end (using removeLast()) thus creating something like a buffer for sequential data access.
Alas! In a better world it would all have worked out the way I planned it.
In reality I keep getting error messages stating that a ConcurrentModificationException has occurred ... Weeeellll ... There's no way I can tell my Java environment that this is exactly what I intended to do: concurrent modification of data using one thread for input and one for output, respectively.
Tried synchronizing on the LinkedList object. Doesn't help. Java seems to be somewhat stubborn when it comes to bypassing the fail-fast behavior of it's Container classes ...
Any ideas, anyone?
Thanks in advance!
[ July 20, 2005: Message edited by: Steffen Reinhard ] [ July 20, 2005: Message edited by: Steffen Reinhard ]
author and iconoclast