The following program will ______.


#include
#include

int main()
{
pthread_mutex_t mutex;
pthread_mutex_init(&mutex, NULL);

for (int count = 0; count < 10; count++)
{
pthread_mutex_lock(&mutex);
cout << "Mutex Locked" << endl;
}

cout << "Finished" << endl;

return 0;
}

a. display "Mutex Locked" 10 times and then display "Finished"
b. display "Mutex Locked" once and then deadlock with itself
c. not run because you can’t use a mutex lock in the main thread
d. display "Mutex Locked" once and then display "Finished"
e. create a new thread and then deadlock with itself


b. display "Mutex Locked" once and then deadlock with itself

Computer Science & Information Technology

You might also like to view...

The symmetric encryption key for data encrypted by the client and decrypted by the server is a _________ . ?

A) ?server write key ? B) ?client write key C) ?sequence key ? D) ?master key

Computer Science & Information Technology

Wireless sensors are most effective when their ____ overlap.

A. thresholds B. signatures C. footprints D. keys

Computer Science & Information Technology

Discuss how to prevent bluesnarfing.

What will be an ideal response?

Computer Science & Information Technology

A hard copy or ____________________ is information that exists on a physical medium such as paper.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology