Object or Method or Syncronized block : Which one will have lock

Hi Friends ,
In Java we can write a Synchronized method or a block .
In order to access this method or block of code, a Thread has to attain a lock .
I want to know on what thing did the Thread acquires lock and monitor , Is the lock on the Object or a Method .
In some tutorials it is said that the Thread will acquire lock on the Object .
If this is true, how can an another thread access another synchronized method on the same object .
Thanks

rajeshreddyk wrote:
Hi Friends ,
In Java we can write a Synchronized method or a block .
In order to access this method or block of code, a Thread has to attain a lock .
I want to know on what thing did the Thread acquires lock and monitor , Is the lock on the Object or a Method .
The lock is associated with the object.
In some tutorials it is said that the Thread will acquire lock on the Object . That is correct.
If this is true, how can an another thread access another synchronized method on the same object .It can't. That's the whole point of synchronization.

Similar Messages

  • Which one will have better career (BW+BODS) or (BO+BODS).

    Hi All,
    I want to know which career path will have better roadmap for next 10 years, (BW+BODS) or (BO+BODS). I have started my career with BW, and now I am planning to to learn some other SAP Module,i.e addon to BW, which will progress my career.
    Can anyone suggest me that is my Idea of learning BODS will help me or not? If not please suggest me some other path..
    Regards,
    G S Ramanjaneyulu.

    Hi Rama,
    Why do you want to restrict yourself on learning on this combination.  My colleagues all are BW, BODS and BO Consultants.  If any project require specific, they split depends on the project or whichever they want learn more.
    Nowadays, it is very common for consultants that they know two or three modules or systems.
    You already know SAP BW... so learn BO next and then BODS or whichever you like.
    BO is very good in Market currently on Dashboard and Analytical.
    Regards
    GGOPII

  • Same algorithm in function and procedure then which one will better?

    Why pl sql function is better to computes a value instead of procedure?
    If I apply same algorithm in function and procedure then which one will perform better?

    It's not a matter of performance, it is more a matter of how it is going to be used.
    A function can be used as an expression in an assignment or in a query.
    my_var := my_func(my_param);
    select my_var(my_col) from my_table;But it can just return a single value (which can be a complex value like a nested table or object or ref cursor, but still a single value.)
    The procedure often is more used to perform an action that does not return anything.
    execute_invoicing(my_invoice_id);Or procedures can be used if you need multiple return values.
    my_proc(my_input, my_output_1, my_output_2, my_output_3);But the procedure cannot be used in an assignment expression or a select query.
    Performance wise procedures and functions are completely identical. It is only a matter of what action they perform and how you are going to use them.

  • Have a G400, OS10.4.11. Need 10.5 or later to install a new printer. Which one will run best? How do I upgrade?

    Have a G400, OS10.4.11. Need 10.5 or later to install a new printer.
    1) Which one will run best?
    2) How do I upgrade?

    It's probably cheaper to buy a new printer & sell the existing on on ebay.
    I have the Cannon pixma mg3120  works fine for me with mac os x 10.4.11.  I am able to refill the color ink jet cartridge.  Press reset + color copy button for 10 seconds.
    http://www.amazon.com/Canon-MG3120-Wireless-All-In-One-5289B019/dp/B005TI2Q8M
    Mac OS® X v10.4.11 to v10.6.x
    http://www.usa.canon.com/cusa/consumer/products/printers_multifunction/photo_all _in_one_inkjet_printers/pixma_mg3120
    What is a G400?
    You may want to post machine info.
    blue apple > about this mac > more info button. Click on the hardware line. It has a little triangle in front of the word hardware.
    Leave out the serial number.
    Example:
    Machine Name: iMac
    Machine Model: PowerMac4,1
    CPU Type: PowerPC 750 (33.11)
    Number Of CPUs: 1
    CPU Speed: 600 MHz
    L2 Cache (per CPU): 256 KB
    Memory: 768 MB
    Bus Speed: 100 MHz
    Boot ROM Version: 4.1.9f1

  • I have a macbook pro 13" early 2011 version and what to install windows 7 on it via bootcamp but not sure that whether to install x64 or x86 version? which one will work better

    i have a macbook pro 13" early 2011 version and what to install windows 7 on it via bootcamp but not sure that whether to install x64 or x86 version? which one will work better

    There is no need for anyone to use 32-bit version anymore.
    Retail comes with both. Or you can save on just buying 64-bit System Builder disc.
    Better support for today's hardware with larger video graphic memory and systems.
    Better memory management.

  • File Adapter or File  Transport which one will give more performance

    Hi all,
    File Adapter or File Transport which one will give more performance ? in OSB?
    Which one to select any one did performance analysis?
    Thanks
    Phani

    Why don't you just go read some benchmarks?
    http://www.barefeats.com/mbpp18.html

  • Im using somebodies apple id.. When im going update apps, the password which one i have is not matching... What can i do for it? Plzz give me solution.

    Im using somebodies apple id.. When im going update apps, the password which one i have is not matching... What can i do for it? Plzz give me solution.

    Im using somebodies apple id..
    That is the problem. You are supposed to use your own Apple ID. If the person who owns the ID is not a user of your computer and will install the apps with the ID on the computer for you, you need to buy the apps with your own Apple ID and install them instead of the versions that you do not own.

  • Which one will over right the other - DACL

    If I have configured downloadable ACL on ACS group, then one of the users who is belong to same group has assign particular ACL on his profile.
    Which one will be pushed to the router is it the group ACL or user ACL
    Many Thanks

    Update.....
    I do see in ACS logs that Authentication failed for ACL where username is the ACL name sent by PIX. (#ACSACL#-IP-myACL-45e6c605).
    The failure code is "DACL request from device is not acceptable"
    I guess ACS is denying but WHY?

  • Xsd and dtd: which one will overrule

    Hi,
    if I have both DTD and XSD, and the rules in them are conflicting (say: the DTD indicates that an element is mandatory and the XSD is indicating that the element is optional): which one will overrule?
    Kind regards

    An XML document may have only either a DTD or a schema specified.

  • Which one will give more power C2D 2.93 vs i5 2.4

    Any one can inform me which one will give more performance MBP C2D 2.93 with NVIDIA GeForce 9400M + 9600M GT with 512MB or MBP i5 2.4 with 330M 256MB
    I want it for photos and movies editing ?

    Why don't you just go read some benchmarks?
    http://www.barefeats.com/mbpp18.html

  • Have many duplicates, how do I tell which one will become exclamation mark?

    I have a bunch of doubles, but i dont know which ones will turn into the exclaimation mark and which ones are the good ones.
    Is there an easier way to tell with out having to double click on every doubled up song?

    You can collect all your dead tracks together in a playlist, where they can be deleted.
    Using a playlist to collect dead tracks.
    Create new regular playlist – Playlist1
    Select whole library and drag to Playlist1
    Create new Smart Playlist with the rule: Playlist is not Playlist1
    Live updating checked – after you run it, uncheck live updating or you may not be able to delete tracks.
    This playlist should contain all the dead tracks
    http://discussions.apple.com/message.jspa?messageID=5696793#5696793
    Or you can use a Robert Jacobson script - iTunesremovenotfound at:
    http://mysite.verizon.net/teridon/itunesscripts/
    This will delete dead tracks.

  • Which one will get better performance when traversing an ArrayList,  iterat

    hi, everyone,
    Which one will get better performance when traversing an ArrayList, iterators, or index(get(i))?
    Any reply would be valuable.
    Thank you in advance.

    Use the iterator, or a foreach loop, which is just syntactic sugar over an iterator. The cases where there is a noticeable difference will be extremely rare. You would only use get() if you actually measured a bottleneck, changed it, re-tested, and found significant improvement. An iterator will give O(n) time for iterating over any collection. Using get() only works on Lists, and for a LinkedList, gives O(n^2).

  • Which Table will have 'Report to Report Interface (RRI)' Details?

    Hi all,
      Which table will have 'Report to Report Interface (RRI)' Details after creating them with RSBBS Tcode, PLEASE.
    Thanks in advance.

    Hi,
    Serach in these tables
    RSBBSCUBE
    RSBBSCUBEDIR
    RSBBSQUERYDIR
    Cheers..
    Krishna

  • Can I select which components will have auto binding turned on?

    To be honest, the only reason I don't use JDeveloper full time is due to this reason only.
    Can I select which components will have auto binding turned on?
    I don't see the need or reason to bind every single component in the page to your backing bean.
    This can clutter up your backing bean and all the searching for the bindings that I do care about is a real time waster.
    I've looked at the preferences and settings without much luck, thus I'd appreciate any thoughts on this topic.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    To make sure I understand your response, your refering to Managed Beans as your Backing Beans - I thought the two were the same thing.
    Moving on, that is a good idea and I'll try it right now in a test project.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I've different contact info and mail addresses on pc(windows xp), iPhone and iPad, gmail. What is synchronized where, in which direction? Which unit will have to be correct before syncing?

    I've different contact info and mail addresses on my pc (windows xp), iPhone  and iPad, using gmail. I get different results when synchronizing with iTunes.
    What is synchronized where, and in which direction? Which unit will have to be correct before syncing?

    All I had to do was complain.  I synced my iPhone to the Windows machine, checked the other account at iTunes prompting (where no apps had shown up previously), reconnected the iPad, and 140 apps downloaded including the App Store.  I have no idea why.

Maybe you are looking for

  • How do i change the media type on a digital booklet when they option bar is greyed out?

    I downloaded an album a couple days ago which came with a digital booklet. I am trying to put it on my phone but need to change the media type to book to be able to do this. whenever I go to the get info tab, the options tab is completely greyed out

  • Premiere 5.02 External Monitor??

    Reading through the bug fixes on version 5.02 I see this line in the Read me. "Unable to export timeline image via IEEE1394 when Mercury GPU acceleration is used". as one of the fixes. I took this to mean that they have resolved the playing back to a

  • Any standard function module to read data from a cube

    Hi, I want to read data from a cube say XYZ, into an internal table. Is there any standard function module to do this? If so can anyone plz tell me what change should i make in the function module for my requirement. Regards BW Fresher.

  • Jerky scrolling in web browsers

    Mostly I'm using firefox/chrome for web browsing on a non-retina 2012 MBP.  Since upgrading to mavericks, the scrolling has become extremely jerky, it looks like there's a tiny pause every time a picture moves from the offscreen buffer to the screen.

  • Service Profiles Migration between Server M2 and M3

    Hi Cisco Top Guns!!! I have tried to migrate some service profiles between servers M2 (with M81KR) to M3 (with Vic 1240 and Vic 1280) and Windows 2008 R2 recognized the interfaces on M3 as new interfaces. The ghost devices interfaces (old interfaces)