[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] gsl Splines
From: |
Henry Butowsky |
Subject: |
[Help-gsl] gsl Splines |
Date: |
Mon, 22 Jun 2009 14:31:37 +0100 |
Hi there,
I wish to uses the gsl spline library in a "threaded context"
So for example
*MAIN THREAD
*double x[4]={1,2,3,4};
double y[4]={0,.2.7.9,1.2};
const gsl_interp_type t_m=gsl_interp_cspline_periodic;
gsl_spline=gsl_spline_alloc(t_m,4);
*THREAD 1
*double x1=2.5;
double y1;
gsl_interp_accel *acc=gsl_interp_accel_alloc();*
*y1=gsl_spline_eval(spline,x1,acc);
*THREAD 2
*double x1=2.5;
double y1;
gsl_interp_accel *acc=gsl_interp_accel_alloc();*
*y2=gsl_spline_eval(spline,x1,acc);
Where "spline is a "global" type variable,
x1,y1, acc are variables local to each thread
So will the above code work ? Or will the "state" maintained in
gsl_spline->interp cause a crash or a segfault ?
Many thanks ....Henry
- [Help-gsl] gsl Splines,
Henry Butowsky <=