Exam 26: Multithreading

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

In a producer/consumer relationship,the ________ portion of an application generates data and stores it in a shared object,and the ________ portion of an application reads data from the shared object.

Free
(Multiple Choice)
4.7/5
(48)
Correct Answer:
Verified

B

The Callable interface declares this method.

Free
(Multiple Choice)
4.7/5
(35)
Correct Answer:
Verified

B

The main method executes in the ________ thread of execution.

Free
(Multiple Choice)
4.8/5
(42)
Correct Answer:
Verified

B

This class is used to help implement mutual exclusion.

(Multiple Choice)
4.8/5
(37)

Interface ExecutorService provides the ________ method,which returns control to its caller either when all tasks executing in the ExecutorService complete or when the specified timeout elapses.

(Multiple Choice)
4.8/5
(36)

An ExecutorService object is created by calling a static method of which class?

(Multiple Choice)
4.8/5
(40)

A new thread begins its life cycle by transitioning to the __________ state.

(Multiple Choice)
4.8/5
(37)

With timeslicing,each thread is given a limited amount of time,called a __________,to execute on a processor.

(Multiple Choice)
4.8/5
(40)

If a thread calls __________,then every thread waiting for the object becomes eligible to acquire the lock.

(Multiple Choice)
4.7/5
(29)

When using Java's built-in monitors,every object has a(n)________ or a(n)________ that the monitor ensures is held by a maximum of only one thread at any time.

(Multiple Choice)
4.9/5
(44)

The preferred means of creating multithreaded Java applications is by implementing the ________ interface.An object of a class that implements this interface represents a task to perform.

(Multiple Choice)
4.8/5
(38)

You can simulate atomicity by ensuring that ________.

(Multiple Choice)
4.8/5
(34)

When a thread executing a synchronized statement (or method)completes or satisfies the condition on which another thread may be waiting,it can call Object method ________ or ________ to allow a waiting thread or all waiting threads to transition to the runnable state again.

(Multiple Choice)
4.8/5
(39)

When a __________ method or block is running on an object,the object is locked so no other such method can run on that object at the same time.

(Multiple Choice)
5.0/5
(31)

In a producer/consumer relationship with a single cell of shared memory,which of the following is true?

(Multiple Choice)
4.8/5
(37)

Which one of the following statements is true with regard to a producer/consumer relationship with one producer and one consumer?

(Multiple Choice)
4.8/5
(40)

In a producer/consumer relationship,when a consumer finds the buffer empty or finds that the previous data has already been read,the consumer should call __________.

(Multiple Choice)
4.8/5
(44)

The BlockingQueue interface declares which two methods for blocked adding and blocked removing of elements from a circular buffer?

(Multiple Choice)
4.9/5
(34)

Which of the following is not true of ExecutorService?

(Multiple Choice)
4.8/5
(36)

When a thread obtains the monitor lock on an object,then determines that it cannot continue with its task on that object until some condition is satisfied,the thread can call Object method ________;this releases the monitor lock on the object,and transitions the thread waits to the waiting state.

(Multiple Choice)
4.8/5
(42)
Showing 1 - 20 of 25
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)