Share on Google+Share on Google+

karthik
Synchronization on threads
1 Answer(s)      6 years and 6 months ago
Posted in : Java Beginners

what is the difference between synchronized method and block??

Ads

View Answers

October 23, 2010 at 10:54 AM


Hello Friend,

Differences:

1)Synchronized blocks place locks for shorter periods than synchronized methods.

2)Synchronized method allows only one user to use it at any given time and the request will be queued and are executed while Statements in the synchronized block are executed sequentially.

Thanks










Related Tutorials/Questions & Answers:
Synchronization on threads
Synchronization on threads  what is the difference between synchronized method and block??   Hello Friend, Differences: 1)Synchronized blocks place locks for shorter periods than synchronized methods. 2)Synchronized
Synchronization
Synchronization  what is the use of synchronization
Advertisements
synchronization
synchronization  what is about static method synchronization&instance method synchronization
Synchronization
Synchronization  i want code for synchronization using in jsp and servlets
threads
threads  what are threads? what is the use in progarmming
Java Synchronization
Java Synchronization  What is synchronization and why is it important?  Synchronization is best use with the Multi-Threading in Java. Synchronization is the way to make our program safe. As we know when we have two
Java synchronization
Java synchronization  What is synchronization and why is it important?  Synchronization is best use with the Multi-Threading in Java. Synchronization is the way to make our program safe. As we know when we have two
Synchronization
Synchronization       Threads commonly share the same memory space area, that?s why they can share the resources. Threads commonly communicate by sharing access to fields
java synchronization
java synchronization   What is synchronization and why is it important
Synchronization and interlocking
Synchronization and interlocking  What are the different level locking using the synchronization keyword
Synchronization with Multithreading - Java Beginners
, Synchronization : Two or more threads share the same resource (variable or method...Synchronization with Multithreading   Hi Deepak, what i know abt synchronization is , we can implement synchronized keyword
Synchronization in cluster - Development process
Synchronization in cluster  I have a scenario to implement. we have....  Hi, Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can
Synchronization and Singlethreadmodel - Java Beginners
Synchronization and Singlethreadmodel   Hi Deepak, wat is d difference between singleThreadmodel and synchronization. Thank u in advance
Describe synchronization in respect to multithreading.
Describe synchronization in respect to multithreading.  Hi, Describe synchronization in respect to multithreading. thanks,   Are you... the synchronization in respect to multithreading
Synchronization - Java Interview Questions
Synchronization  Dear Sir my doubt is If we cannot use synchronization for a class then how a vector class is called as synchronized
Thread Synchronization in Java
Thread Synchronization in Java Sometimes, when two or more threads need shared... as thread synchronization. The thread synchronization is achieved through... to be synchronized } Object in Java which have synchronization block
difference between lock and synchronization
difference between lock and synchronization  Hi, I am new in java please anyone tell me difference between lock and synchronization in java. its... and Synchronization
threads and events
threads and events  Can you explain threads and events in java for me. Thank you.   Java Event Handling Java Thread Examples
threads in java
threads in java  how to read a file in java , split it and write into two different files using threads such that thread is running twice
Java :Thread Synchronization
Java :Thread Synchronization This section explains how to use concept of synchronization in java Thread. Thread Synchronization : . Java supports multi-threading concept that is multiple threads run parallel to complete the execution
Java threads
Java threads  What are the two basic ways in which classes that can be run as threads may be defined
disadvantage of threads
is the disadvantage of threads?   hello, The Main disadvantage of in threads... disadvantage of Threads. Let?s discuss the disadvantages of threads. The global..., the other threads using the same memory location will be killed automatically
Synchronized Threads
Synchronized Threads       In Java, the threads are executed independently to each other. These types of threads are called as asynchronous threads. But there are two problems may
Sync Threads
Sync Threads  "If two threads wants to execute a synchronized method in a class, and both threads are using the same instance of the class to invoke the method then only one thread can execute the method at a time." This is what
threads in java
threads in java  iam getting that the local variable is never read in eclipse in main classas:: class Synex4{ public static void main(String args[]){ Test1 ob1=new Test1(); //local variable never read
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads