What is "deadlock-safe"?

What is "deadlock-safe"?

I received an announcement in my email for Message-Driven Java Threads API this morning. Apparently, Java threads can send and receive message between themselves with this API.

Perusing the few paragraphs of the announcement I came across the term "deadlock-safe" which I didn't understand. I know what "deadlock-free" would imply. Since I'm unfamiliar with Java Threads and may not be up-to-date on the most current lingo in that area, I went to the proffered website and still didn't find anything.

Can anyone give me a definition/description of "deadlock-safe"? How is this important to Java Threads, especially for those that can pass messages? Examples would help this old, tired brain grasp any new-fangled concepts.


-- clay

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

> Perusing the few paragraphs of the announcement I
> came across the term "deadlock-safe" which I didn't
> understand.

Lock-free is deadlock-free. Java is using some lock-free algos. RCU... They have classes for atomic primitives that can implement many lock-free algos.

If a piece of code is holding a complex set of locks, and calls an API which uses its own locking schema... Sometimes you can deadlock yourself. I think there is a link on MSDN somewhere about this issue.

This is an example of a lock & deadlock-free algo

Message Edited by intel.software.network.support on 12-09-2005 01:41 PM

> I'll buy the lock-free is deadlock-free. I assume
> that you can get rid of one or more of the conditions
> for deadlock by doing this?


> If the Java primitives do use
> lock-free methods to achieve a deadlock-free
> implementation

Java uses lock-free algos in it new dictionary:

Java Runtime Improvements

And its event multi-caster. Maybe RCU?

> For example, two
> threads both execute a blocking receive expecting the
> other thread to do the send operation first.

INFINITE blocking will deadlock for sure, if your not safe.

> Does the Java thread message passing API
> implementation not have blocking operations?

Not sure. I don't use Java.

> Perhaps
> each operation is timed and this could break the
> deadlock cycle.

That would do it.


Is this similar to the message you got?

Deadlock Safe Java API?

> P.S.
> Is this similar to the message you got?
> > 781" target="_blank" title="http://developer.sys-con.com/viewitem.cfm?thread=
> 781">Deadlock Safe Java API?

Yes, that is the product I was sent information about.

I don't use Java, either, so I'm not sure about some of the Java specific questions I posed. (I think we had one admitted Java Threads user in the Forum at one time. I was hoping they could have given some insights.)


Leave a Comment

Please sign in to add a comment. Not a member? Join today