It is possible to synchronize static methods.
When a thread has yielded as a result of yield(), it releases its locks.
When a thread is sleeping as a result of sleep(), it releases its locks.
The Object.wait() method can be invoked only from a synchronized context.
The Thread.sleep() method can be invoked only from a synchronized context.
When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.
第1题:
Which two of statements are true?()
第2题:
Which statements concerning the methods notify() and notifyAll() are true?
第3题:
public class TestOne { public static void main (String[] args) throws Exception { Thread.sleep(3000); System.out.println(”sleep”); } } What is the result?()
第4题:
Which statement is true?()
第5题:
Which two statements are true about setting the per-thread buffers higher than required?()
第6题:
Which two options describe how MySQL Server allocates memory?()
第7题:
Calling the yield method.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
Calling the start method on another Thread object.
第8题:
It is possible to synchronize static methods.
When a thread has yielded as a result of yield(), it releases its locks.
When a thread is sleeping as a result of sleep(), it releases its locks.
The Object.wait() method can be invoked only from a synchronized context.
The Thread.sleep() method can be invoked only from a synchronized context.
When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.
第9题:
Extend java.lang.Thread and override the run method.
Extend java.lang.Runnable and override the start method.
Implement java.lang.thread and implement the run method.
Implement java.lang.Runnable and implement the run method.
Implement java.lang.Thread and implement the start method.
第10题:
It is possible for more than two threads to deadlock at once.
The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
Deadlocked threads release once their sleep() method's sleep duration has expired.
Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
第11题:
new Thread() {public void run() { doStuff(); }};
new Thread() {public void start() { doStuff(); }};
new Thread() {public void start() { doStuff(); }}.run();
new Thread() {public void run() { doStuff(); }}.start();
new Thread(new Runnable() {public void run() { doStuff(); }}).start();
第12题:
Thread memory is pre-allocated up to thread_cache_size for performance
Each connection may have its own per-thread memory allocations
Global memory resources are allocated at server startup
Each thread allocates memory from a global pool
第13题:
public class A extends Thread { A() { setDaemon(true); } public void run() { (new B()).start(); try { Thread.sleep(60000); } catch (InterruptedException x) {} System.out.println(“A done”); } class B extends Thread { public void run() { try { Thread.sleep(60000); } catch (InterruptedException x) {} System.out.println(“B done”); } } public static void main(String[] args) { (new A()).start(); } } What is the result?()
第14题:
Given that t1 is a reference to a live thread, which is true?()
第15题:
public class TestSeven extends Thread { private static int x; public synchronized void doThings() { int current = x; current++; x = current; } public void run() { doThings(); } } Which is true?()
第16题:
Which two statements are true?()
第17题:
Which two statements are true?()
第18题:
Exiting from a synchronized block.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
Calling the setPriority method on a thread object.
第19题:
Instances of class Thread have a method called notify().
A call to the method notify() will wake the thread that currently owns the monitor of the object.
The method notify() is synchronized.
The method notifyAll() is defined in class Thread.
When there is more than one thread waiting to obtain the monitor of an object, there is no way to be sure which thread will be notified by the notify() method.
第20题:
Existing from a synchronized block.
Calling the wait method on an object.
Calling notify method on an object.
Calling read method on an InputStream object.
Calling the SetPriority method on a Thread object.
第21题:
When a router receives a failure response, it stops querying authentication methods.
When a router receives an error response, it stops querying authentication methods.
If the router receives a failure response from an authentication method, it queries the next method.
The router does not differentiate between failure and error responses; the authentication process is always interrupted.
If it receives no response from the authentication method, a router will determine the error condition on its own; the router also has the option to proceed to the next method in a list if configured accordingly.
第22题:
More memory per thread is beneficial in all scenarios
It causes increased overhead due to initial memory allocation
It can affect system stability during peak load times, due to swapping
It requires increasing the thread_cache_size variable
第23题:
A done
B done
A done B done
B done A done
There is no exception that the application will print anything.
The application outputs “A done” and “B done”, in no guaranteed order.
第24题:
It can be invoked only from the doGet or doPost methods.
It can be used independently of the getRemoteUser method.
Can return true even when its argument is NOT defined as a valid role name in the deployment descriptor.
Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.