Mutliple thread access to object method

Discussion in 'Java' started by Crouchez, Aug 30, 2007.

  1. Crouchez

    Crouchez Guest

    Can multiple threads access the same object public void method
    simultaneously? Or does the method need to return for each thread? I guess
    not because that's what public synchronized void is for?
    Crouchez, Aug 30, 2007
    #1
    1. Advertising

  2. On Aug 30, 10:59 am, "Crouchez"
    <> wrote:
    > Can multiple threads access the same object public void method
    > simultaneously? Or does the method need to return for each thread? I guess
    > not because that's what public synchronized void is for?


    Your guess is right - they can access the method concurrently, unless
    it is synchronized.

    -cheers,
    Manish
    Manish Pandit, Aug 30, 2007
    #2
    1. Advertising

  3. Crouchez

    Lew Guest

    "Crouchez" wrote:
    >> Can multiple threads access the same object public void method
    >> simultaneously? Or does the method need to return for each thread? I guess
    >> not because that's what public synchronized void is for?


    Manish Pandit wrote:
    > Your guess is right - they can access the method concurrently, unless
    > it is synchronized ...


    ... on the same monitor.

    --
    Lew
    Lew, Aug 30, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David
    Replies:
    0
    Views:
    424
    David
    Nov 3, 2004
  2. Michael B Allen

    [nio] Mutliple Messages in ByteBuffer

    Michael B Allen, Dec 13, 2004, in forum: Java
    Replies:
    1
    Views:
    408
    Esmond Pitt
    Dec 13, 2004
  3. Dominique
    Replies:
    3
    Views:
    449
    Dominique
    Jun 29, 2004
  4. Ami

    Mutliple Drop down list boxes

    Ami, Aug 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    383
    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmE=?=
    Aug 25, 2006
  5. Replies:
    3
    Views:
    301
    Phil Wilks
    Nov 7, 2006
Loading...

Share This Page