answersLogoWhite

0

How busy waiting occur?

Updated: 10/18/2022
User Avatar

Wiki User

11y ago

Best Answer

I copied the answer from other place:while any process is in its critical section , any other process that tries to enter its critical section must loop continously in the entry code.this continue looping is clearly a problem in a real multiprogramming system. where a single CPU is shared among many processes. Busy waiting wastes CPU cycles that could have been used by some process in more productive way. This type of semaphore is also called a spinlock.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How busy waiting occur?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

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)


Two threads are waiting for keyboard input one in each process Does this problem ever occur in single threaded processes?

Single-threaded processes only have one thread of execution -- therefore it would not be possible to have two processes waiting for input at the same time.


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.


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 */ } }



What is the Young modulus for pipe API 5L?

I am waiting for the answer

Related questions

What is the meaning of the term busy waiting What other kinds of waiting are there in an operating system Can busy waiting be avoided altogether Explain your answer?

_ A process is waiting for an event to occur and it does so by executing instructions. _ A process is waiting for an event to occur in some waiting queue (e.g., I/O, semaphore) and it does so without having the CPU assigned to it. _ Busy waiting cannot be avoided altogether.


What is busy waiting with respect to Operating System?

The repeated execution of a loop of code while waiting for an event to occur is called busy-waiting. The CPU is not engaged in any real productive activity during this period, and the process does not progress toward completion.


I am waiting for your answer?

Be more patient, could be busy.


Define Busy waiting?

"Busy waiting" is the act of actively waiting for some condition to change. In programming microcontrollers, one might want to wait for a pin to become high or low before continuing with the program. A "busy waiting loop" in C would look like this: ... while(PIN1 != HIGH) ; ... This essentially does nothing but check the value of "PIN1" time after time, waiting for it to become "HIGH". Now, if PIN1 were to become "HIGH", the processor "breaks out" of this busy-waiting loop and continues with the program.


What is busy waiting give fragment of source code in c that shows busy waiting?

while(test-and-set(1)) { //access critical section } busy waiting is constantally checking for a condition for true if it does not again and again check the condition upto condition becomes true


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)


In a multi processor environment are there some situation where busy waiting is only form of waiting can be used?

in operating system


What are the advantages and disadvantages of semaphore?

advantage small code ais busy waiting


What is the process is waiting for some event to occur?

as


Is jesus coming and shall you look busy?

Jesus is comming and we are waiting for that great day.


Why was Aunt Alexandra waiting on the pourch?

She was there to help watch the kids while atticus was busy with the trial


What does it mean if she says she is busy?

shes a busy b shvaing her legs, saving the earth w tf knows . in what context does this business occur