Results 1 to 5 of 5
Thread: How to synchronize an object ???
- 08-10-2011, 03:19 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 12
- Rep Power
- 0
-
"Synchronize an object" doesn't make any sense. Can you please elaborate on your question?
- 08-10-2011, 03:27 PM #3
Member
- Join Date
- Jul 2010
- Posts
- 12
- Rep Power
- 0
Dear Fubarable ,
Here is my detailed question .
In collections , we have two classes ArrayList and Vector .
ArrayList is a non synchronized class and Vector is a synchronized class . Am I right ?
So, what is this synchronized class ???
And I know how to synchronize a method . But I don't know how to synchronize a class similar to that of Vector .
hope you will get me clearly .Anantha Nag . KUNDANALA
ph : 9052012019 , 8143195317
- 08-10-2011, 03:48 PM #4
There is no such thing as a "synchronized Object". Vector contains some synchronized methods and/or code pieces. That's it. If you want to "synchronize a class", just make sure it is thread safe.
Although, to be fair to the OP, the Vector API does say this: Unlike the new collection implementations, Vector is synchronized.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 08-10-2011, 03:52 PM #5
Member
- Join Date
- Jul 2010
- Posts
- 12
- Rep Power
- 0
Similar Threads
-
How to get previous element from collection and correctly synchronize threads?
By atch in forum New To JavaReplies: 1Last Post: 02-08-2010, 01:33 PM -
how to synchronize a thread
By sumanandjesus in forum Advanced JavaReplies: 4Last Post: 03-14-2009, 10:26 AM -
How to synchronize blocks instead of entire methods
By Java Tip in forum java.langReplies: 0Last Post: 04-09-2008, 06:39 PM -
How to synchronize threads on an object
By Java Tip in forum java.langReplies: 0Last Post: 04-09-2008, 06:39 PM -
Can't synchronize multiple JPanels in a JFrame
By vassil_zorev in forum AWT / SwingReplies: 0Last Post: 12-30-2007, 04:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks