logo

Crowdly

Browser

Додати до Chrome

Questions Bank (1229400 total)

На початку ХХІ ст. у середовищі

іммігрантів активізувалися ультраісламістські течії та нелегальні угруповання, це

призвело до появи антиіммігрантських 

рухів та радикалізації політичних уподобань європейців. Визначте партію,

що

НЕ

належить до праводидикального

спектру:

0%
0%
0%
0%
Переглянути це питання

Скільки батьківських класів може мати похідний клас

0%
0%
71%
29%
Переглянути це питання

Яка

чисельність мігрантів у 2015 р.

прибула

до

Німеччини:

0%
0%
0%
0%
Переглянути це питання

Wskaż z poniższych opcji przykłady przedsiębiorców

0%
0%
0%
0%
Переглянути це питання

Виберіть твердження, яке не є властивістю конструктора:

0%
0%
0%
0%
Переглянути це питання

Який клас є базовим для всіх класів в С#

0%
100%
0%
0%
Переглянути це питання

Передача керування конструктору базового класу здійснюється за допомогою конструкції:

100%
0%
0%
0%
Переглянути це питання
What is a key difference between a thread and a process?
0%
0%
0%
0%
Переглянути це питання

After working through multiple incorrect solutions to the single-buffer-slot producer/consumer problem, we have finally settled on the following code with some key new insights including: using condition variables to signal when the buffer is filled and when it has been emptied, and using a while loop instead of an if statement when checking if there is something in the buffer (i.e., the value of count).

int loops;

cond_t cond;

mutex_t mutex;

void *producer(void *arg) {

int i;

for (i = 0; i < loops; i++) {

Pthread_mutex_lock(&mutex);

while (count == 1)

Pthread_cond_wait(&cond, &mutex);

put(i);

Pthread_cond_signal(&cond);

Pthread_mutex_unlock(&mutex);

}

}

void *consumer(void *arg) {

int i;

for (i = 0; i < loops; i++) {

Pthread_mutex_lock(&mutex);

while (count < 2)

Pthread_cond_wait(&cond, &mutex);

int tmp = get();

Pthread_cond_signal(&cond);

Pthread_mutex_unlock(&mutex);

printf("%d\n", tmp);

}

}

Which of the following is true about our code?

Переглянути це питання

Recall that demand paging is when we bring a page into memory when it is accessed, and prefetching brings extra pages into memory according to some policy. An example of a prefetching policy is when we need page P, we also bring in pages P+1 and P+2 into memory since they are likely to be accessed as well.

When traversing a large linked list, which prefetching policy is most likely to improve performance by reducing page faults?

0%
0%
0%
Переглянути це питання