Results 1 to 4 of 4
  1. #1
    javakt is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default 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 12:11 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    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.

  3. #3
    javakt is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default

    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

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    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

  1. Thread synchronization
    By rajanis in forum Threads and Synchronization
    Replies: 3
    Last Post: 02-18-2011, 12:30 PM
  2. Thread synchronization
    By rajanis in forum Threads and Synchronization
    Replies: 0
    Last Post: 01-07-2011, 07:38 AM
  3. Thread safe without using synchronization
    By swetu.vc in forum Threads and Synchronization
    Replies: 3
    Last Post: 01-20-2010, 08:06 AM
  4. synchronization question
    By oguz in forum Threads and Synchronization
    Replies: 2
    Last Post: 07-22-2008, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •