Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!brutus.cs.uiuc.edu!psuvax1!husc6!m2c!wpi!jwhitson From: jwhitson@wpi.wpi.edu (John C Whitson KB2GNC) Newsgroups: comp.sys.encore Subject: Encore Parallel Threads Keywords: help, bug Message-ID: <9691@wpi.wpi.edu> Date: 15 Mar 90 16:32:22 GMT Organization: Worcester Polytechnic Institute, Worcester, Mass. Lines: 64 I am running the *simplest* threads applications from the Encore Parallel Threads Manual (matrix multiply, the examples), and the examples have one problem: they never complete!! My program sits around and does nothing, yet there are also n CPU bound processes that are running that it created. I am doing this on an 8-processor XPC Encore Multimax, runnning UMAX 4.3 R4_0.0 with NFS, dated Feb 8 1990. Has anyone else experienced this problem? Or perhaps knows the fix?? Is there a fix?? Here is the program: #include #include int A[9] = { 1,2,3,4,5,6,7,8,9}; int B[9] = { 9,8,7,6,5,4,3,2,1 }; int C[9]; main(argc,argv) int argc; char *argv[]; { extern void startup(); if (argc != 2) { fprintf(stderr,"usage: tst #procs\n"); exit(1); } THREADgo(atol(argv[1]),2*1024*1024,startup,0,0,20*1024,0); } void startup() { extern void mult(); struct { int i; int j; } ij; for(ij.i=0;ij.i<3;ij.i++) for(ij.j=0;ij.j<3;ij.j++) THREADcreate(mult,&ij,sizeof(ij),ATTACHED,20*1024,0); while(THREADjoin()); printf("%3d %3d %3d %3d %3d %3d %3d %3d %3d\n", C[0], C[1], C[2], C[3], C[4], C[5], C[6], C[7], C[8]); } void mult(ij) struct { int i; int j; } *ij; { register int i; register int t=0; register int col = 3*ij->i; register int row = ij->j; for(i=0;i<3;i++) { t += A[col]*B[row]; col++; row += 3; } C[3*ij->i + ij->j] = t; } /******** ENd of Program ********/ -- ---------- If at first you don't succeed, so much for skydiving --------- John Whitson: Internet: jwhitson@wpi.wpi.edu Bitnet: jwhitson@wpi.bitnet 73's from KB2GNC/1 UUCP: uunet!wpi.wpi.edu!jwhitson ---------- Anything with this tag on it is purely my own opinion ---------