This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threadsafely of variables.

 
Siddharth Purandare
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was reading the thread safety of variables when we implement the SingleThreadModel interface and when we don�t implement the SingleThreadModel interface. The final conclusion is that only the request time variables and the local variables are thread safe and no other variables. That�s fine with me, no issues in that.

My doubt is that is that � Is StringBuffer variables thread safe irrespective of their position and irrespective of whether the class implements SingleThreadModel�??? (As the StringBuffer Class objects are threadsafe by default). Please clarify if I am wrong to interpret something.

Thanks in advance.
[ December 07, 2006: Message edited by: Siddharth Purandare ]
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, this is a redundant question.
Like I said before, SingleThreadModel is deprecated and no longer on the exam so you can forget about it.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!