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 plan to exploit experience-based cost and location economies, transfer core competencies with the firm, and pay attention to l
ikadub [295]

Answer:

D) transnational strategy.

Explanation:

A transnational strategy is more personalized or custom fit than other global or international strategies. When corporations follow this approach, they will generally coordinate the subsidiary's operations with the headquarters, and will work closely together. Generally it focuses on marketing and operational activities, e.g. international retail stores.

8 0
3 years ago
5 year plan example for high school seniors
SOVA2 [1]

\huge{ \underline{ \underline{ \mathtt{ \purple{A} \pink{N} \green{S} \blue{W} \red{E} \orange{R}}}}}♡

A five year plan is a list of priorities you would like to accomplish over the next several years. As well as actions you can take when you make mistakes, so that you can still meet those goals.

Hope it helps ♡♡

7 0
2 years ago
a. A challenging job at an organization that raises the bar in data security b. An entry-level position in the marketing area wi
Svetllana [295]

Answer:

d. An accounting position in which 10 years' experience and a license as a CPA will allow me to assist your company with payroll, employee benefits,

Explanation:

THE QUESTION IS THAT

Which of the following is the best career objective for a résumé?

Career objective can be regarded as a personal statement that gives definition of the specifics that one wish to attain in his/her profession.

A resume objective can be regarded as optional part that is been written in a resume which states or specify the career goals as well as outlines ones best skills. It should be noted that one of the best career objective for a résumé is An accounting position in which 10 years' experience and a license as a CPA will allow me to assist your company with payroll, employee benefits,

5 0
3 years ago
Assume a division of Hewlett-Packard currently makes 12,000 circuit boards per year used in producing diagnostic electronic inst
madam [21]

Answer:

The net benefit is -$26,000

Explanation:

Given the above information,

The total cost of manufacturing 12,000 circuit boards

= 12,000 × $34

= $408,000

Total purchase price

= 12,000 × $34

= $408,000

Fixed overhead cost applied

= 12,000 × $6

= $72,000

The rental income = $46,000

Outsourcing cost

= Total purchase price + Fixed overhead cost applied - Rental income

= $408,000 + $72,000 - $46,000

= $434,000

Therefore, Net benefit

= Total cost of manufacturing - Outsourcing cost

=$408,000 - $434,000

= -$26,000

8 0
3 years ago
What is the maximum amount a firm should pay for a project that will return $15,000 annually for 5 years if the opportunity cost
vampirchik [111]

Answer:

The firm should pay $46907.57 for the given project.

Explanation:

Given information:

Return = $15000 annually

Time = 5 years

Opportunity cost = 18%

The formula for payment is

PV=R(\frac{1}{OC}-\frac{1}{OC(1+OC)^t})

where, R is return, OC is opportunity cost, t is time in years.

Substitute R=15000, t=5 and OC=0.18 in the above formula.

PV=15000(\frac{1}{0.18}-\frac{1}{0.18(1+0.18)^5})

PV=46907.5653141

PV\approx 46907.57

Therefore the firm should pay $46907.57 for the given project.

8 0
2 years ago
Other questions:
  • Cujo invested $2,500 in an account earning 3.4% annual interest that is compounded semi-annually. How long will it take the inve
    14·2 answers
  • Discuss the reasons due to which cash book and passbook balances may not match. Is there a method to address the issues related
    12·1 answer
  • If parents say, "Never take candy from strangers" then why do we celebrate Halloween?
    14·2 answers
  • This approach to calculating GDP is based on adding up consumer spending, investment, government spending, and exports - imports
    7·1 answer
  • Lena is a sole proprietor. In April of this year, she sold equipment purchased four years ago for $26,000 with an adjusted basis
    6·1 answer
  • To advertise or not to advertise Suppose that Creamland and Dairy King are the only two firms that sell ice cream. The following
    7·1 answer
  • Strafford Inc. elected to use the nature of distribution approach for distributions from its equity-method investment purchased
    12·1 answer
  • The next dividend payment by Hoffman, Inc., will be $3.10 per share. The dividends are anticipated to maintain a growth rate of
    15·1 answer
  • State the difference between selection and recruitment.
    10·1 answer
  • Q2. The office manager of ABC company has the authority to the whole financial operations. He authorizes activities, controls th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!