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
In the late 1930s management at Atalanta Industries agreed to hire only those workers who were already members of the Electrical
earnstyle [38]

Answer: closed shop

Explanation:

From the question, we are informed that in the late 1930s management at Atalanta Industries agreed to hire only those workers who were already members of the Electrical Union.

It should be noted that here, Atlanta agreed to a type of arrangement known as closed shop. This occurs when the workers have to belong to a particular union before they'll be employed. This was legal in 1930 but it was later declared illegal by Taft Hartley Act.

7 0
3 years ago
John and Joan are married and want to make cash gifts to their children (2), their children's spouses (2), and their grandchildr
IgorLugansk [536]

The answer is $0.00 (third option).

Explanation:

During the year of 2018, the annual exclusion of both federal and state tax to cash gifts was up to $15,000 per individual. <em>Annual exclusion</em> means that there's up to a certain amount of money that can be gifted without being taxable. In this case, John and Joan's cash gift falls within the limit.

When couples gift money to their family members, the limit is precisely $15,000 per relative, individually; meaning the can gift up to a total of $60,000 without being subject to gift tax.

3 0
3 years ago
What are the primary functions of a central bank?
Vesnalui [34]

Answer:

The correct answer is:

  • Conduct monetary policy;
  • Ensure that the financial system is stable;
  • Provide banking services to commercial banks, depository institutions, and the federal government.

Explanation:

A central bank is the apex monetary authority in a country. It plays several crucial roles in the smooth working of the economy.

  1. A central bank issues currency on behalf of the government.
  2. It formulates monetary policy on behalf of the government.
  3. It acts as a banker for the government.
  4. It acts as a banker for commercial banks.
  5. It supervises all financial institutions.

The role of providing services to businesses and consumers is played by commercial banks. Fiscal policy is formulated by the government. The responsibility of ensuring the growth of the economy also falls with the government.

4 0
3 years ago
Pauley Company needs to determine a markup for a new product. Pauley expects to sell 22,000 units and wants a target profit of $
Sever21 [200]

Answer:

variable markup % = 60%

Explanation:

total units sold 22,000

total costs associated with selling the 22,000 units:

variable production costs $18 x 22,000 = $396,000

variable S&A costs $13 x 22,000 = $286,000

fixed overhead = $20,500

fixed S&A = $36,700

total costs = $739,200

total cost per unit = $33.60

selling price = $33.60 + $16 = $49.60

markup percentage = [(sales price - unit cost) / unit cost] x 100

the total markup % = [49.60 - 33.60) / 33.60] x 100 = 47.62%

but since we are going to calculate the markup percentage solely based on variable costs, then:

variable cost per unit = $31

selling price = $49.60

the variable markup % = [49.60 - 31) / 31] x 100 = 60%

8 0
3 years ago
According to the law of demand, assuming Ceteris Paribus,
andrey2020 [161]
D I had this on a test and got it right
4 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose Raphael and Susan are playing a game in which both must simultaneously choose the action Left or Right. The payoff matri
    8·1 answer
  • When women and minorities hit an invisible barrier within an organization that, because of discrimination, prevents individuals
    14·2 answers
  • The variable over which service providers have little control is the emotional state of their customers.
    10·1 answer
  • Low-income countries have cultures that value ________
    11·1 answer
  • On June 1, 2017, Windsor, Inc. was started with an initial investment in the company of $22,420 cash. Here are the assets, liabi
    14·1 answer
  • The standardization strategy uses __ marketing activities across national boundaries whereas the adaptation strategy uses a ____
    9·1 answer
  • 8. Effective Yield. A US investor obtain British pounds when the pound is worth $1.50 and invest in a one year-money market secu
    12·1 answer
  • If imports exceed exports, as in recent years, then __________ exists.
    13·1 answer
  • A $150 debit to office equipment was entered in the account as a $150 credit. this error caused the trial balance to be out of b
    5·1 answer
  • What's the permanent marker used primarily for marking datums when measuring elevation?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!