help-octave
[Top][All Lists]
Advanced

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

PThread + Feval


From: Surfing
Subject: PThread + Feval
Date: Thu, 30 Dec 2010 11:29:05 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

Hi all,
I'm writing some code in C++, compiling it with mkoctfile from Octave.

I used pthread to obtain a multithread calculations and it works for almost everything.
But now I've a problem ...

I want to do simply this:

double func1(double first, double second)
{
    octave_value_list fargs;
    fargs(0) = octave_value(first);
    fargs(1) = octave_value(second);
    return feval(func2,fargs)(0).double_value();
}

If I execute this in a single thread mode, it works... but when I run in in multithread mode (so more threads calls that function in the same time), it gives me a segmentation fault at the assignment fargs(0) = ... after some iterations...

If I try to assign those value to a simple double array it works...but obviously then I can't pass that array to feval ....

Any suggestions?

Then...I execute that function lots of time and I know that feval is very slow if it's called so many time...(and I noticed it). Is there a way to speed up things? The function I have to call is always the same, but with different arguments...

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]