[Gambas-devel] Gambas as a web server ...

Gareth Bult gareth at ...623...
Fri Feb 6 13:49:49 CET 2009


Hi,

As the script needs to access a database and the database open / connect time is significant, the script needs to be "resident" or live within a "resident" wrapped .. so CGI doesn't really do it for me. I guess Fast CGI might, but I've tried to use this in the past and been disappointed.

I think the bottom line is, I need to find "some" way to make Gambas work with threads, even if I write in "C" and call Gambas from a thread .. so .. is there an interface that would be useful to call Gambas from "C" which would be efficient with regards to calling different Gambas code snippets very quickly .. (EXEC is not an option!  ;-) )

tia

Gareth.

----- Original Message -----
From: "Benoît Minisini" <gambas at ...1...>
To: "mailing list for gambas developers" <gambas-devel at ...494...t>
Sent: Friday, 6 February, 2009 12:34:00 PM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [Gambas-devel] Gambas as a web server ...

> Hi,
>
> The "C" / threading side of things is not a problem .. I can code this in
> my sleep and indeed have a couple of working examples I've written for
> other projects .. the real questions are;
>
> a. Can Gambas be efficiently called from "C"
> b. Can Eval (which I've not played with) compile and run code fragments
> efficiently c. Is there an alternative to "Eval" for compiling / running
> code fragments that I should use instead
>
> Just wondered if anyone had any advance knowledge of this before I started
> experimenting ... ?
>
> Gareth.
>

Hi, Gareth.

I'm writing for my job a Web application in Gambas. It is "just" a CGI script 
plugged into a light web server. I use a patched thttpd, but lighttpd is well-
known too.

thttpd does not use thread to dispatch request. Apparently threaded server 
seems to always be slower than non-threaded ones. It is very fast, and I'm 
sure that my CGI script written in Gambas beats in speed many other web 
application. :-)

Try that, and if you find it too slow, of course writing a HTTP server in the 
same process as the gambas interpreter would be interesting. 

You will win the process launch time (even if launching a process on Linux is 
very fast). 

But then, just take the thttpd source code and merge it in a gambas component. 
I can't imagine writing a faster HTTP server.

P.S.: I don't receive my own post on the mailing-list anymore, since I 
installed KDE 4.2. But this should not be related, unless there is an hidden 
change in KMail. Hopefully, I receive posts from other people. If somebody has 
a clue...

Regards,

-- 
Benoît

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Gambas-devel mailing list
Gambas-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel

-- 
Gareth Bult (Gareth at ...624...)




More information about the Devel mailing list