Filters
Question type

Study Flashcards

In order to utilize the socket module's recv method, what must you pass as an argument?


A) The source IP address the information will be coming from.
B) The destination port you will receive information on.
C) The maximum size in bytes of the data to be read from the socket.
D) The address family used by the network socket.

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

C

The release() method of the Condition class relinquishes the lock, leaving it to be acquired by others.

A) True
B) False

Correct Answer

verifed

verified

The notify() method of the Condition class lets all threads waiting on the lock know that it's available.

A) True
B) False

Correct Answer

verifed

verified

What two thread condition methods can be used to release a lock? (Choose two.)


A) notify()
B) release()
C) notifyAll()
D) wait()

E) None of the above
F) All of the above

Correct Answer

verifed

verified

The procedure by which a process's state is saved before being swapped out of the CPU, then us restored to the state when the process is about to execute, is known as?


A) processing handling
B) context switching
C) state cycling
D) priority slicing

E) B) and D)
F) All of the above

Correct Answer

verifed

verified

The most common way to create a thread is to define a class that extends the class threading.Runnable.

A) True
B) False

Correct Answer

verifed

verified

What does the socket module function gethostname() do?


A) It returns the IP number of the computer whose IP name is passed to the function.
B) It returns the IP address of the host computer running the Python interpreter.
C) It returns the name of the host computer running the Python interpreter.
D) It returns the name of the IP address passed to it.

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

Because an IDLE itself runs in a thread, it is not generally a good idea to test a multithreaded application in that environment.

A) True
B) False

Correct Answer

verifed

verified

A thread's block method is invoked automatically by start.

A) True
B) False

Correct Answer

verifed

verified

False

To properly handle functions that may raise exceptions, you can embed these function calls in a try-catch statement.

A) True
B) False

Correct Answer

verifed

verified

After the creation of a thread, what makes a thread "ready"?


A) The calling of the start method.
B) The calling of the ready method.
C) The instantiation of the thread, followed by the use of the "begin" function.
D) The creation of the thread itself places it in a "ready" state.

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

Which of the following is an example of time slicing?


A) A running process is automatically moved to the rear of the ready queue after a few milliseconds of run time.
B) A process is put to sleep as a result of the sleep method, and moves to the rear of the ready queue.
C) A process is waiting for input from a user and is moved to the rear of the ready queue.
D) A process is waiting for a condition to become true, and is moved to the rear of the ready queue.

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

What two items must be given to the socket function in order to create a socket object?


A) The IP address to be used.
B) The socket family that will be used.
C) The socket type that will be used.
D) The socket port that will be used.

E) A) and C)
F) C) and D)

Correct Answer

verifed

verified

B,C

What is the socket bind method used for?


A) It binds the socket to a IP address.
B) It binds the socket to a port.
C) It binds the socket to a listening pipe.
D) It binds the socket to the localhost.

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

Producer/consumer threads can suffer from synchronization problems.

A) True
B) False

Correct Answer

verifed

verified

A thread that is waiting for user input is most likely in what state?


A) A time-out state.
B) A sleeping state.
C) A blocking state.
D) A wait state.

E) B) and C)
F) A) and C)

Correct Answer

verifed

verified

Ports are usually specified by IP addresses.

A) True
B) False

Correct Answer

verifed

verified

A server can send data to a client using a socket's put method.

A) True
B) False

Correct Answer

verifed

verified

A program starting another program or a new process is known by what term?


A) spawning
B) forking
C) cloning
D) generating

E) A) and B)
F) A) and D)

Correct Answer

verifed

verified

You cannot create and open several sockets on the same port of a host computer.

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer