import Utilities.*; import Synchronization.*; class nQueens extends MyObject implements Runnable { private static int N = 8; private static int numSolutions = 0; private static PipedMessagePassing channel = null; private int inRow = -1; private nQueens(int inRow) { this.inRow = inRow; new Thread(this).start(); } public void run() { System.out.println("age()=" + age() + " Counting solutions with column 1 queen in row " + inRow); int[] board = new int[N+1]; for (int i = 0; i < board.length; i++) board[i] = 0; board[1] = inRow; int numFound = place(2, board); send(channel, numFound); System.out.println ("age()=" + age() + " Solutions with column 1 queen in row " + inRow + " = " + numFound); } private static boolean safe(int row, int column, int[] board) { for (int j=1; j