Note: projects that are considered concurrent have to implements Runnable, or extends Runnable, or extends Threads, or use syncronized keyword (method or block).
Notice that although more than 75% of all projects use, at least, one concurrent construct, only 19% take advantage of java.util.concurrent library. In our opnion, developers are wasting many opportunities to use higher level/more efficient abstractions.
More curious statistics.
The most common used constructs per 100KLoC.
| Construct | Median | Mean | ||||||
| S | M | L | ALL | S | M | L | ALL | |
| Atomic variables | 22.89 | 8.72 | 1.56 | 8.05 | 48.46 | 17.86 | 8.17 | 22.05 |
| extends Runnable | 19.32 | 2.38 | 0.86 | 2.37 | 19.78 | 4.87 | 1.58 | 7.36 |
| extends Thread | 25.00 | 6.05 | 2.74 | 13.00 | 42.54 | 9.95 | 5.46 | 28.93 |
| Executors Constructs | 20.93 | 3.90 | 11.90 | 5.13 | 34.82 | 13.14 | 11.74 | 18.73 |
| implements Runnable | 27.45 | 7.18 | 3.73 | 13.85 | 46.92 | 12.13 | 7.43 | 28.43 |
| sync blocks | 73.47 | 33.22 | 31.52 | 55.04 | 152.29 | 75.03 | 71.32 | 117.60 |
| sync methods | 81.43 | 54.29 | 47.65 | 66.75 | 184.68 | 99.76 | 88.50 | 145.20 |
| notify() | 26.26 | 5.77 | 2.41 | 8.69 | 41.66 | 10.78 | 5.64 | 24.99 |
| notifyAll() | 24.00 | 6.37 | 2.77 | 9.09 | 50.45 | 11.65 | 7.22 | 24.89 |
| volatile | 29.95 | 8.86 | 3.55 | 11.73 | 69.76 | 31.31 | 18.92 | 40.71 |
| wait() | 25.60 | 7.22 | 3.97 | 11.51 | 46.80 | 14.12 | 11.24 | 29.86 |
Where S, M, L means Small, Medium and Large.