Describe a difficulty in semaphore solution to this barrier

Assignment Help Computer Engineering
Reference no: EM132145644

Question :

Synchronization barriers are a common paradigm in many parallel applications. A barrier is supposed to block a calling thread until all N threads have reached the barrier.

(Parallel applications often divide up the work, e.g. matrix operations or graphical rendering, among N processes, each of which compute independently, reach an barrier, exchange results, then work on the next phase of computation) Many times the number of threads is not known in advance.

One pseudocode monitor solution is as follows:

Monitor Barrier ( ){

int numThreads ;

int numThreadsAtBarrier ;

newThreadCreated( ){ numThreads++; }

barrierReached( ){

numThreadsAtBarrier ++;

if(numThreadsAtBarrier == numThreads)

numThreadsAtBarrier = 0;

signalAll( );

else

wait( );

} initilaizationCode( ){

numThreads =0;

numThreadsAtBarrier = 0;

}

}

a. Provide comments in the psuedocode, describing the monitor code.

b. Briefly describe a difficulty in a semaphore solution to this barrier problem.

Reference no: EM132145644

Questions Cloud

State the rule that is applied to place an entity into third : State the rule that is applied to place an entity into third normal form. Revise the data model to place it in third normal form.
What is the upper arm weight for a male : Where is the COM located on the forearm with respect to the shoulder joint, given the upper arm is 30 cm and the forearm is 18cm?
Analyze the data and compute the percent of batches : Analyze the data and compute the percent of batches rejected due to temperature, percent rejected due to pressure.
What is the syntax of the while construct : What is the syntax of the "while" construct in the c programming language?
Describe a difficulty in semaphore solution to this barrier : A barrier is supposed to block a calling thread until all N threads have reached the barrier.
What is the market value of the bond : Given the market rate of interest of 4.4 percent, what is the market value of the bond? (Round answer to 2 decimal places, e.g. 15.25.)
What is the maximum amount mark should be willing to pay : If the current market rate is 7.50 percent, what is the maximum amount Mark should be willing to pay for this bond? (Round answer to 2 decimal places, e.g. 15.2
Display the value of element of string array mystringarray : Display the value of element of string array myStringArray with index 5 .
Prepare storyboards that show the proposed screens : Prepare storyboards that show the proposed screens, including at least two sublevel tasks for each action.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain why four-nf is normal form more desirable than bcnf

Explain why 4NF is a normal form more desirable than BCNF. Explain how dangling tuples may arise. Explain problems that they may cause.

  What biblical principles are applicable in these areas

Implement privacy and confidentiality for data as it traverses the network - what biblical principles are applicable in these areas?

  Discuss the fifth-order polynomial

Determine the IP3 and P1dB for a system whose characteristic is approximated by a fifth-order polynomial.

  Identify the method for validating that policy is followed

Identify the method for validating that policy is followed (ex. Review process of DDR-101 system, or procedure for handling CDs place in the general trash).

  What precautions should be taken with lithium batteries

When a PLC is first turned ON, it will run a self-diagnostic or self-check test.

  Create web page that display student individual timetable

Create a web page that will display a student's individual timetable using the sample timetable data (contained in sample.js).  The user view could be in the form of a "week at a view" layout as shown in the sample timetable display (sample.html) ..

  Develop flip flop which is equivalent to the 74x74

Develop flip flop which is equivalent to the 74x74 positive-edge-triggered flip flop using a 74x109 positive-edge-triggered flip flop. No other component is to be used.

  Distinguish between behaviorism and cognitivism

In no more than 300 words, distinguish between (psychological) behaviorism and cognitivism, and explain what you take to be (a) the best point in favor of each.

  Problem solving in networked application management

Develop skills of analysing critically, and problem solving in regard to Networked Application Management (NAM) - Apply socio-technical contexts in modern

  Write a function called countlines that takes a string

Write a function called countLines() that takes a string representing the name of a file as a parameter, & a string representing a word as the second parameter.

  Explain effect of virtual achievements on student engagement

Explain The Effect of Virtual Achievements on Student Engagement. Outlined the Northcentral dissertation process and clearly illustrated you understand it. Delineated what you want to better understand.

  What are the components to building an effective team

How would you build a CSIRT? What are the components to building an effective team? Note: minimum 300 words not including title and reference page.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd