Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
Java thread lock
1 Answer(s)      4 years and 2 months ago
Posted in : Java Interview Questions


What happens when a thread cannot acquire a lock on an object?

Advertisement
View Answers

October 26, 2010 at 4:52 PM


Hi,

Here is the answer,

If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

Thanks.



Related Tutorials/Questions & Answers:
Java thread lock
Java thread lock  What happens when a thread cannot acquire a lock on an object
How to make one waiting thread for lock - Java Beginners
How to make one waiting thread for lock  Hi Friends, I am new to java. Can u explain about thread concept.How i know one thread is locked, and how can i force or acquire another thread for lock . Finally how to know thread
Advertisements
Java lock
Java lock  Can a lock be acquired on a class
Java lock
Java lock  Can a lock be acquired on a class
Java Thread HoldsLock
Java Thread HoldsLock In this tutorial, you will learn how to lock a thread with example in Java. Thread HoldsLock  : It is easy to use...): This method returns true if the current thread holds the monitor lock
Java lock file or folder.
Java lock file or folder.  Is it possible to create a desktop application to lock or encrypt file or folder in windows by using java code?? if possible can provide some reference?? because i can't find it... thanks
Java object's lock
Java object's lock  What is an object's lock and which object's have locks
Java file lock
Java file lock In this section, you will learn how to lock a file... by using the New I/O API (nio). Java provides lock and tryLock() methods... the thread until it gets a lock on the file. Now to ensure that the file
java Thread
java Thread  what is purpose of Thread
Java thread
Java thread  How can a dead thread be restarted?  A dead thread cannot be restarted
Java thread
Java thread  What are the high-level thread states
Java thread
Java thread  What are the ways in which you can instantiate a thread
Java thread
Java thread  What invokes a thread's run() method
Java thread
Java thread  What is the difference between process and thread
Java thread
Java thread  What's the difference between a thread's start() and run() methods
JAVA Method Wait
JAVA Method Wait       The Wait method in Java hold the thread to release the lock till the thread hold the object. The most important point is to be remember that wait method
Thread Deadlocks - Java Tutorials
Thread Deadlock Detection in Java Thread deadlock relates to the multitasking... lock that holds by second thread, and this second thread is waiting for an object lock that holds by first thread, this situation is known as Deadlock. Example
Java thread
Java thread  Why do threads block on I/O?   When a thread... and in that time some other thread which is not waiting for that IO gets a chance to execute.If any input is not available to the thread which got suspended for IO
Thread in java
Thread in java  which method will defined in thread class
lock on a class
lock on a class  hello, Can a lock be acquired on a class?   hiii,, Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object
Java thread
Java thread  What is the use of serializable
Java thread
Java thread  What method must be implemented by all threads
Java thread
Java thread  What is the difference between wait() and sleep method
Java thread
Java thread  Can we have run() method directly without start() method in threads
Java Thread and Runnable
Java Thread and Runnable  What's the difference between Thread and Runnable types
How to Differenciate Main Thread and Child Thread in Java
Main Thread and Java Child Thread. Please Suggest any example or online link... in Java Programming Language. These are Java Main Thread and the Child Thread. The Below reference will provides you clear idea of java thread concept. http
Java thread state
Java thread state  what is Static binding
Thread - Java Beginners
the concept of thread, thread creation and use of threads in JAVA application?  Thread creation and use of threads in JAVA Java Resourcehttp://www.roseindia.net/java/thread/thread-creation.shtml
how to destroy java thread
how to destroy java thread  how to destroy java thread?   This will help .. Shutting Down the Java Thread
Java Thread
Java Thread In this tutorial we will discuss about Java Thread. Java Thread : A thread is light weight java program.JVM permits you to have multiple threads for concurrent execution. Each thread has priority. You can also set
Java thread state
Java thread state  Difference between sleep and suspend
Advertisements
 

 

 

DMCA.com