• Post Reply Bookmark Topic Watch Topic
  • New Topic

A basic synchronization question  RSS feed

 
Bryce Hui
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me understand this:
What synchronization constructors does Java provide? How do they work?
Thanks.
 
Greg Charles
Sheriff
Posts: 3014
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bryce! I think what you need is a book. However, this link may get you started: http://java.sun.com/docs/books/tutorial/essential/threads/index.html
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A constructor can only be called by one thread at a time. You could never have two "new MyObject()" calls interferring. If you need them to be synchronized accross the class, that is possible, but I'd advise you to rethink your design as this is a very unusual question.
Perhaps you could provide a business problem that we could help you with.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!