• Post Reply Bookmark Topic Watch Topic
  • New Topic

Access synchronized method by multiple threads

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a method which is defined as a synchronized . I have a multiple threads calling this method.

Hence the method is defined as a synchronized , only a single thread can access the method at a given point of time � means multithreading of method is not happening. Am I right?
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huh, from a person with 2800 post at ranch this question sort of makes me wonder. Is it that you really don't know what synchronized does or you getting bored?. Anyway, you were right about synchronized method.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Purushothaman!

I was just confused, so I asked.
 
Nav Letha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to upgrade your blood so that it will test +ve for "threads" Sorry , my first post but thought that is pretty basic stuff...
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chetan --

A single thread can call that method on a single object at a time. If there are multiple objects to receive the calls, then the method may be called in parallel by many threads.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!