2009/5/7 Jérôme Tremblay <[email protected]>: > > I have a problem using factor() in a thread. Consider the following: > > sage: class FactorThread(Thread): > ....: def run(self): > ....: factor(2^50-1) > ....: > sage: test = FactorThread() > sage: test.start() > > Exception in thread Thread-3: > Traceback (most recent call last): > File "/Library/Sage/3.4/local/lib/python/threading.py", line 486, in > __bootstrap_inner > self.run() > File "<ipython console>", line 3, in run > File "/Library/Sage/3.4/local/lib/python2.5/site-packages/sage/rings/ > arith.py", line 2027, in factor > int_=int_, debug_level=verbose, proof=proof), unit) > File "/Library/Sage/3.4/local/lib/python2.5/site-packages/sage/rings/ > arith.py", line 1849, in __factor_using_pari > prev = pari.get_debug_level() > File "gen.pyx", line 7871, in > sage.libs.pari.gen.PariInstance.get_debug_level (sage/libs/pari/gen.c: > 32133) > File "gen.pyx", line 7859, in > sage.libs.pari.gen.PariInstance.default (sage/libs/pari/gen.c:32038) > File "gen.pyx", line 9044, in sage.libs.pari.gen._pari_trap (sage/ > libs/pari/gen.c:38611) > PariError: (7) > > There seems to be a problem using pari in a new thread. > > Any suggestions? > Should I report this on SageTrac? > >
Unfortunately, pari isn't thread safe and there's no reason that Sage's factor command (which is built on pari at present, though that should change soon) should be thread safe. I believe factor is being rewritten to not use pari, which may help. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
