aspose file tools
The moose likes Java in General and the fly likes static synchronized methods Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "static synchronized methods" Watch "static synchronized methods" New topic
Author

static synchronized methods

kumar Nagesh
Greenhorn

Joined: Jan 02, 2007
Posts: 12

i have called two static synchronized methods of a class at a time will it work one by one or simultaneously
Patel Chintan
Ranch Hand

Joined: Mar 01, 2007
Posts: 80
It will work one by one.


Chintan Patel, SCJP1.5, http://datewithjava.blogspot.com
Angel Taveras
Ranch Hand

Joined: Nov 13, 2008
Posts: 84

If these methods belongs to the same type of class, they will run one by one even if you are using multiple threads to execute these methods. The synchronized static methods use the .class object as the Thread lock

Regards,
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: static synchronized methods
 
Similar Threads
synchronized method
synchronized methods and blocks worries
static synchronized method?
Lock on hidden and hiding static method.
tell me the differnce