Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Static methods in concurrency

811242Feb 10 2011 — edited Feb 10 2011
I have a static method which takes a few String and double parameters and contains only local variables. When it is called by multiple threads there seems to be an exception thrown intermittenly. I got a little paranoid and so I've changed it to an instance method, and now the problem seems to disappear.

Is this just a coincidence? Is my static method intrinsically thread-safe? Or are there any concurrency issues with static methods that I'm not aware of?

Any reply is much appreciated!

Comments

807816
There is some coverage of this in my Blueprint on Virtualisation and Solaris Cluster [Virtualisation and Solaris Cluster,|http://wikis.sun.com/display/BluePrints/Using+Solaris+Cluster+and+Sun+Cluster+Geographic+Edition] IIRC. (This paper is due an update though!)

Hopefully others will chime in with their experiences of the products.

Tim
---

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 10 2011
Added on Feb 10 2011
15 comments
1,205 views