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
Toyota, the giant global automaker, paid a heavy price for its ___________ emphasis on cost control. The resulting problems with
Dafna1 [17]

Answer:

The options for this question are the following:

A. Minimal

B. Superficial

C. Low-budget

D. Excessive

The correct answer is D. Excessive.

Explanation:

In this case, it is useful to consider that cost control is the procedure that allows companies to carry out the regulatory and protection processes against what the client expects to receive. Toyota is a well-known brand, and poor cost management can have an impact on the inflation of its costs and therefore the price of its cars rises considerably. Excessive costs negatively influence the companies' results, and therefore their correct management influences optimal results for the operation.

8 0
2 years ago
Read 2 more answers
What term refers to the business model of selling goods online through an Internet store site?
balu736 [363]
It would be B.) E-commerce this term is used to describe buying and selling products online.
4 0
3 years ago
Your friend decides that he needs to receive a retirement payment of 70,000 dollars per year from a retirement fund that is proj
damaskus [11]

Answer:

Explanation:

This is an Ordinary Annuity question. You can solve this using a financial calculator. I'm using (TI BA II Plus)

N; duration = 20

I/Y ; interest rate per year = 8.5%

PMT ; recurring annual payment = 70,000

FV; Future value = 0 (In solving annuities, use 0 if not given)

then CPT PV = ?

PV = 662,433.563

Therefore, your friend needs to have $662,433.56

7 0
3 years ago
Suppose you have $1,500 and plan to purchase a 5-year certificate of deposit (CD) that pays 3.5% interest, compounded annually.
ryzh [129]

Answer:

$ 1,781.53  

Explanation:

The future value of the 5-year CD can be determined by using the future value formula stated below:

FV=PV*(1+r)^n

FV is the future value which is expected future amount after 5 years

PV is the initial amount used in purchasing the CD i.e $1500

r is the rate of return on the CD on an annual basis which is 3.5%

n is the number of years the investment would last which is 5 years

FV=$1500*(1+3.5%)^5

FV=$1500*1.187686306

FV=$ 1,781.53  

8 0
3 years ago
How do strategic leaders manage their firm’s resource portfolio effectively to exploit its core competencies and leverage its hu
Degger [83]

Strategic leaders manage the firm's portfolio of resources by organizing them into capabilities, structuring the firm to use the capabilities, and developing and implementing a strategy to leverage those resources to achieve a competitive advantage.

<h3>What is strategic leadership and how do you become a strategic leader?</h3><h3>Strategic leadership skills and characteristics</h3>

Key traits of an effective strategic leader include loyalty to the organization's vision, judicious use of power, transparency, effective communication, problem-solving, readiness to delegate, passion for their job, compassion, and empathy for others and self-awareness.

<h3>Why is strategic planning considered a core responsibility of an effective leader?</h3>

“Strategic planning” means planning for long-term success by continually leveraging new sources of information.

A strategy enables leaders to anticipate changes, opportunities, and challenges in the business environment that will make an impact on the future of the organization and its members.

Learn more about strategic leader here:

<h3>brainly.com/question/15419778</h3><h3 /><h3>#SPJ4</h3>
8 0
1 year ago
Other questions:
  • Samuelson and Messenger (SAM) began 2021 with 210 units of its one product. These units were purchased near the end of 2020 for
    15·1 answer
  • Most codes of ethics created by professional organizations have two main parts:________
    14·1 answer
  • Why would the top-level managers at Nutzandboltz, a hardware company, decide to invest free cash flow in product lines such as c
    10·1 answer
  • Which fema mitigation program assists in implementing long-term hazard mitigation measures following presidential disaster decla
    13·1 answer
  • Assume again that the cost of capital is 7 percent and the effective tax rate is 40 percent. How would the payback, internal rat
    15·1 answer
  • Hallie owns 20% of the common stock of the Bean Brothers Coffee Company. The company announced plans to offer an additional 10,0
    6·1 answer
  • If more capital is produced in a given year, what can be expected to happen?
    6·1 answer
  • A purely domestic firm that sources its products, sells its products, and raises its funds domestically. . Which of the followin
    5·1 answer
  • What is big data? How can it improve data science
    15·1 answer
  • Eduardo owns a farm in a country where taxes are very high and where the government openly considers the possibility of taking o
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!