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
11Alexandr11 [23.1K]
3 years ago
7

There are two main advantages to using multiple threads in a process: 1) Less work involved in creating a new thread rather than

a new process 2) Communication among threads within the same process is simplified. Briefly explain how threads give these advantages. Is it also true to say that context switching between two threads in the same process involves less work than switching to a thread in a different process?
Computers and Technology
1 answer:
Brums [2.3K]3 years ago
7 0

Answer:

Thread is a light weight where as Process is a heavy weight in nature

Explanation:

A process can use to accomplish complex tasks which involves utilization of more system resources. Thread is  part of process which is used to accomplish some smaller task. Thread is light weight and involves utilization of less no of resources.

A process can have more than one thread for execution. we can execute these threads in a process parallelly. This is known as Multi Threading.

There are Mainly 2 Advantages to using multi threads in a process

Less work Involved in creating New Thread rather than a New process: this is because all threads in a process use same address space so it is very easy to communicate and operate these threads in a process. Each process is used separate address space so if we want to create another process then it involves utilization of more resource so more overhead

Communication among threads in same process also simplified as these are using same address space

You might be interested in
In this lab, you will build a system for package delivery services that provides different shipping options with specific price.
Alex73 [517]

Answer:

See explaination

Explanation:

#include <iostream>

#include <string.h>

using namespace st d;

class Package

{

protected:

//sender properities

char sname[10],saddress[50],scity[20],sstate[20];

long int szip;

//Receiver properities

char rname[10],raddress[50],rcity[20],rstate[20];

long int rzip;

//additonal datamembers

float weight,cost;

public:

Package() //Default constructor

{

strcpy(sname,"");strcpy(saddress,"");strcpy(scity,"");

strcpy(sstate,"");szip=0;

strcpy(rname,"");strcpy(raddress,"");strcpy(rcity,"");

strcpy(rstate,"");rzip=0;

weight=cost=0;

}

Package(char sn[10],char sa[50],char sc[20],char ss[20],long int sz,char rn[10],char ra[50],char rc[20],char rs[20],long int rz,float w,float c) //Constructor with parameter

{

strcpy(sname,sn);strcpy(saddress,sa);strcpy(scity,sc); //copying each parameter value to data member

strcpy(sstate,ss);szip=0;

strcpy(rname,rn);strcpy(raddress,ra);strcpy(rcity,rc);

strcpy(rstate,rs);rzip=0;

weight=w;cost=c;

}

float calculateCost() //calculating cost

{

return weight*cost;

}

};

class TwoDayPackage:public Package //Inheritance

{

float flatfee;

public:

TwoDayPackage(char sn[10],char sa[50],char sc[20],char ss[20],long int sz,char rn[10],char ra[50],char rc[20],char rs[20],long int rz,float w,float c,float ff) //Constructor with parameter

{

Package(sn,sa,sc,ss,sz,rn,ra,rc,rs,rz,w,c); //calling super class constructor

flatfee=ff; //copy last parameter

}

float calculateCost() //redefined calculateCost function

{

return (weight*cost)+flatfee; //return total cost

}

};

class OverNightPackage:public Package //Inheritance

{

float addfee;

public:

OverNightPackage(char sn[10],char sa[50],char sc[20],char ss[20],long int sz,char rn[10],char ra[50],char rc[20],char rs[20],long int rz,float w,float c,float a f) //constructor with parameter

{

Package(sn,sa,sc,ss,sz,rn,ra,rc,rs,rz,w,c); //calling super class constructor

addfee=a f; //copy last parameter

}

float calculateCost() //redefined calculateCost function

{

return (weight*cost)+addfee; //calculating total cost

}

};

int main()

{

Package package1("lou brown","1 main st","boston","ma",11111,"mary smith","7 elm st","new york","ny",22222,8.5,0.5); //creating objects

TwoDayPackage package2("lisa klein", "5 broadway", "somerville", "ma", 33333, "bob george", "21 pine rd", "cambridge", "ma", 44444, 10.5, .65, 2.0 );

OverNightPackage package3 ("ed lewis", "2 oak st", "boston", "ma", 55555, "don kelly", "9 main st", "denver", "co", 66666, 12.25, .7, .25 );

cout<<"\nPackage Cost : "<<package1.calculateCost(); //calling each cost

cout<<"\nTwoDay Package Cost : "<<package2.calculateCost();

cout<<"\nOvernight Package Cost : "<<package3.calculateCost();

return 0;

}

8 0
3 years ago
What is the best application to create a slide show presentation?
Lynna [10]

Answer:

Microsoft Windows File Manager

5 0
3 years ago
Read 2 more answers
Assuming that all of the table and column names are spelled correctly, what's wrong with the INSERT statement that follows?
Whitepunk [10]

Answer:

C. The number of items in the column list doesn't match the number in the VALUES list.

Explanation:

The INSERT INTO statement is used to insert new records in a table.

<u>Syntax is as follows:</u>

INSERT INTO table_name (column1, column2, column3, ...)

VALUES (value1, value2, value3, ...);

Each column item has to match with the values to be inserted in the same order.

In the question, there are 8 column items specified whereas there are only 7 values given to be inserted.

3 0
3 years ago
Your customer, Maggie, wants to buy a gaming PC, and she specifically mentions that she wants an Intel CPU and intends to overcl
Ksenya-84 [330]

Answer:

Intel produces a series of unlocked CPU's that can be overclocked. These CPUs are from the "K" or "X" series. Example: Intel Core i9-9900K, Intel Core i9-10940X.

These are the few things that are to be kept in mind while overclocking:

-Motherboard: Motherboard should support overclocking. Example: Intel Z series, most AMD motherboards.

-Cooler: Boosting the clock speed increases the temperature. The cooler has to be upgraded to keep the temperatures low. Example: Water-cooled. Also, the heat sink has to be checked if it's working properly.

-Be ready to test your system in BIOS. Make sure the temperature, voltage, memory speed is stable for the set clock speed.

Explanation:

8 0
3 years ago
Which selection below lists two operating systems that include BitLocker? A. Windows XP Professional and Windows 7 Professional
Leona [35]
It will be the windows 8 professional
3 0
3 years ago
Other questions:
  • If you turn your volume to loud on u'r headphones can it break the sound quality of the speaker?
    9·2 answers
  • What does zooming do? A. Changes your view of the Frame Editor to be closer or farther away B. Changes your view of the Event Ed
    12·1 answer
  • What does sampling accomplish? Choose all that
    11·1 answer
  • Whether you work in m-commerce, e-commerce, or brick-and-mortar commerce, to be successful you will need to be able to think cri
    15·1 answer
  • Emilio is reviewing the data he collected from historical records about immigration in the united states. He decides to create a
    5·1 answer
  • 2. The factorial of a positive integer n is the product of the integers from 1 to n. You can express the factorial of a positive
    6·1 answer
  • Trudy is preparing a reply to an email message. Before she could send out the message, she is called for a meeting. If Trudy has
    6·2 answers
  • How to convert a .enw file into a .pdf without downloading any applications? (If I have to, then I will. Just please tell me.)
    14·2 answers
  • Who is the first British in Europe ​
    10·1 answer
  • Naseer has inserted an image into his document but needs the image to appear on its own line.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!