Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

Research the phenomenon of data races. Give an example of how an unprotected data race can give rise to data inconsistency. How do OpenMP and Cilk resolve this problem?

Data race is that situation or condition in which multiple threads, without intervening synchronization, try to access the same memory location, with at least one thread performing a write operation. For eg. many data races occur on numerical algorithms owing to chaotic relaxation and asynchronous iterative methods. Also, there are systems where synchronized threads or processes maintain probabilities with best-estimate-matrix and may race with one other to provide updates.This is usually described in higher-level language specs by the phrase: "undefined behavior." A data race could legitimately reprogram the BIOS delete data from the disk and may also stop the processor's fan leading to a multi-core meltdown. 

example code:

 

int checker = 0;

int counts = 0;

Lock lock;

 

bool TryEnter() {

    if (checker == /* get thread id */) {

        counts += 1;

        return true;

    }

 

    if (lock.TryEnter()) {

        checker = /* get thread id */;

        return true;

    }

    return false;

}

 

void Exit() {

    if (counts != 0) {

        counts -= 1;

        return;

    }

    checker = 0;

    lock.Exit();

}

 

the compiler or the processor may “optimize” this program as:

 

void Exit() {

    if (counts != 0) {

        counts -= 1;

        return;

    }

    checker = 42;

    checker = 0;

    lock.Exit();

} 

The effect of this is perhaps not observable in the current thread, nor is it observable by other threads in the absence of data races. Here, the unfortunate thread whose ID is 42 might observe this value and take the ignite the mistake. 

OpenMP and Cilk resolve data racing through a technique known as Data parallelism.It focuses on distributing the data across different parallel computing nodes. This is achieved when each processor performs the same task on different pieces of distributed data. In some situations, a single execution thread controls operations on all pieces of data. In others, individual threads control the operation, but they execute the same code.

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M9503676

Have any Question?


Related Questions in Operating System

Question state the required answer precisely and then

Question : State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. What is the purpose of the command interpreter? Why is it usually separate fr ...

Question you are a security administrator responsible for

Question: You are a security administrator responsible for providing secure configuration requirements for new laptop deployments. After reading Module 2 of Certified Secure Computer User v2exercises, apply the configura ...

Question note apa format 250 words and three reference

Question: Note: APA format 250 words and three reference without plagarism Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use ...

Question description of lasa in this assignment you will

Question: Description of LASA: In this assignment, you will select a real-world operating system (can be for a PC, server, tablet, handheld, or embedded device). You will introduce the operating system and its components ...

Question what do you see as the major differences between

Question : What do you see as the major differences between UNIX/Linux and other operating systems, such as Windows and Mac OS X? The response must be typed, single spaced, must be in times new roman font (size 12) and m ...

Catalog course descriptionin this course students carry out

Catalog Course Description In this course students carry out independent research in a significant technical area of information, network, and computer security. The student is to investigate a technical area, research i ...

Show all stepssuppose that the following processes arrive

Show all steps Suppose that the following processes arrive for execution at the times indicated. Each process will run the listed amount of time. in answering the questions, use non-preemptive scheduling and base all dec ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Consider a computer embedded in the control of a manned spacecraft. Would it require an ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Briefly describe the following concepts and indicate how they are related in the context ...

Research types of operating systems that are currently

Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Explain why you think the choice you made ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As