1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Luda [366]
3 years ago
14

What is the best kernel synchronization solution on multicore systems when a lock is held for brief periods ?

Computers and Technology
1 answer:
Delvig [45]3 years ago
8 0

Answer: C) spin-lock with test and set

Explanation:

In spinlock, when a thread locks a spinlock then it continuously retrying locking until it succeeds. Spinlock is the lock that cause thread and continuously check that whether the lock are available or not for synchronization.

So that is why spinlock is best synchronization solution as it is not allowing any another thread.

On the other hand, in mutex thread try to lock a mutex and then, it automatically go to sleep mode before locking and immediate allow another thread to run.

You might be interested in
To create a cover letter to send to potential employers along with a resume, what software program should you use ?
UkoKoshka [18]
I personally would use Word because it has the potential to create the cover letter and attach a resume along with it. 

Excel is more for tables and creating an organized way to see your recordings. 

PowerPoint is known for presentations mainly.

Twitter is a type of social media platform that is useful in communication. 
4 0
3 years ago
Read 2 more answers
For an external usb hard drive attached to a computer, which is more suitable: a writethrough cache or a block cache
Charra [1.4K]

Disk access is way slower than memory access. Caching is a technique to improve the disk access time.  Block cache is a caching technique which reduces disk accesses time.  Here a portion of disk is bought to cache for reading and a modified blocks are first changed in cache but reflected in the disk at one go.  On the other hand with write through caching each modified block is written to cache and at the same time it is written to the disk.  Write- through caching requires more disk I/O so they can have a negative effect on the performance. 

6 0
3 years ago
Read 2 more answers
First write a method to calculate the greatest common divisor (GCD) of two positive integers using Euclid’s algorithm (also know
MAVERICK [17]

Answer:

import java.util.Scanner;

public class Gcd

{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 System.out.print("Enter two numbers to find their GCD: ");

 int number1 = input.nextInt();

 int number2 = input.nextInt();

 

 if(number1 > 0 && number2 > 0)

     System.out.println("GCD of " + number1 +" and " + number2 +" is: " + findGCD(number1, number2));

       else

           System.out.println("Invalid Input!");

}  

public static int findGCD(int number1, int number2) {

    if(number2 == 0){

        return number1;

    }

return findGCD(number2, number1 % number2);

}

}

Explanation:

To be able to find GCD, we need to factorize the numbers and multiply common factors.

- <u>Inside the function:</u>

- Recursively divide <em>number1</em> by <em>number2</em> until <em>number2</em> is equal to zero.

- Return <em>number1</em>  when the <em>number2</em> is equal to zero. That means we found all the divisors of <em>number1</em>

- <u>Inside the main:</u>

- Ask user to input numbers

- Check if both numbers are greater than zero

- If they satisfy the condition, call the method and print the result.

7 0
3 years ago
You are unpacking and setting up workstations
Anestetic [448]

Answer:

For setting up workstations in classrooms, one end of cables connected into the built in NIC and other end will be connected to a drop.

Explanation:

A drop will be used for connectivity in this case, which will work as connection point in a network. Drops are just like outlets in wall having  Ethernet Jacks where a network device or system can be plugged into it.

8 0
3 years ago
Write a function that takes as input a single integer parameter n and computes the nth Fibonacci Sequence number. The Fibonacci
RSB [31]

Answer:

Following are the code to this question:

def Fibonacci(n):#defining a method Fibonacci that accept a parameter

   a = 1#defining a variable a that holds a value 1

   b = 1#defining a variable b that holds a value 1

   if n <= 0:# Use if to check n value

       print("invalid number")#print message

   elif n == 2:#defining elif that check n equal to 2

        return 1#return 1

   else:#defining else block

       print(a)#print value of a

       print(b)#print value of b

       for i in range(2,n):#defining for loop to calculate series

           s = a + b# add value in s variable

           a = b # interchange value

           b = s# hold s value

           print(s)#print s value

Fibonacci(10)#calling method

Output:

1

1

2

3

5

8

13

21

34

55

Explanation:

In the above-given program code, a method "Fibonacci" is defined, which holds a value "n" in its parameter, and inside the method two-variable "a and b" is defined, that holds a value "1".

  • In the next step, if a block is defined that checks n value is less than equal to 0, it will print "invalid number" as a message.
  • In the elif, it checks n value is equal to 2 it will return a value that is 1.
  • In the else block, it will calculate the Fibonacci series and print its value.
4 0
2 years ago
Other questions:
  • ​printers, monitors,​ tablets, cpus, and laptops are examples of​ ____________.
    14·1 answer
  • What are the four primary factors described in the text that set the state for Web 2.0 or the social Web that we enjoy today??
    12·1 answer
  • Which key is used in word processors to create indentations?
    13·2 answers
  • How to get the absolute value in coding begginners?
    13·2 answers
  • A store trying to analyze the behavior of its customers will often maintaina two-dimensional array A, where the rows correspond
    6·1 answer
  • Most hard drives are divided into sectors of 512 bytes each. Our disk has a size of 16 GB. Fill in the blank to calculate how ma
    9·1 answer
  • Write a program that will read two floating point numbers (the first read into a variable called first and the second read into
    13·1 answer
  • Hellpppp please I need it!
    15·1 answer
  • Anyone has any ideas for a gaming setup i can buy for christmas. Something with high framing rates (monitor included) for about
    15·1 answer
  • What is the process of smaw welding​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!