answersLogoWhite

0


Best Answer

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)

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between busy waiting and blocking process?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How can a sleeping process wake up in Linux?

When an interrupt occurs for which the process was waiting the OS should start executing the process. If the process isn't waiting for anything and there isn't anything for it to do, it might not start executing. Many processes in LINUX use a send/receive/reply IPC protocol. If the process is waiting for an IPC message from something else and has no timeout associated with the wait, it could effectively wait forever. In general, that's considered an error in programming.


Write a socket program in C to implement a listener and a talker?

In socket programming, there are two sides to every conversation: the listener (or server), and talker (the client).The server first opens a desired port, receives a socket handle, and begins listening for connections. It polls the socket every so often to listen for attempted connections by clients. Once a connection has been established, communication begins.A client merely indicates an IP address and port to connect to. Once the connection is made, communication begins.Then there are blocking and non-blocking sockets, which applies to both servers and clients. Blocking socketsforce the program to wait until there's activity before continuing its operation. So a server process will pause while waiting for a connection, and a client process will pause while waiting for the server to send data.Under most conditions, non-blocking sockets are preferred. This allows the program to give up timeslices to the operating system, as well as conduct any activities in the background like listening to multiple connections (for servers).Writing a socket program is about the same between Windows and Unix/Linux based systems, but there are some differences in setting up non-blocking sockets as well as initializing and closing the socket interface.More information on both Win32 and Linux socket programming can be found in the related links below.


What is the difference between resource allocation graph and wait for graph?

In Wait for Graph the request edge is a directed edge Pi → Pj which indicates that process Pj is holding a resource that process Pi needs and thus Pi is waiting for Pj to release its lock on that resource. It does not have any allocation edge.In case of Resource Allocation Graph the request edge is a directed edge Pi → Rj which indicates that process Pi is requesting resource Rj. It has an allocation edge from Rj→Pk when the resource Rj is allocated to process Pk.The way the graphs are drawn are also different but both of them are used in deadlock detection.


What is hold and wait condition?

A process or thread holding a resource while waiting to get hold of another resource


Explain about threads in computer networks?

A thread is the sequence of instructions followed by a CPU, and is an independently dispachable unit in the run queue. A process can start and manage multiple threads, each managing an aspect of the overall processing. The operating system can schedule the threads independently, allowing them CPU time if they are ready, or blocking them if they are waiting on something, such as an IO completion. In a network process, such as a web server, there can be many things going on at the same concurrent time. Threads are an ideal solution to the problem of managing all of these things, because the main process does not need to poll each sub-process (thread) to see if it needs or is ready to do work.

Related questions

What is the difference between awaiting and waiting?

There is no difference between the two. 'awaiting' is just a version of 'waiting'.


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 is the difference between blocking send and non-blocking send?

One of the first issues that you'll encounter when developing your Windows Sockets applications is the difference between blocking and non-blocking sockets. Whenever you perform some operation on a socket, it may not be able to complete immediately and return control back to your program. For example, a read on a socket cannot complete until some data has been sent by the remote host. If there is no data waiting to be read, one of two things can happen: the function can wait until some data has been written on the socket, or it can return immediately with an error that indicates that there is no data to be read.


Difference between loving patience and patient love?

loving patience you are loving while waiting while patient love is waiting to love...


What is the difference between waiting 5 years or 50 years to reclaim a land?

45 years. TROLOLOLOL


What is the difference between notify and notifyAll?

1) notify() is used to unblock one waiting thread. 2) notifyall() method is used to unblock all the threads in waiting state.


What is difference between SJF and SRTF?

Shortest Job First (SJF) scheduling algorithm selects the process with the smallest burst time for execution next, which helps in reducing average waiting time. Shortest Remaining Time First (SRTF), on the other hand, preempts the currently running process if a new process with a smaller burst time arrives, resulting in even lower waiting times but with increased context switching.


How many waiting processes can a single processor have?

1 process at most is running. 1 process or multiple are ready. 1 process or multiple are waiting.


What is the different between I am waiting on you and waiting for you?

Hello, the difference is this: `waiting for you` is when you are meeting someone and you wait for them maybe in a cafe or restaurant and they have not arrived yet, but `waiting on you` is like a butler or servant who is standing at a table ready to give diners their food and drink or who is ready to give their master clothes or whatever he needs.


What is the waiting state of a process?

The waiting state of a process occurs when it is ready to execute but is waiting for a resource, such as input/output operation to complete or a signal from another process. While in this state, the process cannot make progress until the required resource becomes available.


What is the difference between preemptive and non preemptive scheduling?

1.) in preemptive scheduling we prempt the currently executing process, in non preemptive scheduling we allow the current process to finish its CPU burst time... 2.) in preemptive scheduling the process is forcibly sent to waiting state when a process with higher priority comes to CPU, in non preeemptive scheduling the process at running state can not be forced to leave the CPU until it completes........


Different between waiting on you and waiting for you?

différence entre waiting on God et waiting for God