bankers algorithm - How do I determine whether a deadlock will occur in this system? -


n processes share m resource units can reserved , release 1 @ time. maximum need of each process not exceed m, , sum of maximum needs less m+n. can deadlock occur in system ?

the system describing looks semaphores

about last question : yes. "could" deadlock ; if don't see how, ask young/shameful/motivated/deviant developer.

one way make 1 ; have strange locking/releasing resources rules. example, if process needs m resources perform task, locks half of them right away, , waits other half available before doing anything.

i assume never gives until have m precious resources , releases them once task done.

a single process wouldn't cause problems several lock more m total resources , need more of them out frozen state.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -