subject

Import com. programix. thread.*; /**
* StringHandoff is used to pass a String from one thread to another.
* The passer and the receiver meet inside an instance for the handoff.
* For example, if pass() is called and there is not receiver waiting, the
* thread calling pass() will block until the receiver arrives. Similarly,
* if receive() is called and there is no passer waiting, the thread calling
* receive() will block until the passer arrives.
*
* There can only be one thread waiting to pass at any given time. If a second
* thread tries to call pass() when another thread is already waiting to pass,
* an IllegalStateException is thrown. Similarly, there can only be one thread
* waiting to receive at any given time. If a second thread tries to call
* receive() when another thread is already waiting to receive, an
* IllegalStateException is thrown. IllegalStateException is a RuntimeException.
*
* Methods that take a timeout parameter will throw a TimedOutException if
* the specified number of milliseconds passes without the handoff occurring.
* TimedOutException is a RuntimeException.
*
* The methods that declare that they may throw a ShutdownException will do
* so after shutdown() has been called. If a thread is waiting inside a method
* and another thread calls shutdown(), then the waiting thread will throw
* a ShutdownException. If a thread calls a method that declares that it may
* throw a ShutdownException, and any thread has already called shutdown(), then
* the call will immediately throw the ShutdownException.
* ShutdownException is a RuntimeException.
*/
public interface StringHandoff {
void pass(String msg, long msTimeout) throws InterruptedException,
TimedOutException,
ShutdownException,
IllegalStateException;
void pass(String msg) throws InterruptedException,
ShutdownException,
IllegalStateException;
String receive(long msTimeout) throws InterruptedException,
TimedOutException,
ShutdownException,
IllegalStateException;
String receive() throws InterruptedException,
ShutdownException,
IllegalStateException;
void shutdown();
Object getLockObject();
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:00, mterzic1
Assume that you have an array of integers named a. which of these code segments print the same results? int i = 1; while(i < a. length) { system. out. println(a[i]); i++; } int i; for (i = 0; i < a. length; i++) { system. out. println(a[i]); } for (int i : a) { system. out. println(i); } i and ii only ii and iii only i and iii only all three print the same results. all three print different results.
Answers: 3
image
Computers and Technology, 22.06.2019 06:30, westjayson69
Requirement types discussed during software development include functional and color scheme nonfunctional and code style constraint and nonfunctional fashionable and functional.
Answers: 2
image
Computers and Technology, 22.06.2019 13:30, ashleypere99
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, legendman27
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. which cable would she prefer to use? jennifer would prefer to use because its metal sheath reduces interference.
Answers: 1
You know the right answer?
Import com. programix. thread.*; /**
* StringHandoff is used to pass a String from one thread...

Questions in other subjects: