This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

What is a thread safe class?  RSS feed

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In one of my interview, intervieewer asked What is a thread safe class?
I didn't get its meaning?
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www-128.ibm.com/developerworks/java/library/j-jtp09263.html
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the article cited above says, there is no exact definition of a thread-safe class.

In general, a class should document how best to use it in a multi-threaded application. If such documentation is lacking in a class that you've picked up from elsewhere, UTSL. If you don't have the source, you're in trouble.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, what a great hacker dictionery! Who knew that Yu-Shiang Whole Fish was hacker argot?

Here's another one -- now you know

one-banana problem
n. At mainframe shops, where the computers have operators for routine administrivia, the programmers and hardware people tend to look down on the operators and claim that a trained monkey could do their job. It is frequently observed that the incentives which would be offered said monkeys can be used as a scale to describe the difficulty of a task. A one-banana problem is simple; hence "It's only a one-banana job at the most; what's taking them so long?"

At IBM, folklore divides the world into one-, two-, and three-banana problems. Other cultures have different hierarchies and may divide them more finely; at ICL, for example, five grapes (a bunch) equals a banana. Their upper limit for the in-house sysapes is said to be two bananas and three grapes (another source claims it's three bananas and one grape, but observes "However, this is subject to local variations, cosmic rays and ISO"). At a complication level any higher than that, one asks the manufacturers to send someone around to check things.
[ January 04, 2006: Message edited by: Jeff Albrechtsen ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!