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 company is considering two capital investments. Each requires an initial investment of $15,000 and has a 4 year useful life. I
yaroslaw [1]

Answer:

3 years

Explanation:

The computation of the payback period is shown below:

Payback period = Initial investment ÷ Net cash flow

where,  

Initial investment is $15,000

And, the net cash flow would be

= Year 1 + year 2 + year 3 + year 4

= $5,000 + $5,000 + $5,000 + $5,000

= $20,000

As we see that the net cash flow is recovered in three years that means net cash flows and the initial investment are equal

So,

Payback period would be

= $15,000 ÷ $15,000

= 3 years

7 0
3 years ago
The chief financial officer of a company is responsible for managing cash, accounts receivable, and inventory.
zaharov [31]

Answer:

True

Explanation:

Chief financial officer is one of the key positions at any company or firm. Chief financial officer plays a critical role in managing cash, account receivable and inventory management. He/She is responsible for handling the cash and managing the cash in such a way to remove chances of bankruptcy and shortages. Overall, it is an important post to complete all the tasks related to cash handling and inventory.

7 0
3 years ago
Asking that all sources of income be revealed on a credit application is prohibited by the ecoa.
andreev551 [17]
That is true. Good luck on your future endeavors. 
7 0
3 years ago
I’ll pay somebody 50$ if somebody do this now.
laila [671]

Answer:

I can help if you want..

Explanation: So did someone already do this for you or something? If not I can do it. I just want to know if someone answered the question or you just did it. Please lmk.

3 0
3 years ago
Although humans made stone tools for 200,000 years the most sophisticated form and last complete stone tool kit is the ________,
Margarita [4]

Although humans made stone tools for 200,000 years the most sophisticated form and last complete stone tool kit is the <u>crude stone tools </u>represented by: the awl, atlatl and bow & arrow.

<h3 /><h3>What were crude stone tool?</h3>

Any tool that is partially or totally fashioned out of stone is considered a stone tool in the broadest definition. Even if there are still societies and cultures that rely on stone tools, most of them are related to extinct prehistoric (especially Stone Age) cultures.

Archaeologists frequently research these prehistoric societies, and the examination of stone tools is known as lithic analysis. To deepen our understanding of the cultural ramifications of stone tool use and production, ethnoarchaeology has been a useful research field.

Arrowheads, spearheads, hand axes, and querns are just a few examples of the numerous tools made from stone throughout history. Stone can be ground into tools or it can be shaped by a flintknapper into knapped implements.

Learn more about stone tool

brainly.com/question/1446731

#SPJ4

8 0
1 year ago
Other questions:
  • The operations process includes which of the following activities?
    5·1 answer
  • Natalie makes $2000 per month she spends 100 on credit card payments what is her debt to income ratio
    7·1 answer
  • Walmart began offering low-priced extended warranties on home electronics after learning that its rivals such as Best Buy derive
    8·1 answer
  • Sales decline in the decline stage of the PLC because of technological advances, shifts in consumer tastes and preferences, and
    9·1 answer
  • Which characteristic of organizational culture is present in a high degree at the law firm in the Think like a manager: Organiza
    15·1 answer
  • Skylar Company issued $50,000,000 of its 10% bonds at par on January 1, 2019. On December 31, 2019, the bonds were trading on th
    11·1 answer
  • Cell phone companies found that when they raised the price of connecting to wireless hot spots, demand decreased more than propo
    9·2 answers
  • Suppose that the economy starts with a balanced budget: G = T. If the increase in G is equal tothe increase in T, then the budge
    8·1 answer
  • State with brief reason whether the following statements are true, false, or uncertain:a. In the presence of heteroscedasticity
    5·1 answer
  • Creating, developing, retaining, and obtaining products and services that meet consumer needs is called _____.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!