3 ways to break dead lock

1) supply special resources.

 

This resource can be only used by one special thread.

 

2) permit held up resources can be required by other threads.

 

threads manager should be able to signal interrupt command to let locked up threads giving up resources.

 

3) resources have different level --- low level resource and high level resource.

 

Resource grabing must happen from low level to high level.

你可能感兴趣的:(thread,UP)