Synchronization on threads

Synchronization on threads

what is the difference between synchronized method and block??

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:ADS_TO_REPLACE_1 1)Synchronized blocks place locks for shorter periods than synchronized methods
Synchronization
Synchronization  what is the use of synchronization
Advertisements
Synchronization
Synchronization  i want code for synchronization using in jsp and servlets
synchronization
synchronization  what is about static method synchronization&instance method synchronization
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
threads
threads  what are threads? what is the use in progarmming
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
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
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... synchronization block(critical section) gets a lock related with the object. To get access
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
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
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
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
threads and events
threads and events  Can you explain threads and events in java for me. Thank you.   Java Event Handling Java Thread Examples
Java threads
Java threads  What are the two basic ways in which classes that can be run as threads may be defined
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
disadvantage of threads
is the disadvantage of threads?   hello,ADS_TO_REPLACE_1 The Main disadvantage of in threads these are operating system dependent.   Hi, Here... the disadvantages of threads. The global variables defined in the application is not thread
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
Synchronization in java with example
Synchronization in java with example In this section we will discuss about Synchronization in java. Since java is a multi-threaded language so, when two... at a time and the process by which synchronization is achieved is called
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
how the streams provide synchronization - Java Beginners
how the streams provide synchronization  How the java streams provides synchronization
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
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
threads
threads
Threads
Threads
Threads
Threads
ModuleNotFoundError: No module named 'cyclone-synchronization-tool'
ModuleNotFoundError: No module named 'cyclone-synchronization-tool'  ...: No module named 'cyclone-synchronization-tool' How to remove the ModuleNotFoundError: No module named 'cyclone-synchronization-tool' error
ModuleNotFoundError: No module named 'cyclone-synchronization-tool'
ModuleNotFoundError: No module named 'cyclone-synchronization-tool'  ...: No module named 'cyclone-synchronization-tool' How to remove the ModuleNotFoundError: No module named 'cyclone-synchronization-tool' error
Version of cornerstone-threads>cornerstone-threads-api dependency
List of Version of cornerstone-threads>cornerstone-threads-api dependency
Version of cornerstone-threads>cornerstone-threads-impl dependency
List of Version of cornerstone-threads>cornerstone-threads-impl dependency
Version of cornerstone-threads>cornerstone-threads-tutorial dependency
List of Version of cornerstone-threads>cornerstone-threads-tutorial dependency
Java Thread Synchronization - Development process
Java Thread Synchronization  Hi,Please help me with this coding. I have created two threads in my program.After the threads have started when I press any key on the keyboard,then one thread must stop.When I press the keys second
Threads in realtime projects
Threads in realtime projects  Explain where we use threads in realtime projects with example
ModuleNotFoundError: No module named 'threads'
ModuleNotFoundError: No module named 'threads'  Hi, My Python... 'threads' How to remove the ModuleNotFoundError: No module named 'threads... to install padas library. You can install threads python with following command
Coding for life cycle in threads
Coding for life cycle in threads  program for life cycle in threads
Version of cornerstone-threads-api>cornerstone-threads-api dependency
List of Version of cornerstone-threads-api>cornerstone-threads-api dependency
Version of cornerstone-threads-impl>cornerstone-threads-impl dependency
List of Version of cornerstone-threads-impl>cornerstone-threads-impl dependency
Version of cornerstone-threads-tutorial>cornerstone-threads-tutorial dependency
List of Version of cornerstone-threads-tutorial>cornerstone-threads-tutorial dependency
Examples on threads and mulithreading.....
Examples on threads and mulithreading.....  Is any good examples on threads and Mulithreading...   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 Thread Tutorial Thanks
Explain about threads:how to start program in threads?
Explain about threads:how to start program in threads?  import...; Learn Threads   Thread is a path of execution of a program... more than one thread. Every program has at least one thread. Threads are used

Ads