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
If the marginal cost of production is greater than the average cost, in what direction must the average cost be changing, if any
ziro4ka [17]

Answer:

b) The average cost must be rising.

Explanation:

Assuming that the entity produce 4 units and its total cost is $16 so average cost per unit is $4 and  now the same entity has produced the 5th unit at $5 so the average cost now per unit is (16+5)/5=$4.2

So based on the above discussion, it can be concluded that average cost increase when the marginal cost of production is increased.

So the answer is b) The average cost must be rising.

6 0
3 years ago
Carlos was born with cataracts in both eyes. Even though they were removed when he was 5, his lack of visual experiences during
torisob [31]

Answer:

d) degeneration of neural connections in visual reception areas of the brain.

6 0
2 years ago
Read 2 more answers
Leadership effectiveness should be evaluated according to which of the following characteristics?
nikdorinn [45]

Answer:all of the above

Explanation:

7 0
2 years ago
Fill in the blanks to complete the passage about the law of one price. Drag word(s) below to fill in the blank(s) in the passage
Kipish [7]

Answer:

Consider the following explanation.

Explanation:

According to the law of one price, identical goods  

sold IN DIFFERENT LOCATIONS must sell for the same  

price, except for costs associated with MOVEMENT BETWEEN LOCATIONS.

Those costs reflect TRADE BARRIERS and the cost of shipping.  

According to the law of one price, if the price of a good  

in one location does not match the price of the same good in  

a different location, sellers will increase supply  

in the location where the good is MORE EXPENSIVE  

until prices in both locations are equal.

5 0
3 years ago
Mobile marketing has a unique ability to empower users by connecting with them individually and continuously. This socially netw
Luba_88 [7]

Mobile marketing has a unique ability to empower users by connecting with them individually and continuously. This socially networked world will lead to connected users having more direct interactions with sellers.

What is Mobile marketing?

  • Mobile marketing is a multi-channel online marketing technique focused at reaching a specific audience on their smartphones, feature phones, tablets, or any other related devices through websites, e-mail, SMS and MMS, social media or mobile applications.
  • Mobile marketing can provide customers with time and location sensitive, personalized information that promotes goods, services, appointment reminders and ideas.
  • In a more theoretical manner, academic Andreas Kaplan defines mobile marketing as "any marketing activity conducted through a ubiquitous network to which consumers are constantly connected using a personal mobile device".
  • Mobile marketing may include promotions sent through SMS text messaging, MMS multimedia messaging, through downloaded apps using push notifications, through in-app or in-game marketing, through mobile websites, or by using a mobile device to scan QR codes.
  • Proximity systems and location-based services can alert users based on geographic location or proximity to a service provider.
  • Mobile marketing is an indispensable tool for companies large and small as mobile devices have become ubiquitous.
  • The key players in the space are the brands (and companies that they represent through advertising), and service providers that enable mobile advertising.
  • Mobile advertising targets audiences not so much by demographics but by behaviours.

To learn more about mobile marketing: brainly.com/question/4232483

#SPJ4

7 0
1 year ago
Other questions:
  • The Anderson family wants to look at their cash flow over a year. They decide to write out their cash flow for 4 months as given
    5·2 answers
  • Troy Company budgeted​ $12 million for customer service​ costs, but actually spent only​ $10 million. Which of the following sta
    5·1 answer
  • Amy and Lance are newlyweds. This is Lance's second marriage. Because of problems that occurred before his divorce (his ex-wife
    6·1 answer
  • Problem 4-6 (Algo) Income statement presentation; Discontinued operations; EPS [LO4-1, 4-3, 4-4, 4-5] Rembrandt Paint Company ha
    5·1 answer
  • Using a change in supply and/or demand, explain the following phenomena: a. All else constant, gasoline prices are higher in sum
    11·1 answer
  • The combination of one or more communication tools used to inform prospective buyers about the benefits of the product, persuade
    8·1 answer
  • When a company recognizes that the needs of one market segment is not the same as another and accordingly customizes its product
    15·2 answers
  • Your brother is starting 9th grade next year and is thinking about going to college.
    10·1 answer
  • Which of these companies is taking advantage of the globalization of production?
    10·1 answer
  • How to choose scented candles online?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!