the documentations always deals very explicitly with the issues of using one instance of an object with more than one thread.
However what do I need to know when there are some threads that have their own instance at the same time? Which interference could occur? How do I handle members like SimpleDateFormat that are quiet expensive to create?
Thanks
Mike
[;-)
If code from each thread is accessing different instances (objects) of the same class, that is not a problem; unless, of course, those objects are accessing shared objects, such as class static objects.
As the documentation for
SimpleDateFormatstates:One way of keeping separate instances for each thread would be to use a
ThreadLocalobject to keep track of separate instances.