kredel / java-algebra-system

Java Algebra System (JAS) Project
GNU General Public License v2.0
44 stars 9 forks source link

Guava TimeLimiter - how to stop also FactorAbstract JAS threads #7

Closed axkr closed 5 years ago

axkr commented 6 years ago

Implemented a time constrained execution with the Guava TimeLimiter.

How can I ensure, that the JAS threads also stop, if I'm using this framework? (i.e. FactorAbstract#factorsSquarefreeKronecker writes a lot of ...ti(1234567)... message to console - somewhat randomly? Although the main calculation has already stopped?)

   static public int MAX_THREADS_COUNT = 10;
   final ExecutorService executor = Executors.newFixedThreadPool(MAX_THREADS_COUNT);
...

...
   TimeLimiter timeLimiter = SimpleTimeLimiter.create(executor ); 
   EvalCallable work = new EvalCallable(engine);
kredel commented 6 years ago

To my knowledge, the Factor* methods are not parallelzed. So I wonder how this could happen. Can you provide a stack trace at such a point? Which coefficient ring have your polynomials? Why is FactorAbstract#factorsSquarefreeKronecker called at all?

axkr commented 6 years ago

Ok you are right. Difficult to show that the output doesn't stop.