The moose likes Threads and Synchronization and the fly likes A basic synchronization question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "A basic synchronization question" Watch "A basic synchronization question" New topic
Author

A basic synchronization question

Bryce Hui
Greenhorn

Joined: May 21, 2003
Posts: 1
Can anyone help me understand this:
What synchronization constructors does Java provide? How do they work?
Thanks.
Greg Charles
Bartender

Joined: Oct 01, 2001
Posts: 1855

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

Joined: Feb 28, 2003
Posts: 227
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.
 
jQuery in Action, 2nd edition
 
subject: A basic synchronization question
 
Threads others viewed
object lock
Question about synchronized
connection object...
Thinking in Java's Concurrency chapter: the BankTellerSimulation example
Remove a subset of objects at once
IntelliJ Java IDE