1 // This pathological test tries to grow a FLC list as long as possible before
2 // the threads from the previous FLC list have resumed running. Every one on
3 // the old list then has to scan the entire new list.
5 // The CACAO patch in file sableContention.patch can be used to examine the
6 // maximum length. With 500 threads on a quad-core system, I managed to get to
9 class sableContention {
10 public Object a[] = null;
11 public tt ts[] = null;
14 class tt extends Thread {
17 tt(sableContention y, int x) {
23 synchronized(y.a[x]) {
25 for (; i<NUM*3/4; i++)
33 for (int j=0; j<NUM/10; j++)
34 synchronized(y.a[(x+j)%(NUM-1)+1]) {
39 private void l(int f) {
41 synchronized(a[NUM-1-f]) {
45 Thread.sleep(0, f*100 * 1000);
49 for (int i=0; i<NUM; i++)
50 ts[i] = new tt(this, i);
55 } catch (InterruptedException e) {
62 for (int i=0; i<NUM; i++)
65 for (int i=0; i<NUM; i++)
68 } catch (InterruptedException e) {
70 System.out.println("running");
74 public static void main(String[] args) {
75 new sableContention().r();
80 * These are local overrides for various environment variables in Emacs.
81 * Please do not remove this and leave it at the end of the file, where
82 * Emacs will automagically detect them.
83 * ---------------------------------------------------------------------
90 * vim:noexpandtab:sw=4:ts=4: