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
Lena [83]
3 years ago
14

Assume you have a system that does not provide a usleep(unsigned long usec) call to suspend the execution of the thread for a gi

ven amount of time, say in ?secs. how would you implement this function using condition variables?
Business
1 answer:
Ilia_Sergeevich [38]3 years ago
4 0

#include <iostream>

#include <time.h>

using namespace std;

//usleep function declaration

void usleep(int microseconds);

//usleep function definition

void usleep(int microseconds) // Cross-platform sleep function

{

clock_t time_end;

time_end = clock() + microseconds * CLOCKS_PER_SEC / 1000000; //as 1 microsecond is 1/1000000 of a second.

while (clock() < time_end);

}

int main()

{

cout << "Before calling User defined usleep" << endl;

usleep(4000000);

cout << "After calling User defined usleep" << endl;

}

You might be interested in
A general contractor is managing a construction project that will add a new conference room to an existing office building. The
professor190 [17]

Answer:

A) Using a change management system to influence performance

Explanation:

First of all, since the change was proposed by the customer, any delay in the construction project caused by their new request should not trigger the damage clause.

The contractor should use a change management system so the existing baseline is not altered by the delay. A change management system is responsible for managing all the changes that might occur during the project's inception until its completion. It is important that all changes or alterations to the original schedule are properly recorded and authorized (in this case to prevent the damage clause).

By using the change management system, the organization has a standardized methodology for handling changes in the project's schedule. This way any negative impact can be reduced.

6 0
3 years ago
The net income reported on the income statement for the current year was $275,000. Depreciation recorded on fixed assets and amo
hichkok12 [17]

Answer:

$324,000

Explanation:

The preparation of the Cash Flows from Operating Activities - Indirect Method is presented below:

Cash flow from Operating activities

Net income $275,000

Add : Depreciation expense $30,000

Add: Amortization expense $4,000

Add: Decrease in accounts receivable $6,000     ($102,000 - $108,000)

Add: Decrease in inventory $5,000 ($88,000 - $93,000)

Less: Increase in prepaid expenses -$2,000 ($8,500 - $6,500)

Add: Increase in account payable $6,000 ($95,000 - $89,000)

Net Cash flow from Operating activities         $324,000

4 0
3 years ago
A shoe manufacturer has created a decision tree with costs of different marketing strategies and the two possible outcomes from
DochEvi [55]

Answer:

The probability of each outcome

Explanation:

The probability of an event Bis the number of ways event B can occur divided by the total number of possible outcomes. Also it describes the probability of an event taking place and the chance that the event will occur as a result of an experiment carrier out.

5 0
2 years ago
Miguel Alvarez in the accounting department at Baumer Company has provided the following information:
Mekhanik [1.2K]

Answer:

$10.65

Explanation:

The computation of the incremental manufacturing cost in the case when the production level is changed

= Direct material cost per unit + direct labor cost per unit + variable manufacturing overhead per unit

= $6.25 + $3.20 + $1.20

= $10.65

Here the fixed cost would not be relevant

8 0
3 years ago
________ company emphasizes its home country culture throughout its operations, and it tends to staff key positions abroad with
photoshop1234 [79]

Answer:

The correct answer is letter "C": An ethnocentric.

Explanation:

An ethnocentric company is the type of organization that promotes the culture of its own culture among employees and focuses on providing local workers with the best opportunities possible so they can be competitive. These firms have a nationalistic approach and have the main goal of contributing to their country's development.

7 0
3 years ago
Other questions:
  • E11-22A (similar to) Question Help The Garver Restaurant Group manufactures the bags of frozen French fries used at its franchis
    6·1 answer
  • A lender demands an interest rate in part to compensate for any expected ___________, so that the money that is repaid in the fu
    6·1 answer
  • S4-14 Calculating the current ratio End of the Line Montana Refrigeration has these account balances at December 31, 2018: Accou
    15·1 answer
  • In a cellular layout, additional floor space is required because machines are not very closely linked within a cell.A. TrueB. Fa
    10·2 answers
  • HELP, ACCOUNTING
    8·1 answer
  • Deductions for AGI may be locatedAnswers:on Schedule C as a deduction.on the front page of Form 1040.on Schedule E as a deductio
    14·1 answer
  • How much money should Francesca set aside in her monthly budget in
    5·1 answer
  • In the BCG Matrix, cash cows are: _____________
    11·1 answer
  • Create an oral presentation about yourself that will provide your interviewee with an accurate picture of your skills and prepar
    14·1 answer
  • Salaries of managers and maintenance personnel are examples of ______ labor costs.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!