3

While the bank allocates resources dynamically ensuring the system is safe all the time , what if one of the threads doesn't give up the resources it has been allocated (due to some infinite loop or something) resulting in the bank's inability to satisfy other threads' needs ? Will this be called a deadlock ?

om-nom-nom
  • 60,231
  • 11
  • 174
  • 223

1 Answers1

0

In the formal argument for the banker's algorithm it's assumed that all programs return their resources after a finite amount of time, so technically this case can't happen (at least, not in the mathematically perfect world inside of which the problem is described ;-).

However, it still wouldn't be considered a deadlock -- the thread that goes into an infinite loop isn't waiting for any resource, it's just sitting there making no progress. This type of problem would simply be a... hang. A couple of possible hang types are starvation and livelock, although in the simplest case if the thread just goes to sleep / enters an infinite loop which does nothing, there is no formal term that I know of to describe that.

Dan
  • 6,013
  • 2
  • 24
  • 45