Bill Allombert on Sat, 16 Sep 2006 11:32:32 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: PARI_stack_limit

On Thu, Sep 14, 2006 at 06:17:00PM +0200, Bernard Parisse wrote:
> Hi,
> > First a question:
> > Are you running pari_init outside the thread and flisexpr in the thread
> > ? This is not really supported, though it would be nice if it worked.
> >
> Yes, pari_init is run once during static initialization, and flisexpr
> is run each time the user run a pari command inside Xcas, and
> each command is run in a separate thread.

But you run exactly one thread at once ?

Could you write a stand-alone test case ? It would help.

> > How can we improve PARI there ? We could:
> > 1) Allow user to disable PARI_stack_limit check
> > 2) Allow user to reset the stack limit for the new thread.
> > 3) Simply move PARI_stack_limit to paripub.h
> > 
> > Something else ?
> > 
> 3) would suffice for Xcas. I have no idea how you could implement
> something really thread-safe if you don't pass some context information
> and that would probably require (too) many changes.

Well being thread-safe is another issue (See Configure
--enable-tls). It seems to me that we could make the function
pari_init_stackcheck public, and require you call it a the
start of each threads. We should also provide an init_opts
flag to deactivate it.