18 Sep
2006
18 Sep
'06
4:07 p.m.
What is wrong with using threads in the following way in Bluebottle Oberon? ***************************************************** MODULE threads; TYPE workthread=OBJECT BEGIN{ACTIVE, normal priority} REPEAT AWAIT(gothreads); work; INC(threadsdone); AWAIT(~gothreads); END; VAR threadsdone:INTEGER; gothreads:BOOLEAN (*main thread*) PROCEDURE go*; BEGIN gothreads:=TRUE; AWAIT(threadsdone=n); (* for n threads*) gothreads:=FALSE END go; BEGIN create n thread objects END threads; each time "go" is called every thread does its work once before "go" returns to the caller. why does this create traps in the kernel log that trace to the AWAIT statement?