[GiNaC-list] is ginac thread safe for this case?

Alexei Sheplyakov alexei.sheplyakov at gmail.com
Sun Jun 13 11:22:30 CEST 2010


On Sat, Jun 12, 2010 at 07:01:47PM -0400, Cristobal Navarro wrote:

> will ginac be thread safe for this case?

GiNaC is not thread safe. Therefore one can use GiNaC only from one thread.
> 1) threads access diferent expressions which are independant
> 2) each thread will increase the expression its working in.. for example
> thread1...expression1 += x+y      thread2.... expression2 += 2*x.... and so
> on.
> 2) no function evaluation is done never.
> 3) however, all expressions share the same global symbols ( eg, expressions
> made of global symbols x and y ).
> 4) threads access the same common matrix of expressions, but two threads
> will never access the same cell.

None of these is going to work. Most likely your program will segfault or
give some bizzare results.

Best regards,

More information about the GiNaC-list mailing list