help-octave
[Top][All Lists]
Advanced

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

Re: mod_octave?


From: Gavin Jin
Subject: Re: mod_octave?
Date: Thu, 20 Mar 2003 18:24:36 -0800

Correct me if I'm wrong, but it seems to me that
every time your perl script calls octave inline, the server still has
to load the interpreter. No?

The purpose of all those mod_* is they are  modules of Apache and
are loaded once and for all when the server is started. Unless mod_perl or other mod_*
comes with octave interpreter, I don't see how the reloading with
new tasks can be avoided.




On Wednesday, March 19, 2003, at 07:37 PM, Andy Adler wrote:

On Wed, 19 Mar 2003, Gavin Jin wrote:
If not a stand alone mod_octave, how about something that works with
mod_* and frees the web server from loading the octave interpreter
every time a new octave task needs to be evaluated?

Can any of the suggestions you mentioned do that?

The following works well with apache cgi-bin.
I don't see any reason why it wouldn't work well with mod_perl:
If you try this solution, keep us posted on the results.

-----File C:/Apache/cgi-bin/inlinetest.cgi
#!c:/cygwin/bin/perl.exe

print "Content-type: text/plain\n\n";

printf "Test Perl:   2+2 = %d\n", perl_add(2,2);
printf "Test C:      2+2 = %d\n", c_add(2,2);
printf "Test Octave: 2+2 = %d\n", octave_add(2,2)->as_scalar();

sub perl_add {
    my ($a,$b)= @_;
    return $a+$b;
}

use Inline C => q{
int c_add ( int a, int b) {
   return a+b;
} };

use Inline Octave => q{
function s=octave_add(a,b);
   s= a+b;
endfunction };
-----------------------------------

Web server output is:
    Test Perl:   2+2 = 4
    Test C:      2+2 = 4
    Test Octave: 2+2 = 4



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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