------=_Part_259695_23412887.1158347881511
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I am not sure, if this deserves a response, but i was experimenting with
rubyinline and was trying to write some of the controller code in C.
class FameController < ApplicationController
inline do |builder|
builder.c "
long factorial(int max) {
int i=max, result=1;
while (i >= 2) { result *= i--; }
return result;
}"
end
def my_factorial_fame
my_fame = factorial(1)
end
end
Now good thing about the above controller code is that, it works. And the
bad news is, it works only once...upon the next refresh it says:
require on /home/gnufied/.ruby_inline/Inline_FoobarController_cb89.so failed
I am not sure, how it translates into English. but SO file is there in
the location mentioned. I guess, its completely crazy to attempt this.
But i need such a thing.
I have 3000 lines of ruby code that does some very complicated
mathematical calculations and its slow. worst it generates
segmentation faults(Probably writing it in C will
generate some more of seg faults and no it was not written by me. I
would have used GSL in places at least.)
Now...what are my options? this 3000 line code is a rails controller code.
Another question is, can i use rubyinline in background worker threads
created by backgroundrb plugin?
PS: Sorry for a bag of mixed questions.
--
---
The Road goes ever on and on
Down from the door where it began.
Now far ahead the Road has gone,
And I must follow, if I can,
Pursuing it with eager feet,
Until it joins some larger way
Where many paths and errands meet.
And whither then? I cannot say.
------=_Part_259695_23412887.1158347881511--