Results 1 to 4 of 4
- 06-11-2011, 06:16 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 3
- Rep Power
- 0
Some Thread Synchronization Question?
i have one doubt regarding synchronization in java threads
1)As in case of static synschronized methods , thread get a lock on the Class object for that class.
if it locks the class object then if any other thread want to create a new instance of that class , does it has to wait till lock gets released?Last edited by javakt; 06-12-2011 at 01:11 PM.
- 06-11-2011, 06:42 PM #2
Is there a program you are having a problem with?
Have you tried writing some short programs to test these questions? If so please post them with your questions.
- 06-11-2011, 06:52 PM #3
Member
- Join Date
- Jun 2011
- Posts
- 3
- Rep Power
- 0
Actually i am new to threads. Yes i have written some programmes but did not post here as these are generics questions. Got bit confused so thought of getting clarity on basics of threads
- 06-11-2011, 06:58 PM #4
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,068
- Blog Entries
- 3
- Rep Power
- 15
People may be hesitant to help, how do we know these aren't homework questions?
Your questions also seem a bit confusing and it would be helpful to clarify them if at all possible.
As for static synchronized methods, I'm pretty confident that it obtains the lock of the Class object for that class.
Similar Threads
-
Thread synchronization
By rajanis in forum Threads and SynchronizationReplies: 3Last Post: 02-18-2011, 01:30 PM -
Thread synchronization
By rajanis in forum Threads and SynchronizationReplies: 0Last Post: 01-07-2011, 08:38 AM -
Thread safe without using synchronization
By swetu.vc in forum Threads and SynchronizationReplies: 3Last Post: 01-20-2010, 09:06 AM -
synchronization question
By oguz in forum Threads and SynchronizationReplies: 2Last Post: 07-22-2008, 09:56 AM
Bookmarks