The things that you do to avoid lock contention also help to reduce deadlocks (see Avoiding Blocks). Beyond that, you should also make sure all threads access data in the same order as all other threads. So long as threads lock records in the same basic order, there is no possibility of a deadlock (threads can still block, however).