answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

What is queue explain the basic element of queue?

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. Following are the types of queue: Linear queue Circular queue Priority queue Double ended queue ( or deque )


How to write c programme of Sleeping-barber problem in opertating system?

#define CHAIRS 5 /* # chairs for waiting customers */ typedef int semaphore; /* use your imagination */ semaphore customers = 0; /* # of customers waiting for service */ semaphore barbers = 0; /* # of barbers waiting for customers */ semaphore mutex = 1; /* for mutual exclusion */ int waiting = 0; /* customer are waiting (not being cut) */ void barber(void) { while (TRUE) { down(&customers); /* go to sleep if # of customers is 0 */ down(&mutex); /* acquire access to "waiting' */ waiting = waiting - 1; /* decrement count of waiting customers */ up(&barbers); /* one barber is now ready to cut hair */ up(&mutex); /* release 'waiting' */ cut_hair(); /* cut hair (outside critical region */ } } void customer(void) { down(&mutex); /* enter critical region */ if (waiting < CHAIRS) { /* if there are no free chairs, leave */ waiting = waiting + 1; /* increment count of waiting customers */ up(&customers); /* wake up barber if necessary */ up(&mutex); /* release access to 'waiting' */ down(&barbers); /* go to sleep if # of free barbers is 0 */ get_haircut(); /* be seated and be served */ } else { up(&mutex); /* shop is full; do not wait */ } }



How deadlock is achieved in java?

A Deadlock is a situation of indefinite waiting where the system is stuck at a particular point and would do nothing useful. For example Method A is waiting for B's input while B is waiting for C's input and C in turn is waiting for A's input. Here all the 3 methods would continue to wait because they are waiting on one another and the system is stuck. A deadlock usually occurs while using threads. Threads can lock objects on which they are processing and when multiple threads are waiting for the same object a Dead lock may occur. The use of the synchronize keyword can be used to avoid such deadlock situations.


What is the Young modulus for pipe API 5L?

I am waiting for the answer


What is the difference between busy waiting and blocking process?

Busy waiting vs. Blocking Busy waiting is preferable when: Scheduling overhead is larger than expected wait time. Process resources are not needed for another tasks Schedule -based blocking is inappropriate (e.g in OS kernel)

Related Questions

Which Company Gives The Top Rated Car Removals Services In New Zealand?

At New Zealand there are many company who provides the car removals services .But the problem is that many times you are unsatisfied with the services. Then, why are you waiting for, come Cars Wreckers Company the best & affordable Car Removals service provider . They promise that you definitely get the services that you want.


What is the difference between waiting shed and waiting shade?

The difference between waiting shed and waiting shade is the structure. A waiting shed is a small structure where a person can go to get out of the sun. Waiting shade is under a tree or in the shadow of a structure out of the sun.


What color represents waiting and joyful expectation?

Purple


What was the government and social structure in constantinople?

The social structure and gov. was like a porcupine waiting to be petted.


Can waiting for godot be read religiously?

yes, a common interpretation is that Godot represents God.


What are the colors for the Advent candle and what are their meanings?

Three purple candles (1st, 2nd, and 4th sundays) and one pink candle. Purple represents waiting, and pink represents joy.


What is a dime waiting on a dollar?

"dollar waiting on a dime" not a dime waiting on a dollar. The dime represents the lower pay scale job such as a receptionist or assistant. The dollar represents the manager level position or the higher pay scale position. This expression is used to reemphasize a hierarchy between two individuals (e.g. a dollar should never have to wait on a dime because a dollar is worth more).


Why does Themis have a sword?

The sword represents the punishment waiting for the unjust. Themis was the Representation of Justice and is the source of our imagery of a blindfolded woman carrying a sword and scales.


What are the advantages and disadvantages of modern storage structure against ancient water storage systems?

I'm waiting for my answer


What is first in first out data structure?

QUEUE is the first in first out (FIFO) data structure. It is a linear data structure in which insertion of an element is done from rear end of a list and deletion of an element is done from front end of a list. For example- people in queue waiting for bus.


Did the structure of the cattle industry become increasingly corporate during the half of the nineteenth century?

The structure of the cattle industry became increasingly corporate during the second half of the 19th century. The population of the Northeastern United States grew at a rapid rate, waiting to a need for a corporate structure.


What is the average number of unadopted children each year?

Each year, approximately 125,000 children in the United States are waiting to be adopted from foster care. This number represents the average number of unadopted children each year who are in need of permanent homes and families.