• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

thread safe class

 
Shrawan Bhageria
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

Please let me know

How i make class thread Safe like Vector class.

Regards,

Sharwan
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cowboys,


you have to synchronize all methods that manipulate members of that class.
But this is only a very brief answer, your question implies to much to be answered in a forum in my opinion.
Have a look at CHAPTER 17
Threads and Locks
of the language specification:
http://java.sun.com/docs/books/jls/second_edition/html/memory.doc.html#30206

Yours,
Bu.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic