I would like to bring the COOL aspect weaver to your attention. Josh Marshall sent a message yesterday about how to use it. I used it first under Windows 95 and then on an UltraSPARC and it works as advertised. If you use multiple threads in your project, you are encouraged to use the COOL aspect in your project. Most real-life systems are multi-threaded so you can be sure to use threads later in your career. Here is a simple test program: (see : http://www.ccs.neu.edu/research/demeter/course/f97/cool/cool-demo/) program.cool coordinator Printer { mutex { print1, print2 } } It says that the two methods of class Printer must be mutually exclusive. Methods print1 and print2 go through a loop 4 times and print thread information for each iteration. If we use three threads, two calling print2 and one calling print1, we get an output like: Thread[Thread-1,5,main] executing print2() Thread[Thread-3,5,main] executing print2() Thread[Thread-1,5,main] executing print2() Thread[Thread-3,5,main] executing print2() Thread[Thread-3,5,main] executing print2() Thread[Thread-1,5,main] executing print2() Thread[Thread-3,5,main] executing print2() Thread[Thread-1,5,main] executing print2() Thread[Thread-2,5,main] executing print1() Thread[Thread-2,5,main] executing print1() Thread[Thread-2,5,main] executing print1() Thread[Thread-2,5,main] executing print1() If comment out the mutex statement, we get something like: Thread[Thread-2,5,main] executing print2() Thread[Thread-1,5,main] executing print1() Thread[Thread-3,5,main] executing print2() Thread[Thread-1,5,main] executing print2() Thread[Thread-3,5,main] executing print1() Thread[Thread-2,5,main] executing print2() Thread[Thread-1,5,main] executing print2() Thread[Thread-3,5,main] executing print2() Thread[Thread-2,5,main] executing print2() Thread[Thread-1,5,main] executing print1() Thread[Thread-2,5,main] executing print2() Thread[Thread-3,5,main] executing print1() In this test program, mutual exclusion makes sure that 1a and 2s appear as blocks of 4. See program.beh and program.cd for more detail. -- Karl From jayantha@ccs.neu.edu Tue Nov 18 13:13:09 1997 From: "Joshua C. Marshall" To: com3360@ccs.neu.edu Subject: Using Aspects To use the coordination aspect, you must make a change to the GNUmakefile. Change the line: # Demeter compiler DEMJAVA = demjava -tracevis -displayvis -printvis -copyvis -equalvis -outputdir $(GENDIR) To: # Demeter compiler DEMJAVA = demjava -aspect -outputdir $(GENDIR) The universal visitor isn't yet working with the aspect weaver. Next make as usual (you can abort during the final compilation step - after the .asp files have been generated). Call /proj/demsys/weaver/bin/aspectc . As of now, only mutex and selfex sets are working correctly. Hopefully method managers (and the universal visitor) will be fixed shortly. josh