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]
4 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]4 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
The Economic Landscape of Oceania World Geography Unit 7:__________Australia, New Zealand, and the Pacific Islands
kykrilka [37]

Answer:

The Economic Landscape of Oceania World Geography are catching seals and whales, Trading wood and meats.

5 0
3 years ago
Hot dog vendors on the beach fail to cooperate with one another on the quantity of hot dogs they should sell to earn monopoly pr
Verizon [17]

Answer: A consequence of their failure is that, relative to the outcome the vendors would like,

<em><u>(i) the quantity of hot dogs supplied is closer to the socially optimal level.  </u></em>

<em><u>(ii) the price of hot dogs is closer to marginal cost. </u></em>

In this case the hot vendor are relatively creating externalities. i.e. Hot dog vendors on the beach fail to cooperate with one another on the quantity of hot dogs they should sell to earn monopoly profits.

3 0
3 years ago
Wingate Company, a wholesale distributor of electronic equipment, has been experiencing losses for some time, as shown by its mo
Murljashka [212]

Answer:

Wingate Company

1. Contribution Format Income Statement (segmented by divisions):

                                         East             Central           West              Total

Sales                             $ 355,000   $ 660,000   $ 520,000  $ 1,535,000

Variable Expenses            188,150         151,800       213,200         553,150

Contribution                     166,850       508,200      306,800         981,850

Traceable Fixed Exp.      296,000        331,000      202,000        829,000

Non-Traceable Fixed Expenses                                                      251,000

Net operating income/

(Loss)                              (129,150)         177,200      104,800          (98,150)

2a) Increasing the West Division's monthly advertising by $28,000 based on the belief that it would increase that division's sales by 16%:

                                       East             Central           West              Total

Sales                             $ 355,000   $ 660,000   $ 603,200    $ 1,618,200

Variable Expenses            188,150         151,800       213,200         553,150

Contribution                     166,850       508,200      390,000      1,065,050

Traceable Fixed Exp.      296,000        331,000      230,000        857,000

Non-Traceable Fixed Expenses                                                      251,000

Net operating income/

(Loss)                              (129,150)         177,200      160,000          (42,950)

2b) The net operating income will increase by $55,200, thus reducing the loss from $98,150 to $42,950.

Explanation:

Segmenting the income statement into divisions helps management to trace the loss making division as Division East.  The division has a traceable fixed cost that is far above its contribution to profit.  The fixed expense must be studied, otherwise the division may be up for closure.

7 0
3 years ago
Two acquaintances have approached you about investing in business activities in which each is involved. Simone is seeking $605,
BARSIC [14]

Answer and Explanation:

The computation is shown below:

Return on investment = income ÷ investment

For Simone

= $54 ÷ $605

= 8.93%

For Riley

= $57 ÷ $650

= 8.77%  

As it can be seen that simone contains the return on investment so the simone would be preferred

Also, the other factor that should be considered before doing any kind of investment i.e. risk

6 0
3 years ago
Chico Company paid $560,000 for a basket purchase that included office furniture, a building and land. An appraiser provided the
s2008m [1.1K]

Answer: $110,432

Explanation:

The cost allocated to the Office furniture is the percentage of total appraised cost * the price paid for the basket purchase because it shows what proportion of the Basket Purchase should be ascribed to the Office furniture.

Total Appraised value = 140,000 + 460,000 + 110,000

= $710,000

Office furniture Proportion = 140,000/710,000

= 0.1971830985

=0.1972

Amount to be allocated to Office furniture = 0.1972 * 560,000

= $110,432

$110,432 should be allocated to the office furniture.

= $110,422.

3 0
3 years ago
Other questions:
  • The technique used to make juan gris's glass and bottle of banyuls is ________.
    11·1 answer
  • BE22-4 Gundy Company expects to produce 1,200,000 units of Product XX in 2017. Monthly production is expected to range from 80,0
    15·1 answer
  • If you need money, what are three alternatives to taking a cash advance on your credit card?
    9·1 answer
  • "cost assignment refers to the general case of assigning costs to cost pools or cost objects. when there is a direct and traceab
    6·1 answer
  • . Which of the following is not a way business markets and consumer markets differ?
    9·1 answer
  • Assume real per capita GDP in West Springfield is $8,000 while in East Quippanova it is $2,000. The annual growth rate in West S
    8·1 answer
  • A woman worked for 30 years before retiring. At the end of the first year of employment she deposited 5000 into an account for h
    8·1 answer
  • On January 2, 2020, Bramble Corp. began construction of a new citrus processing plant. The automated plant was finished and read
    8·1 answer
  • You work at an insurance agency. Your boss has asked you to purchase eight computer screens for the office. You are considering
    10·1 answer
  • Underwater, Inc. had a flood in its plant that destroyed most of its inventory. After the flood, Underwater's accounting records
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!