• Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread multiple chocie questions  RSS feed

 
shruti patel
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
10. What are the risks of using threading?
a. Testing and debugging difficulty
b. Deadlocks
c. Data races
d. All of the above


11. Which of the below statements on concurrency and parallelism are true?
a. Parallel threads can execute on multiple processors
b. Concurrent threads can execute on a single processor
c. Concurrency occurs when two or more threads are in progress simultaneously
d. Parallelism occurs when multiple threads execute simultaneously
e. All of the above


12. What are the different types of decomposition?
a. Data decomposition
b. Task decomposition
c. Frequency decomposition
d. a & b only
e. All the above


13. Which decomposition method does the below example demonstrate? �Three cashiers simultaneously counting cashing collected at the cash till in a store.�
a. Data decomposition
b. Task decomposition
c. Time decomposition
d. Frequency decomposition
e. All the above


14. While managing simultaneous activities and their interaction, the problems that a programmer will encounter include _____.
a. Synchronization
b. Resource limitation
c. Load balancing
d. Scalability
e. All of the above


15. If a thread terminates while holding a mutex, ________.
a. waiting threads will exit
b. waiting threads will be killed
c. waiting threads will become deadlocked
d. waiting threads will not become deadlocked


16. The system heap (as used by malloc) for threads in a process is a _________.
a. shared resource
b. private resource
c. both shared and private resource
d. neither shared nor private resource


17. Jumping out of a critical section without calling LeaveCriticalSection or ReleaseMutex will ______ waiting threads.
a. end
b. kill
c. suspend
d. deadlock


18. One way to specify thread-local data, regardless of the threading model, is to use variables allocated on the _______ in a given scope.
a. heap
b. code
c. stack
d. register


19. Intel� VTune� Performance Analyzer has which of the following capabilities:
a. It can collect performance data from the system
b. Identify potential performance issues
c. Identify potential threading issues
d. Only A and B
e. All the above


20. Intel� Thread Checker is used for:
a. It can collect performance data from the system
b. Identify potential performance issues
c. Identify potential threading issues
d. Only A & C
e. All the above
 
Ayaz Pasha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shruthi its meant for quiz
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell us what you think the answers are and why and then people will point out any mistakes you may have made (or congratulate you if you have them all correct).
 
Priyanka Dandekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me try answering....as I am also not an expert...so I would expect experts on forum to correct me If I am wrong....

10. What are the risks of using threading?
a. Testing and debugging difficulty
b. Deadlocks
c. Data races
d. All of the above

Not sure about Data races, but I think a and b are defintely risks if not programmed well, so logically I would answer D.

11. Which of the below statements on concurrency and parallelism are true?
a. Parallel threads can execute on multiple processors
b. Concurrent threads can execute on a single processor
c. Concurrency occurs when two or more threads are in progress simultaneously
d. Parallelism occurs when multiple threads execute simultaneously
e. All of the above

My answer is E (All the above). looks like simple

12. What are the different types of decomposition?
a. Data decomposition
b. Task decomposition
c. Frequency decomposition
d. a & b only
e. All the above

Same answer here as well . E( All the above)

13. Which decomposition method does the below example demonstrate? �Three cashiers simultaneously counting cashing collected at the cash till in a store.�
a. Data decomposition
b. Task decomposition
c. Time decomposition
d. Frequency decomposition
e. All the above

This is task decomposition. So answer is B.

14. While managing simultaneous activities and their interaction, the problems that a programmer will encounter include _____.
a. Synchronization
b. Resource limitation
c. Load balancing
d. Scalability
e. All of the above

Again ... E (All of the above)



15. If a thread terminates while holding a mutex, ________.
a. waiting threads will exit
b. waiting threads will be killed
c. waiting threads will become deadlocked
d. waiting threads will not become deadlocked

Waiting threads will never know mutex is available or not. So they will keep waiting indefinately. Deadlock. Answer is C.


16. The system heap (as used by malloc) for threads in a process is a _________.
a. shared resource
b. private resource
c. both shared and private resource
d. neither shared nor private resource

I would go for A. Shared resource. I dont think heap is a private resource.

17. Jumping out of a critical section without calling LeaveCriticalSection or ReleaseMutex will ______ waiting threads.
a. end
b. kill
c. suspend
d. deadlock

Same question, D. Deadlock.

18. One way to specify thread-local data, regardless of the threading model, is to use variables allocated on the _______ in a given scope.
a. heap
b. code
c. stack
d. register

My answer would be Stack. C. As each thread has its own thread stack.


19. Intel� VTune� Performance Analyzer has which of the following capabilities:
a. It can collect performance data from the system
b. Identify potential performance issues
c. Identify potential threading issues
d. Only A and B
e. All the above

Dont know what is this?

20. Intel� Thread Checker is used for:
a. It can collect performance data from the system
b. Identify potential performance issues
c. Identify potential threading issues
d. Only A & C
e. All the above

Dont know what is this?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!