[concurrency-interest] Joint Talk for JavaOne?

Dawid Weiss dawid.weiss at gmail.com
Thu Apr 5 15:44:34 EDT 2012

> 1. Semaphores running out of permits
> 2. ReadWriteLocks trying to upgrade from write lock to read lock
> 3. Resource deadlocks

I'd add to this list a pseudo-deadlock caused by broken coordination
of threads via non-volatile public variables and spin loops. While not
technically a deadlock the symptoms are similar -- one thread is
spinning waiting for a variable to change and the system never
advances (because the variable is read once and peeled away from the
loop). This can constitute a number of very entertaining examples:

1) run with -client (-d32, c1 compiler) or in interpreted mode. The code works.
2) run with -server (or move to a bigger machine where -server is the
default); the code deadlocks.
3) show people that once you try to put a breakpoint (or interrupt the
execution) of a deadlocked vm, the deadlock no longer exists and
everything advances as if nothing happened (deopts)...

This was perhaps one of my favorite and fun exercises with students.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Example02.java
Type: application/octet-stream
Size: 724 bytes
Desc: not available
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120405/35da0ca5/attachment.obj>

More information about the Concurrency-interest mailing list