Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

GUI development for web UI

112 messages · 19 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello List,

Well I know about the framework fur Javascript library in Lazarus, but I'm thinking in the past year or so, what will it take to design a gui application using Lazarus, and make it work like a web app that act the same as the desktop version, without any specific components for it.

Then today I found the following link:
http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like someone made something like that on GTK3.
The problem is that I do not have the time to do it myself (or I would have created at least the start for it), what will it take to create something like that for Lazarus that is not dependent on the widgets (it will not care if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it ?

Thanks,

Ido

LINESIP websites:
http://www.linesip.com
http://www.linesip.co.il
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/39665a13/attachment.html>

Reply by email

Unknown author
to ik
ik wrote 14 lines
Hello List, Well I know about the framework fur Javascript library in Lazarus, but I'm thinking in the past year or so, what will it take to design a gui application using Lazarus, and make it work like a web app that act the same as the desktop version, without any specific components for it. Then today I found the following link: http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like someone made something like that on GTK3. The problem is that I do not have the time to do it myself (or I would have created at least the start for it), what will it take to create something like that for Lazarus that is not dependent on the widgets (it will not care if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it ?

You should first answer the question this man asks:

"Now, I want to know, Is this useful?"

The answer IMHO is: no.

Each and every GUI or user action/change/whatnot will result in a request from the browser to the webserver (with corresponding result sent back), and will cause a lot of traffic.

While this is fine and doable for small apps, it is not 100 users use your system, it will crash under the load (if not earlier).

More to the point would be the morfik approach:
- Design and code your app as you do now.
- Translate the lot to Javascript+HTML+CSS
Because then, the browser does all the GUI work, and only when necessary (get data from server or store data on server) does the server get a request.

I am building all blocks for the latter approach, but it is slow progress.

Michael.

Reply by email

ik
to Unknown author
Show quoted text 34 lines
On Wed, 24 Nov 2010, ik wrote: Hello List, > > Well I know about the framework fur Javascript library in Lazarus, but I'm > thinking in the past year or so, what will it take to design a gui > application using Lazarus, and make it work like a web app that act the > same > as the desktop version, without any specific components for it. > > Then today I found the following link: > http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like > someone made something like that on GTK3. > The problem is that I do not have the time to do it myself (or I would > have > created at least the start for it), what will it take to create something > like that for Lazarus that is not dependent on the widgets (it will not > care > if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it > ? > You should first answer the question this man asks: "Now, I want to know, Is this useful?" The answer IMHO is: no. Each and every GUI or user action/change/whatnot will result in a request from the browser to the webserver (with corresponding result sent back), and will cause a lot of traffic.

I did not want to use it on the server side but on client side. The server side should be contacted only when there is a requirement and not for everything.

Show quoted text 13 lines
While this is fine and doable for small apps, it is not 100 users use your system, it will crash under the load (if not earlier). More to the point would be the morfik approach: - Design and code your app as you do now. - Translate the lot to Javascript+HTML+CSS Because then, the browser does all the GUI work, and only when necessary (get data from server or store data on server) does the server get a request. I am building all blocks for the latter approach, but it is slow progress.

Is that what the fpWeb will do at the end ?

Show quoted text 9 lines
Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Thanks,
Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/2a1b71c7/attachment.html>

Reply by email

Unknown author
to ik
ik wrote 40 lines
On Wed, Nov 24, 2010 at 11:21, wrote: > > > On Wed, 24 Nov 2010, ik wrote: > > Hello List, >> >> Well I know about the framework fur Javascript library in Lazarus, but I'm >> thinking in the past year or so, what will it take to design a gui >> application using Lazarus, and make it work like a web app that act the >> same >> as the desktop version, without any specific components for it. >> >> Then today I found the following link: >> http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like >> someone made something like that on GTK3. >> The problem is that I do not have the time to do it myself (or I would >> have >> created at least the start for it), what will it take to create something >> like that for Lazarus that is not dependent on the widgets (it will not >> care >> if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it >> ? >> > > You should first answer the question this man asks: > > "Now, I want to know, Is this useful?" > > The answer IMHO is: no. > > Each and every GUI or user action/change/whatnot will result in a request > from the browser to the webserver (with corresponding result sent back), and > will cause a lot of traffic. > I did not want to use it on the server side but on client side. The server side should be contacted only when there is a requirement and not for everything.

Unless they plan on translating the whole of GTK3 to Javascript, I don't see how you can do that ? How to create a hover effect, tooltips, whatnot, whenever the mouse moves ? What to do when a user clicks a button ? All GUI/business logic - of necessity - would reside on the server ?

(unless I'm missing something fundamental, of course)

Show quoted text 14 lines
> While this is fine and doable for small apps, it is not > 100 users use your system, it will crash under the load (if not earlier). > > More to the point would be the morfik approach: > - Design and code your app as you do now. > - Translate the lot to Javascript+HTML+CSS > Because then, the browser does all the GUI work, and only when necessary > (get > data from server or store data on server) does the server get a request. > > I am building all blocks for the latter approach, but it is slow progress. > Is that what the fpWeb will do at the end ?

fpweb will be used to do the server part, yes.

Michael.

Reply by email

Felipe Monteiro de Carvalho
to Unknown author
Unless they plan on translating the whole of GTK3 to Javascript, I don't see how you can do that ? How to create a hover effect, tooltips, whatnot, whenever the mouse moves ? What to do when a user clicks a button ? All GUI/business logic - of necessity - would reside on the server ?

I think that an intraweb-like widgetset would be useful for easily porting apps which won't be used by so many people at a time, but I found one major obstacle: animations

I couldn't find any reasonable way to reuse my LCL animations code in web applications.

Felipe Monteiro de Carvalho

Reply by email

Michael Schnell
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
I couldn't find any reasonable way to reuse my LCL animations code in web applications.

Did you consider to use Delphi Prism (AFAIK the compiler is free) in a Silverlight / Moonlight based web page ? This might allow for reusing some of the code.

-Michael

Reply by email

ik
to Michael Schnell
Michael Schnell wrote 9 lines
On 11/24/2010 10:36 AM, Felipe Monteiro de Carvalho wrote: > I couldn't find any reasonable way to reuse my LCL animations code in > web applications. > Did you consider to use Delphi Prism (AFAIK the compiler is free) in a Silverlight / Moonlight based web page ? This might allow for reusing some of the code.

SilverLight/Moonlight are the wrong way to do things (so does Flash). HTML5 provide in the DOM support for Canvas (you have some games for it), And IE9, Webkit, Opera and Gecko support it, so it's like 99% of web browsers that support for it.
Even without HTML5 Canvas you can do a lot of animation using pictures and drawing in Javascript (you have existed libraries for that in almost the past 10 years, long before Jquery, MooTools etc)...

Furthermore, personally I hate animation and movement of things that I did not request them in the first place, and I know many others are like me.

My 2 cents in the matter...

Show quoted text 11 lines
-Michael -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/68cc2a4b/attachment.html>

Reply by email

Michael Schnell
to ik: Well I know about the framework fur Javascript library in Lazarus, but I'm thinking in…
ik wrote 6 lines
Hello List, Well I know about the framework fur Javascript library in Lazarus, but I'm thinking in the past year or so, what will it take to design a gui application using Lazarus, and make it work like a web app that act the same as the desktop version, without any specific components for it.

A decent way to do this would be creating an appropriate "Widget Type" Interface (See "How to tell lazarus the location of a used package" in this forum).

I did some research on that some months ago. I found that this supposedly best would be done using "ExtJS".

"ExtPascal" is a way to try ExtJS with Lazarus and shows how to generate "dual-mode" controls that can be used in the IDE at design time and in a client-server make up for a decent Widget Type, "Comet" technology would be needed to be used for allowing for having server generated events introduce visual changes at the client site.

Of course TTimer and an Inter Thread event Queue would be needed to be implemented within the new Widget Type (for Linux use similar as in the FPGUI Widget Type or as in MSEGUI).

-Michael

Reply by email

Felipe Monteiro de Carvalho
to ik: SilverLight/Moonlight are the wrong way to do things (so does Flash). HTML5 provide in…

2010/11/24 ik :

SilverLight/Moonlight are the wrong way to do things (so does Flash). HTML5 provide in the DOM support for Canvas (you have some games for it), And IE9, Webkit, Opera and Gecko support it, so it's like 99% of web browsers that support for it.

But the HTML5 Canvas is only programmable in Javascript.

Furthermore, personally I hate animation and movement of things that I did not request them in the first place, and I know many others are like me.

How would you implement games without animations?

Felipe Monteiro de Carvalho

Reply by email

ik
to Felipe Monteiro de Carvalho

On Wed, Nov 24, 2010 at 12:29, Felipe Monteiro de Carvalho <

Show quoted text 12 lines
wrote: 2010/11/24 ik : > SilverLight/Moonlight are the wrong way to do things (so does Flash). HTML5 > provide in the DOM support for Canvas (you have some games for it), And IE9, > Webkit, Opera and Gecko support it, so it's like 99% of web browsers that > support for it. But the HTML5 Canvas is only programmable in Javascript.

That's what I wish to do, to create a "desktop" app that can be translated to web, and making Pascal and Lazarus provide additional market to use (and hopefully it will be used).

Show quoted text 7 lines
> Furthermore, personally I hate animation and movement of things that I did > not request them in the first place, and I know many others are like me. How would you implement games without animations?

That's an animation you expect :)
BTW: http://www.notenoughminerals.com/?p=19 .

Show quoted text 10 lines
-- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/955d27ca/attachment-0001.html>

Reply by email

Unknown author
to Michael Schnell: A decent way to do this would be creating an appropriate "Widget Type" Interface (See…
Michael Schnell wrote 14 lines
On 11/24/2010 08:32 AM, ik wrote: > Hello List, > > Well I know about the framework fur Javascript library in Lazarus, but I'm > thinking in the past year or so, what will it take to design a gui > application using Lazarus, and make it work like a web app that act the > same as the desktop version, without any specific components for it. A decent way to do this would be creating an appropriate "Widget Type" Interface (See "How to tell lazarus the location of a used package" in this forum). I did some research on that some months ago. I found that this supposedly best would be done using "ExtJS".

This, I agree with. In my experience, ExtJS is the best available toolkit for the browser.

"ExtPascal" is a way to try ExtJS with Lazarus and shows how to generate "dual-mode" controls that can be used in the IDE at design time and in a client-server has some serious design flaws, and by the looks of it they will

not be solved anytime soon.

I tried making moderatly complicated production applications with it. It cannot be done without redesigning ExtPascal from the ground up.

To make up for a decent Widget Type, "Comet" technology would be needed to be used for allowing for having server generated events introduce visual changes at the client site.

Comet is a rickety technology. Not robust at all, and creates more problems than it solves. You can use polling, but that's just plain HTTP, not even worth of putting a name on it.

Of course TTimer and an Inter Thread event Queue would be needed to be implemented within the new Widget Type (for Linux use similar as in the FPGUI Widget Type or as in MSEGUI).

Hehe, I was waiting for you to bring this one up. Never fails :-)

Michael.

Reply by email

ik
to Michael Schnell: A decent way to do this would be creating an appropriate "Widget Type" Interface (See…
Michael Schnell wrote 17 lines
On 11/24/2010 08:32 AM, ik wrote: > Hello List, > > Well I know about the framework fur Javascript library in Lazarus, but I'm > thinking in the past year or so, what will it take to design a gui > application using Lazarus, and make it work like a web app that act the same > as the desktop version, without any specific components for it. > A decent way to do this would be creating an appropriate "Widget Type" Interface (See "How to tell lazarus the location of a used package" in this forum). I did some research on that some months ago. I found that this supposedly best would be done using "ExtJS".

There are few problems with ExtJS. First it's not open source if you wish to use it in commercial apps (dual license is complicated). Second, it does not support Bi-Directional. A college of mine wrote a support for it, but the company are unwilling to include it in their versions.

Show quoted text 5 lines
"ExtPascal" is a way to try ExtJS with Lazarus and shows how to generate "dual-mode" controls that can be used in the IDE at design time and in a client-server way at runtime.

Third, ExtPascal is very limited, it supports only specific components and the last time I tried it (don't remember how long ago), it did not worked for me in 64 bit (don't know if it support it now).

I do not want to reinvent the wheel, but I'm looking for something that in one IFDEF or class inheritance can change my app from "desktop" app to web app, it's not simple or easy task to do though, and if you wish to do it on client side, it's even harder ...

Show quoted text 11 lines
To make up for a decent Widget Type, "Comet" technology would be needed to be used for allowing for having server generated events introduce visual changes at the client site. Of course TTimer and an Inter Thread event Queue would be needed to be implemented within the new Widget Type (for Linux use similar as in the FPGUI Widget Type or as in MSEGUI). -Michael

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/cfd27db4/attachment.html>

Reply by email

Unknown author
to ik
ik wrote 22 lines
On Wed, Nov 24, 2010 at 12:26, Michael Schnell wrote: > On 11/24/2010 08:32 AM, ik wrote: > >> Hello List, >> >> Well I know about the framework fur Javascript library in Lazarus, but I'm >> thinking in the past year or so, what will it take to design a gui >> application using Lazarus, and make it work like a web app that act the same >> as the desktop version, without any specific components for it. >> > > A decent way to do this would be creating an appropriate "Widget Type" > Interface (See "How to tell lazarus the location of a used package" in this > forum). > > I did some research on that some months ago. I found that this supposedly > best would be done using "ExtJS". > There are few problems with ExtJS. First it's not open source if you wish to use it in commercial apps (dual license is complicated).

What is the problem with buying a license if you make a commercial product ?

Second, it does not support Bi-Directional. A college of mine wrote a support for it, but the company are unwilling to include it in their versions.

The remarks you make are correct, but I know of no better toolkit.

Michael.

Reply by email

ik
to Unknown author
Show quoted text 35 lines
On Wed, 24 Nov 2010, ik wrote: On Wed, Nov 24, 2010 at 12:26, Michael Schnell > wrote: > > On 11/24/2010 08:32 AM, ik wrote: >> >> Hello List, >>> >>> Well I know about the framework fur Javascript library in Lazarus, but >>> I'm >>> thinking in the past year or so, what will it take to design a gui >>> application using Lazarus, and make it work like a web app that act the >>> same >>> as the desktop version, without any specific components for it. >>> >>> >> A decent way to do this would be creating an appropriate "Widget Type" >> Interface (See "How to tell lazarus the location of a used package" in >> this >> forum). >> >> I did some research on that some months ago. I found that this supposedly >> best would be done using "ExtJS". >> >> > There are few problems with ExtJS. First it's not open source if you wish > to > use it in commercial apps (dual license is complicated). > What is the problem with buying a license if you make a commercial product ?

There are a lot of issues with it. Let's take MySQL for example, If you connect to it in a commercial app, then you require to buy a commercial license, but if you release the connection code it's GPL, however if you are using Connector/J or ConnectorC, you do not have to, and so does with PHP. Now If I use the FPC connection code (it's open source and available for all), do I require to release my code that works with MySQL or not ? I really do not know the answer here...

Now if I build a web app for my clients and they have the source code, do I require to buy a commercial license of ExtJS ?
If I use some sort of "binding" for the code of ExtJS, that is my own API for the their code and release it in OpenSource, does a commercial web app that uses it, should buy a commercial license ?

It's not that simple as it sounds, and hence, it complicate everything, there are many scenarios that are not that simple to understand what you should do (in open source, and in commercial, so when it's dual license, it's even harder).

Show quoted text 18 lines
Second, it does not support Bi-Directional. A college of mine wrote a > support for it, but the company are unwilling to include it in their > versions. > The remarks you make are correct, but I know of no better toolkit. Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/d6146843/attachment.html>

Reply by email

Unknown author
to ik
ik wrote 25 lines
On Wed, Nov 24, 2010 at 12:46, wrote: >>> I did some research on that some months ago. I found that this supposedly >>> best would be done using "ExtJS". >>> >>> >> There are few problems with ExtJS. First it's not open source if you wish >> to >> use it in commercial apps (dual license is complicated). >> > > What is the problem with buying a license if you make a commercial product > ? There are a lot of issues with it. Let's take MySQL for example, If you connect to it in a commercial app, then you require to buy a commercial license, but if you release the connection code it's GPL, however if you are using Connector/J or ConnectorC, you do not have to, and so does with PHP. Now If I use the FPC connection code (it's open source and available for all), do I require to release my code that works with MySQL or not ? I really do not know the answer here... Now if I build a web app for my clients and they have the source code, do I require to buy a commercial license of ExtJS ?

Yes, because you make money on it, it is not open source.

If I use some sort of "binding" for the code of ExtJS, that is my own API for the their code and release it in OpenSource, does a commercial web app that uses it, should buy a commercial license ?

Yes, because they use ExtJS.

Show quoted text 5 lines
It's not that simple as it sounds, and hence, it complicate everything, there are many scenarios that are not that simple to understand what you should do (in open source, and in commercial, so when it's dual license, it's even harder).

I agree that dual-license is tricky, but that has never stopped me from using a toolkit, if it is good.

MySQL I simply don't use because it is a bad database engine :-)

Michael.

Reply by email

Michael Schnell
to Unknown author: This, I agree with. In my experience, ExtJS is the best available toolkit for the browser.
I tried making moderatly complicated production applications with it. It cannot be done without redesigning ExtPascal from the ground up.

Same here, That is why I only recommended it as a way to try out ExtJS.

Show quoted text 5 lines
Comet is a rickety technology. Not robust at all, and creates more problems than it solves. You can use polling, but that's just plain HTTP, not even worth of putting a name on it.

I suppose a problem of Comet's is that it needs cooperation of the web server, allowing for an appropriate number of simultaneous "hanging" requests. In fact the necessity of using such questionable technology as a workaround for the missing server event transport is a design flow of the abysmal http protocol which never was intended for but needs to be abused for this kind of applications due to the incompetence of most IT departments that are not able to decently configure the firewalls.

I wonder what technology Silverlight/Moonlight uses for this purpose. Could this be a hint for an upcoming "HTML" Widget Type ?

> Of course TTimer and an Inter Thread event Queue would be needed to > be implemented within the new Widget Type (for Linux use similar as > in the FPGUI Widget Type or as in MSEGUI). Hehe, I was waiting for you to bring this one up. Never fails :-)

__Of course__. It can't be repeated often enough :-[ ;-) Maybe some day it helps....

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101124/d5441970/attachment.html>

Reply by email

Michael Schnell
to Henry Vermaak
Henry Vermaak wrote
Maybe the day you send the patches?

Unfortunately after some initial experiments I'm not working actively on this any more.

Of course I'll try to help whenever someone starts decent work on this issue.

-Michael

Reply by email

Unknown author
to Michael Schnell: Same here, That is why I only recommended it as a way to try out ExtJS. I suppose a…
Michael Schnell wrote 13 lines
On 11/24/2010 11:42 AM, wrote: > > > I tried making moderatly complicated production applications with it. It > cannot be done without redesigning ExtPascal from the ground up. Same here, That is why I only recommended it as a way to try out ExtJS. > > Comet is a rickety technology. Not robust at all, and creates more problems > than it solves. You can use polling, but that's just plain HTTP, not even > worth of putting a name on it. I suppose a problem of Comet's is that it needs cooperation of the web server, allowing for an appropriate number of simultaneous "hanging" requests.

Not only that, but also switches, routers, firewalls and proxies.

Show quoted text 5 lines
In fact the necessity of using such questionable technology as a workaround for the missing server event transport is a design flow of the abysmal http protocol which never was intended for but needs to be abused for this kind of applications due to the incompetence of most IT departments that are not able to decently configure the firewalls.

I think any technology which relies on a persistent connection is bound to fail. Not because the concept is inherently bad, but because in practice, a connection is rarely persistent.

We've had this discussion before.

I wonder what technology Silverlight/Moonlight uses for this purpose. Could this be a hint for an upcoming "HTML" Widget Type ?

I doubt that any technology which relies on browser plugins will make it. HTTP/Html/Javascript are the only reliable standards (and even then) worth working on.

All the rest is risky and thus - in my book - not even worth considering. (not to mention the vendor lock-in they cause).

Michael.

Reply by email

Michael Schnell
to Michael Schnell: Unfortunately after some initial experiments I'm not working actively on this any more.…

To who is interested:

I tried to create a "LinuxIFI" Widget Type by stripping off the KDE binding from the KDE2 Widget Type (when starting today I supposedly would use FPGUI instead) and replace the Widget bindings by calls to would-be transporter functions.

I even got at a presentable point: In a test project, a TForm instance was created and "OnFormShow" was called asynchronously (via the Event Queue, as it should be). (IIRC)

When trying to implement additional controls (e.g. TLable) I failed to find out the necessary details of the very complex internal makup of the Widget Type code. But I was happy anyway, as I head a "proof of concept" and the IFI concept _could_ be ported to Lazarus.

Later, due to the availability of cheap memory, we decided not to use very small hardware for our embedded projects, but allow for an implementation of X and perhaps even QT or KDE. So we did not have any need for a Widget type based remote GUI. This is why I stopped working on it.

For this dedicated project I would have implemented a new "stand alone" Widget Type. But for enhancing Lazarus I feel that this is not "professional" enough, but If I would be in charge (which I don't feel I am) I would vote for a reconstruction of all widget sets to be built in a decent hierarchy. So I feel that the code I created on this behalf is not a decent way to go and am not inclined to try to create a "patch" from it. If someone wants to see it, I of course will send it to him (just to make him frown and giggle).

-Michael

Reply by email

Lee Jenkins
to Unknown author: You should first answer the question this man asks: "Now, I want to know, Is this useful?"
Show quoted text 40 lines
On Wed, 24 Nov 2010, ik wrote: > Hello List, > > Well I know about the framework fur Javascript library in Lazarus, but I'm > thinking in the past year or so, what will it take to design a gui > application using Lazarus, and make it work like a web app that act the same > as the desktop version, without any specific components for it. > > Then today I found the following link: > http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like > someone made something like that on GTK3. > The problem is that I do not have the time to do it myself (or I would have > created at least the start for it), what will it take to create something > like that for Lazarus that is not dependent on the widgets (it will not care > if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it ? You should first answer the question this man asks: "Now, I want to know, Is this useful?" The answer IMHO is: no. Each and every GUI or user action/change/whatnot will result in a request from the browser to the webserver (with corresponding result sent back), and will cause a lot of traffic. While this is fine and doable for small apps, it is not 100 users use your system, it will crash under the load (if not earlier). More to the point would be the morfik approach: - Design and code your app as you do now. - Translate the lot to Javascript+HTML+CSS Because then, the browser does all the GUI work, and only when necessary (get data from server or store data on server) does the server get a request. I am building all blocks for the latter approach, but it is slow progress.

I started a framework like that in question, actually had a decent working prototype that used Adob Flex as the front end. The problem is as you explained in that there is a tremendous amount of traffic for all of that user I/O that must be tracked for every click, etc.

My customer got spooked when Apple decided not support Flash and later disallowing non-native apps (since retracted?) and we opted for a different direction using lazarus/fpc on the server providing a remote data Model and left it up to the client (in this case HTML5) to create and implement its own Controller and View. In our case, we created the client web app with dojo. This was a much better solution in the end.

Warm Regards, Lee

Reply by email

Unknown author
to Lee Jenkins
Lee Jenkins wrote 61 lines
On 11/24/2010 4:21 AM, wrote: > > > On Wed, 24 Nov 2010, ik wrote: > >> Hello List, >> >> Well I know about the framework fur Javascript library in Lazarus, but I'm >> thinking in the past year or so, what will it take to design a gui >> application using Lazarus, and make it work like a web app that act the >> same >> as the desktop version, without any specific components for it. >> >> Then today I found the following link: >> http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like >> someone made something like that on GTK3. >> The problem is that I do not have the time to do it myself (or I would >> have >> created at least the start for it), what will it take to create something >> like that for Lazarus that is not dependent on the widgets (it will not >> care >> if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it >> ? > > You should first answer the question this man asks: > > "Now, I want to know, Is this useful?" > > The answer IMHO is: no. > > Each and every GUI or user action/change/whatnot will result in a request > from > the browser to the webserver (with corresponding result sent back), and > will > cause a lot of traffic. > > While this is fine and doable for small apps, it is not > 100 > users use your system, it will crash under the load (if not earlier). > > More to the point would be the morfik approach: > - Design and code your app as you do now. > - Translate the lot to Javascript+HTML+CSS > Because then, the browser does all the GUI work, and only when necessary > (get > data from server or store data on server) does the server get a request. > > I am building all blocks for the latter approach, but it is slow progress. > I started a framework like that in question, actually had a decent working prototype that used Adob Flex as the front end. The problem is as you explained in that there is a tremendous amount of traffic for all of that user I/O that must be tracked for every click, etc. My customer got spooked when Apple decided not support Flash and later disallowing non-native apps (since retracted?) and we opted for a different direction using lazarus/fpc on the server providing a remote data Model and left it up to the client (in this case HTML5) to create and implement its own Controller and View. In our case, we created the client web app with dojo. This was a much better solution in the end.

My view exactly. But using ExtJS in my case. But that is irrelevant :)

The main point now is to generate
- HTML/CSS from the form definition.
- JavaScript from the pascal event code.
So I can continue to code in Lazarus/FPC.

Michael.

Reply by email

Marcos Douglas
to Lee Jenkins: I started a framework like that in question, actually had a decent working prototype that…
Lee Jenkins wrote 12 lines
I started a framework like that in question, actually had a decent working prototype that used Adob Flex as the front end. ?The problem is as you explained in that there is a tremendous amount of traffic for all of that user I/O that must be tracked for every click, etc. My customer got spooked when Apple decided not support Flash and later disallowing non-native apps (since retracted?) and we opted for a different direction using lazarus/fpc on the server providing a remote data Model and left it up to the client (in this case HTML5) to create and implement its own Controller and View. ?In our case, we created the client web app with dojo. This was a much better solution in the end.

And do you use fpWeb?

Marcos Douglas

Reply by email

Dariusz Mazur
to Unknown author: You should first answer the question this man asks: "Now, I want to know, Is this useful?"

W dniu 2010-11-24 10:21, pisze:

Show quoted text 38 lines
On Wed, 24 Nov 2010, ik wrote: > Hello List, > > Well I know about the framework fur Javascript library in Lazarus, > but I'm > thinking in the past year or so, what will it take to design a gui > application using Lazarus, and make it work like a web app that act > the same > as the desktop version, without any specific components for it. > > Then today I found the following link: > http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like > someone made something like that on GTK3. > The problem is that I do not have the time to do it myself (or I > would have > created at least the start for it), what will it take to create > something > like that for Lazarus that is not dependent on the widgets (it will > not care > if it's GTK, Qt, WinAPI etc..), and take also 3rd party components > for it ? You should first answer the question this man asks: "Now, I want to know, Is this useful?" The answer IMHO is: no. Each and every GUI or user action/change/whatnot will result in a request from the browser to the webserver (with corresponding result sent back), and will cause a lot of traffic. While this is fine and doable for small apps, it is not scalable at all. If 100 users use your system, it will crash under the load (if not earlier).

That's not true. Transfer every action to server is very simple task, and computing results also. Thus (on my web app) it took less than 10ms and every user very rare generate more actions than 1 per second. Computing and sending pdf reports took much more (more than 90% of working time). As I observe two on core machine can work 100 users concurent without problem. With more can be problem, but with memory.

More to the point would be the morfik approach: - Design and code your app as you do now.

yes. I compile the same code for Web and desktop

- Translate the lot to Javascript+HTML+CSS

nothing translate
every widget on form generate string consists several <div> and other html tokens
JS consists behaviour of widgets and communication API (rather consts) CSS describe look of widgets

Show quoted text 6 lines
Because then, the browser does all the GUI work, and only when necessary (get data from server or store data on server) does the server get a request. I am building all blocks for the latter approach, but it is slow progress.

My clients use it every day. Web has about 95% of usability of desktop. Today I prefer web approach, because its easy to make something beautiful (with CSS3 only several lines and widget get shadow, background , animations etc.

Darek

Reply by email

Dariusz Mazur
to Felipe Monteiro de Carvalho: 2010/11/24 ik : But the HTML5 Canvas is only programmable in Javascript. How would you…
Show quoted text 6 lines
2010/11/24 ik: > SilverLight/Moonlight are the wrong way to do things (so does Flash). HTML5 > provide in the DOM support for Canvas (you have some games for it), And IE9, > Webkit, Opera and Gecko support it, so it's like 99% of web browsers that > support for it. But the HTML5 Canvas is only programmable in Javascript.

You can generate script on server, send it via AJAX to browser and execute

Darek

Reply by email

Dimitri Smits
to Unknown author: Yes, because you make money on it, it is not open source. Yes, because they use ExtJS. I…
----- "michael vancanneyt" wrote
> Now if I build a web app for my clients and they have the source code, do I > require to buy a commercial license of ExtJS ? Yes, because you make money on it, it is not open source.

Michael, that is a fallacy. It is not because it is open source, that it should be free-as-in-beer, aka gratis. You can perfectly comply to the GPL by giving your paying customer the code of the (custom made?) product. Some licences allow you to do whatever you want with the code of the library/tool/component, others require that you give back to the community and others just want to make sure that the end-user has every freedom they choose as the want with the endresult. It sometimes is practical (hi Graeme) to give back to the community your fixes/changes so that you do not need to maintain an own branch for fixes after every release of the oss.

Likewise it is most of the time impractical to make a mass-product based on oss (more specifically GPL variants) due to the fact that the end-user has the source (and all your IP secrets are in the open).

but if it is tailormade software for a client or an internal project? why not? (you probably need to give them the sourcecode of the work you needed to do anyway)

you charge them for the software (+source) you build AROUND the OSS library/tool/component.

just to say that OSS=gratis is just plain wrong!

I agree that dual-license is tricky, but that has never stopped me from using a toolkit, if it is good.

I couldn't agree more on that part. Especially in a commercial environment. Weigh your expenses: what can I gain in productivity/simplifications and with respect to my margin: how much would it cost me if I had to do that part myself vs the cost (licence/operational/...) of the toolkit. (commercial environment is no place to start ripping/pirating)

MySQL I simply don't use because it is a bad database engine :-)

actually that should be: I simply don't use MySQL because they are bad database engineS. :-) (pluggable architecture, cfr MYISAM, INNODB, Google's MySQL DB engine, Facebook's DB and the likes)

kind regards,
Dimitri Smits

Reply by email

Unknown author
to Dariusz Mazur: W dniu 2010-11-24 10:21, pisze: That's not true. Transfer every action to server is very…
Dariusz Mazur wrote 43 lines
W dniu 2010-11-24 10:21, pisze: > > > On Wed, 24 Nov 2010, ik wrote: > >> Hello List, >> >> Well I know about the framework fur Javascript library in Lazarus, but I'm >> thinking in the past year or so, what will it take to design a gui >> application using Lazarus, and make it work like a web app that act the >> same >> as the desktop version, without any specific components for it. >> >> Then today I found the following link: >> http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like >> someone made something like that on GTK3. >> The problem is that I do not have the time to do it myself (or I would >> have >> created at least the start for it), what will it take to create something >> like that for Lazarus that is not dependent on the widgets (it will not >> care >> if it's GTK, Qt, WinAPI etc..), and take also 3rd party components for it >> ? > > You should first answer the question this man asks: > > "Now, I want to know, Is this useful?" > > The answer IMHO is: no. > > Each and every GUI or user action/change/whatnot will result in a request > from the browser to the webserver (with corresponding result sent back), > and will cause a lot of traffic. > > While this is fine and doable for small apps, it is not > 100 users use your system, it will crash under the load (if not earlier). That's not true. Transfer every action to server is very simple task, and computing results also. Thus (on my web app) it took less than 10ms and every user very rare generate more actions than 1 per second. Computing and sending pdf reports took much more (more than 90% of working time). As I observe two on core machine can work 100 users concurent without problem. With more can be problem, but with memory.

Yes, I remember my discussion with you. I also remember that the round trip time I observed is over 100 ms, which is noticeable. (maybe not on intranet, but definitely on internet)

Secondly, you have not very demanding users and/or GUI, it seems :-) I'll describe an interface which I currently have: A grid with about 600 checkboxes (don't ask why, they want it so). Users click the checkboxes in rapid succession, thus generating much more than 1 event per second.

But if you believe in it: why not cooperate with the Lazarus team and create a web widget set ? All options must be explored, you obviously have a good basis for it, so why not share it ?

Michael.

Reply by email

Unknown author
to Dimitri Smits: Michael, that is a fallacy. It is not because it is open source, that it should be…
Dimitri Smits wrote 10 lines
----- "michael vancanneyt" schreef: >> Now if I build a web app for my clients and they have the source code, do I >> require to buy a commercial license of ExtJS ? > > Yes, because you make money on it, it is not open source. Michael, that is a fallacy.

My apologies. You are right, I was taking a shortcut there :-)

I don't believe in copyrights/patents either way,
so I am not a very reliable source in such discussions :)

Michael.

Reply by email

Lee Jenkins
to Marcos Douglas: And do you use fpWeb? Marcos Douglas
Marcos Douglas wrote 18 lines
On Wed, Nov 24, 2010 at 10:40 AM, Lee Jenkins wrote: > > I started a framework like that in question, actually had a decent working > prototype that used Adob Flex as the front end. The problem is as you > explained in that there is a tremendous amount of traffic for all of that > user I/O that must be tracked for every click, etc. > > My customer got spooked when Apple decided not support Flash and later > disallowing non-native apps (since retracted?) and we opted for a different > direction using lazarus/fpc on the server providing a remote data Model and > left it up to the client (in this case HTML5) to create and implement its > own Controller and View. In our case, we created the client web app with > dojo. This was a much better solution in the end. And do you use fpWeb? Marcos Douglas

Yes. Kinda. I have a small server framework patterned much like fpWeb which takes care of most of the server app's logic and plugs into either fpWeb (for lazarus/fpc) or RealThinClient (for Delphi projects) where each of those frameworks, hands the request off to my framework which handles the request. Just to make it easy to switch between the two...

It's easier for debugging too because I can plug it into a small embedded HTTP server without the need for apache, etc.

Warm Regards, Lee

Reply by email

Dariusz Mazur
to Unknown author: Yes, I remember my discussion with you. I also remember that the round trip time I…
Show quoted text 56 lines
On Wed, 24 Nov 2010, Dariusz Mazur wrote: > W dniu 2010-11-24 10:21, pisze: >> >> >> On Wed, 24 Nov 2010, ik wrote: >> >>> Hello List, >>> >>> Well I know about the framework fur Javascript library in Lazarus, >>> but I'm >>> thinking in the past year or so, what will it take to design a gui >>> application using Lazarus, and make it work like a web app that act >>> the same >>> as the desktop version, without any specific components for it. >>> >>> Then today I found the following link: >>> http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks >>> like >>> someone made something like that on GTK3. >>> The problem is that I do not have the time to do it myself (or I >>> would have >>> created at least the start for it), what will it take to create >>> something >>> like that for Lazarus that is not dependent on the widgets (it will >>> not care >>> if it's GTK, Qt, WinAPI etc..), and take also 3rd party components >>> for it ? >> >> You should first answer the question this man asks: >> >> "Now, I want to know, Is this useful?" >> >> The answer IMHO is: no. >> >> Each and every GUI or user action/change/whatnot will result in a >> request from the browser to the webserver (with corresponding result >> sent back), and will cause a lot of traffic. >> >> While this is fine and doable for small apps, it is not scalable at >> all. If 100 users use your system, it will crash under the load (if >> not earlier). > > That's not true. Transfer every action to server is very simple task, > and computing results also. Thus (on my web app) it took less than > 10ms and every user very rare generate more actions than 1 per > second. Computing and sending pdf reports took much more (more than > 90% of working time). As I observe two on core machine can work 100 > users concurent without problem. With more can be problem, but with > memory. Yes, I remember my discussion with you. I also remember that the round trip time I observed is over 100 ms, which is noticeable. (maybe not on intranet, but definitely on internet)

You told about scalability.
10ms is on server, on user side You should add transfer as ping (but this not load server)

Secondly, you have not very demanding users and/or GUI, it seems :-)

Of course this is not game application, but on every ERP application (like my) are places with rather sophisticated GUI.

I'll describe an interface which I currently have: A grid with about 600 checkboxes (don't ask why, they want it so). Users click the checkboxes in rapid succession, thus generating much more than 1 event per second.

I have forms with similar widgets too. Second: faster than clicks is keyboard. But even that: its no problem when response arrive after next click. If response is under 300ms users thinks : "that is at now"

But if you believe in it: why not cooperate with the Lazarus team and create a web widget set ? All options must be explored, you obviously have a good basis for it, so why not share it

I try to share my work (without this hope I simply not write this post) but nobody is interesting.
link: http://www.emadar.com/fpc/xwebdemo.zip

Darek

Reply by email

ABorka
to Unknown author: Yes, because you make money on it, it is not open source. Yes, because they use ExtJS. I…
Show quoted text 55 lines
On Wed, 24 Nov 2010, ik wrote: > On Wed, Nov 24, 2010 at 12:46, wrote: > >>>> I did some research on that some months ago. I found that this >>>> supposedly >>>> best would be done using "ExtJS". >>>> >>>> >>> There are few problems with ExtJS. First it's not open source if you >>> wish >>> to >>> use it in commercial apps (dual license is complicated). >>> >> >> What is the problem with buying a license if you make a commercial >> product >> ? > > > There are a lot of issues with it. Let's take MySQL for example, If you > connect to it in a commercial app, then you require to buy a commercial > license, but if you release the connection code it's GPL, however if > you are > using Connector/J or ConnectorC, you do not have to, and so does with > PHP. > Now If I use the FPC connection code (it's open source and available for > all), do I require to release my code that works with MySQL or not ? I > really do not know the answer here... > > Now if I build a web app for my clients and they have the source code, > do I > require to buy a commercial license of ExtJS ? Yes, because you make money on it, it is not open source. > If I use some sort of "binding" for the code of ExtJS, that is my own API > for the their code and release it in OpenSource, does a commercial web > app > that uses it, should buy a commercial license ? Yes, because they use ExtJS. > > It's not that simple as it sounds, and hence, it complicate everything, > there are many scenarios that are not that simple to understand what you > should do (in open source, and in commercial, so when it's dual license, > it's even harder). I agree that dual-license is tricky, but that has never stopped me from using a toolkit, if it is good. MySQL I simply don't use because it is a bad database engine :-)

I think you guys are not exactly correct regarding the ExtJS license.

http://lazarus.freepascal.org/index.php/topic,10125.msg52756.html#msg52756

"According to the linked ExtJS licensing FAQ, you have obligations to publish the ExtJS JavaScript code that YOU have modified AND(!) you are distributing it. So, in-house projects are excluded by default, as well as all extensions you have downloaded from the Internet - since those are already published back to the community. As I've noted, I never needed to extend ExtJS so far, always found that someone else did what I needed already.
Either case, it does not affect your FPC/Lazarus project parts."

In my opinion ExtJS is absolutely the best framework to use on the client side GUI within a browser, and Lazarus/FPC 100% supports it right now (0.9.29/2.51). You do not need ExtPascal or any other additional libraries to build superb systems with it.
You do not need to buy ExtJS licenses either.

As for MySQL usage...I do not have any problem with using that either in my web projects (Im using ZEOS library to access the DB). It is still by far the most used and available DB for web apps/web servers.

AB

Reply by email

Michael Van Canneyt
to Dariusz Mazur: You told about scalability. 10ms is on server, on user side You should add transfer as…
Dariusz Mazur wrote 14 lines
>> That's not true. Transfer every action to server is very simple task, and >> computing results also. Thus (on my web app) it took less than 10ms and >> every user very rare generate more actions than 1 per second. Computing >> and sending pdf reports took much more (more than 90% of working time). As >> I observe two on core machine can work 100 users concurent without >> problem. With more can be problem, but with memory. > > Yes, I remember my discussion with you. I also remember that the round trip > time I observed is over 100 ms, which is noticeable. (maybe not on > intranet, but definitely on internet) You told about scalability. 10ms is on server, on user side You should add transfer as ping (but this not load server)

Let me put it differently. In the interface I was talking about, I need exactly 3 HTTP requests, no matter how much the user clicks/hits keyboard to set checks:
1. Fetch form
2. Fetch data.
[grid is built on client using fetched data]
3. Save Data (user presses save buton)

Your implementation needs 3 (maybe 2) requests to fetch form and data and process save, plus additionally a request for each user click/keyboard hit to set a check.

If that is correct, I don't even need to build these 2 systems to know that my system will scale better.

And - unless I understand your code wrong - you keep the complete form state on the server ? (I.e. keep a pascal instance of all visible TForms and controls in memory).

I don't need amount of data I need on the server
per user session is roughly 200 bytes, and it doesn't much change during the session.

Again, if my assumption is correct, my system again scales better, because it does not need nearly the memory your system uses.

Looking at recent trends (Ajax, rich client interface toolkits) people agree more with me than with you. But I may definitely be wrong; everybody sees the world through his own spectacles...

Show quoted text 10 lines
> Secondly, you have not very demanding users and/or GUI, it seems :-) Of course this is not game application, but on every ERP application (like my) are places with rather sophisticated GUI. > I'll describe an interface which I currently have: A grid with about 600 > checkboxes (don't ask why, they want it so). Users click the checkboxes in > rapid succession, thus generating much more than 1 event per second. I have forms with similar widgets too. Second: faster than clicks is keyboard.

Well, most likely not if you must check which key was pressed, discard bad keypresses etc, on the server.

I also proposed keyboard but they require the mouse :(

But even that: its no problem when response arrive after next click. If response is under 300ms users thinks : "that is at now"

On average the user sets 50 checkboxes before he presses save. 50x300ms = 15.000 Ms = 4 minutes just to process the checks ? I don't think so :-)

Show quoted text 7 lines
> But if you believe in it: why not cooperate with the Lazarus team and > create a web widget set ? All options must be explored, you obviously have > a good basis for it, so why not share it I try to share my work (without this hope I simply not write this post) but nobody is interesting. link: http://www.emadar.com/fpc/xwebdemo.zip

I think most people on the Lazarus list simply didn't know about it.

But I hope for you that this will change now, and that people look at it and prove me wrong. And in doing so, hopefully they create a good Lazarus widget set.

That is finally what it is about for me: advancing FPC/Lazarus. I have my idea about how to do this, but if other ideas exist: the more, the better.

Michael.

Reply by email

Michael Van Canneyt
to Lee Jenkins: Yes. Kinda. I have a small server framework patterned much like fpWeb which takes care…
Lee Jenkins wrote 30 lines
On 11/24/2010 8:57 AM, Marcos Douglas wrote: > On Wed, Nov 24, 2010 at 10:40 AM, Lee Jenkins wrote: >> >> I started a framework like that in question, actually had a decent working >> prototype that used Adob Flex as the front end. The problem is as you >> explained in that there is a tremendous amount of traffic for all of that >> user I/O that must be tracked for every click, etc. >> >> My customer got spooked when Apple decided not support Flash and later >> disallowing non-native apps (since retracted?) and we opted for a >> different >> direction using lazarus/fpc on the server providing a remote data Model >> and >> left it up to the client (in this case HTML5) to create and implement its >> own Controller and View. In our case, we created the client web app with >> dojo. This was a much better solution in the end. > > And do you use fpWeb? > > Marcos Douglas > Yes. Kinda. I have a small server framework patterned much like fpWeb which takes care of most of the server app's logic and plugs into either fpWeb (for lazarus/fpc) or RealThinClient (for Delphi projects) where each of those frameworks, hands the request off to my framework which handles the request. Just to make it easy to switch between the two... It's easier for debugging too because I can plug it into a small embedded HTTP server without the need for apache, etc.

Currently we're deploying a webapp that uses fpweb, FastCGI and runs as a windows service app. Although the latter is more of a necessity than a voluntary choice.

The fastcgi approach makes it easy to debug.

Michael.

Reply by email

Marcos Douglas
to Michael Van Canneyt
Michael Van Canneyt wrote 6 lines
Currently we're deploying a webapp that uses fpweb, FastCGI and runs as a windows service app. Although the latter is more of a necessity than a voluntary choice. The fastcgi approach makes it easy to debug.

FastCGI or CGI gateway?

Marcos Douglas

Reply by email

Dariusz Mazur
to Michael Van Canneyt: Let me put it differently. In the interface I was talking about, I need exactly 3 HTTP…

W dniu 2010-11-24 19:06, Michael Van Canneyt pisze:

Show quoted text 30 lines
On Wed, 24 Nov 2010, Dariusz Mazur wrote: >>> That's not true. Transfer every action to server is very simple >>> task, and computing results also. Thus (on my web app) it took less >>> than 10ms and every user very rare generate more actions than 1 per >>> second. Computing and sending pdf reports took much more (more >>> than 90% of working time). As I observe two on core machine can >>> work 100 users concurent without problem. With more can be problem, >>> but with memory. >> >> Yes, I remember my discussion with you. I also remember that the >> round trip time I observed is over 100 ms, which is noticeable. >> (maybe not on intranet, but definitely on internet) > > You told about scalability. > 10ms is on server, on user side You should add transfer as ping (but > this not load server) Let me put it differently. In the interface I was talking about, I need exactly 3 HTTP requests, no matter how much the user clicks/hits keyboard to set checks: 1. Fetch form 2. Fetch data. [grid is built on client using fetched data] 3. Save Data (user presses save buton) Your implementation needs 3 (maybe 2) requests to fetch form and data and process save, plus additionally a request for each user click/keyboard hit to set a check.

1.Fetch form with data
after user action: request what should change: server test its validity, and generate new value for changed widgets on most cases it took only one frame
2.Save button send nothing but number of button

Show quoted text 8 lines
If that is correct, I don't even need to build these 2 systems to know that my system will scale better. And - unless I understand your code wrong - you keep the complete form state on the server ? (I.e. keep a pascal instance of all visible TForms and controls in memory).

yes, then same as in desktop,
but also compute of data, size of "visible" control doesn't matter with it

I don't need amount of data I need on the server per user session is roughly 200 bytes, and it doesn't much change during the session.

In module computing as OLAP I need 10..100MB during session

Again, if my assumption is correct, my system again scales better, because it does not need nearly the memory your system uses.

Of course. I didn;t say not. But many Delphi todays application need involve strong interaction between database and user front end. Very often, after user actions, rather complicated computation on huge amount of data is done, and its transfer to forms.
My approach has better scalability from programmer side: I don;t need thing about browser, what should compute server and what not. Browser paint beautiful widgets (with CSS3,HTML5) similar as OS Windows or GTK, QT. All rest i've done without care which widgets set will be used. That is enough fast to service 100 concurrent user , with higher demand I can use cluster.

Looking at recent trends (Ajax, rich client interface toolkits) people agree more with me than with you. But I may definitely be wrong; everybody sees the world through his own spectacles...

Most of webapp are rather simple (counting forms and controls) compare to desktop app. For example even advanced internet shop has ten times less function than average store or POS application. We talk about choose between fat and thin client. Both have good and bad use case.

Show quoted text 15 lines
>> Secondly, you have not very demanding users and/or GUI, it seems :-) > Of course this is not game application, but on every ERP application > (like my) are places with rather sophisticated GUI. > >> I'll describe an interface which I currently have: A grid with about >> 600 checkboxes (don't ask why, they want it so). Users click the >> checkboxes in rapid succession, thus generating much more than 1 >> event per second. > > I have forms with similar widgets too. Second: faster than clicks is > keyboard. Well, most likely not if you must check which key was pressed, discard bad keypresses etc, on the server.

On ordinary input not, but I use this on dictionary searching thought grid. I simply observe what users do in real.

I also proposed keyboard but they require the mouse :(

This is user choose, not us. Both should work good. Today i thinking about fingers (on iPhone, Android)

Show quoted text 7 lines
> But even that: its no problem when response arrive after next click. > If response is under 300ms users thinks : "that is at now" On average the user sets 50 checkboxes before he presses save. 50x300ms = 15.000 Ms = 4 minutes just to process the checks ? I don't think so :-)

You don understand. This is not sequential but pipelining. Man need 50*100ms (I dont think its so fast) Server need 50*10ms. Browser (and user) don't need wait to response

But different behavior of user: after 10 min and clicking 50 user press RELOAD on browser: whats happens?

Show quoted text 15 lines
>> But if you believe in it: why not cooperate with the Lazarus team and >> create a web widget set ? All options must be explored, you >> obviously have a good basis for it, so why not share it > > I try to share my work (without this hope I simply not write this > post) but nobody is interesting. > link: http://www.emadar.com/fpc/xwebdemo.zip I think most people on the Lazarus list simply didn't know about it. But I hope for you that this will change now, and that people look at it and prove me wrong. And in doing so, hopefully they create a good Lazarus widget set.

I hope so.

Show quoted text 5 lines
That is finally what it is about for me: advancing FPC/Lazarus. I have my idea about how to do this, but if other ideas exist: the more, the better.
Darek

Reply by email

Michael Van Canneyt
to Marcos Douglas: On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt FastCGI or CGI gateway? Marcos…
Marcos Douglas wrote 10 lines
On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt wrote: > > Currently we're deploying a webapp that uses fpweb, FastCGI and runs as a > windows service app. Although the latter is more of a necessity than a > voluntary choice. > > The fastcgi approach makes it easy to debug. FastCGI or CGI gateway?

FastCGI.

But using the gateway shouldn't make any difference: you debug the fastcgi, not the gateway :-)

(for the record, I use module mod_fastcgi, not the mod_fcgid module)

Michael.

Reply by email

Michael Van Canneyt
to Dariusz Mazur: W dniu 2010-11-24 19:06, Michael Van Canneyt pisze: 1.Fetch form with data after user…
Dariusz Mazur wrote 11 lines
> Again, if my assumption is correct, my system again scales better, because > it does not need nearly the memory your system uses. Of course. I didn;t say not. But many Delphi todays application need involve strong interaction between database and user front end. Very often, after user actions, rather complicated computation on huge amount of data is done, and its transfer to forms. My approach has better scalability from programmer side: I don;t need thing about browser, what should compute server and what not. Browser paint beautiful widgets (with CSS3,HTML5) similar as OS Windows or GTK, QT. All rest i've done without care which widgets set will be used.

This I understand 100%, and I hope to get there too.

My desktop app is a 3-tier app. I am used to such a system:
- program server modules for DB-intensive tasks and fast data throughput. (it's a server that listens on a socket).
- program a fat client for user interaction.

This can be done 100% rad.

I simply want to do the same for web
- Server is a webserver with module/fastcgi/whatever
- Fat Client is the browser, and Javascript.
The client is currently not yet 100% RAD, but we'll get there in the end :-)

There are many roads to follow.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Let me put it differently. In the interface I was talking about, I need exactly 3 HTTP…

Op 2010-11-24 20:06, Michael Van Canneyt het geskryf:

That is finally what it is about for me: advancing FPC/Lazarus. I have my idea about how to do this, but if other ideas exist: the more, the better.

Did you every apply the observer/mediator code (from a discussion a few months back) to the RTL?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Unknown author
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
Op 2010-11-24 20:06, Michael Van Canneyt het geskryf: > > That is finally what it is about for me: advancing FPC/Lazarus. > I have my idea about how to do this, but if other ideas exist: > the more, the better. Did you every apply the observer/mediator code (from a discussion a few months back) to the RTL?

Not yet. But it is on my list, no worries.

Michael.

Reply by email

Michael Schnell
to ABorka: I think you guys are not exactly correct regarding the ExtJS license.…
ABorka wrote
"According to the linked ExtJS licensing FAQ, you have obligations to publish the ExtJS JavaScript code that YOU have modified AND(!) you are distributing it.

This seems to mean that just distributing the unmodified ExtJS code is no problem whatsoever. (Moreover JavaScript as an interpreted language is open source by design: you don't distribute but the source code.)

AFAIK, if you use ExtJS in a Lazarus CGI project, you don't modify the ExtJS why does anybody assumes a licensing issue ?

-Michael

Reply by email

ik
to Michael Schnell
Michael Schnell wrote 14 lines
On 11/24/2010 07:00 PM, ABorka wrote: "According to the linked ExtJS licensing FAQ, you have obligations to > publish the ExtJS JavaScript code that YOU have modified AND(!) you are > distributing it. > This seems to mean that just distributing the unmodified ExtJS code is no problem whatsoever. (Moreover JavaScript as an interpreted language is open source by design: you don't distribute but the source code.) AFAIK, if you use ExtJS in a Lazarus CGI project, you don't modify the ExtJS why does anybody assumes a licensing issue ?

http://www.sencha.com/products/license.php

Show quoted text 10 lines
-Michael -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101125/f2da2c0c/attachment.html>

Reply by email

Michael Schnell
to ik
ik wrote

I don't see how the Open source (GPL) license should affect the Pascal code of an application that uses ExtJS (the pascal code same is obviously not "based on / derivative work of" the GPLed Java script code.) and the Java script code effectively used by the application is obviously distributed as source code. And the application is not a "development library" or "Tool Kit".

If a future Lazarus (which supposedly could be considered a "toolkit") would contain an "ExtJS Widget Type" it would need to be distributed without any part of ExtJS itself, and thus the Application developer would need to fetch ExtJS from their Website himself.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101125/a4661eee/attachment.html>

Reply by email

ABorka
to Michael Schnell
Michael Schnell wrote 17 lines
On 11/25/2010 10:29 AM, ik wrote: > > http://www.sencha.com/products/license.php > I don't see how the Open source (GPL) license should affect the Pascal code of an application that uses ExtJS (the pascal code same is obviously not "based on / derivative work of" the GPLed Java script code.) and the Java script code effectively used by the application is obviously distributed as source code. And the application is not a "development library" or "Tool Kit". If a future Lazarus (which supposedly could be considered a "toolkit") would contain an "ExtJS Widget Type" it would need to be distributed without any part of ExtJS itself, and thus the Application developer would need to fetch ExtJS from their Website himself. -Michael

Exactly.
IMO the FreePascal CGI/FCGI/Apache_module is not affected by the ExtJS License.

If you, yourself, make changes to ExtJS and modify/extend it for your project, then that is a different matter. In that case you need to publish your ExtJS modifications (not your FreePascal CGI/FCGI/Apache_module).
However, in my experience this is very very rare, because most modifications needed (custom classes, object modifications, etc.) in ExtJS are already done by someone somewhere and are published. All you need to do is download and use them in your JavaScript code. I always found the needed ExtJS extensions online, never needed to develop them myself (A custom GridView for example, a double click sorting functionality on the GridView header fields, etc.).

Your end user/client can do the same (download and extract ExtJS and the needed extensions) during the installation process, so you are not distributing ExtJS with your application (modified or not).

Of course, a "Powered by ExtJS" link on the bottom of your web pages is a nice-to-have.

AB

Reply by email

ABorka
to Michael Schnell: I don't see how the Open source (GPL) license should affect the Pascal code of an…
Michael Schnell wrote 17 lines
On 11/25/2010 10:29 AM, ik wrote: > > http://www.sencha.com/products/license.php > I don't see how the Open source (GPL) license should affect the Pascal code of an application that uses ExtJS (the pascal code same is obviously not "based on / derivative work of" the GPLed Java script code.) and the Java script code effectively used by the application is obviously distributed as source code. And the application is not a "development library" or "Tool Kit". If a future Lazarus (which supposedly could be considered a "toolkit") would contain an "ExtJS Widget Type" it would need to be distributed without any part of ExtJS itself, and thus the Application developer would need to fetch ExtJS from their Website himself. -Michael

Exactly.
IMO the FreePascal CGI/FCGI/Apache_module is not affected by the ExtJS License.

If you, yourself, make changes to ExtJS and modify/extend it for your project, then that is a different matter. In that case you need to publish your ExtJS modifications (not your FreePascal CGI/FCGI/Apache_module).
However, in my experience this is very very rare, because most modifications needed (custom classes, object modifications, etc.) in ExtJS are already done by someone somewhere and are published. All you need to do is download and use them in your JavaScript code. I always found the needed ExtJS extensions online, never needed to develop them myself (A custom GridView for example, a double click sorting functionality on the GridView header fields, etc.).

Your end user/client can do the same (download and extract ExtJS and the needed extensions) during the installation process, so you are not distributing ExtJS with your application (modified or not).

Of course, a "Powered by ExtJS" link on the bottom of your web pages is a nice-to-have.

AB

Reply by email

Michael Schnell
to ABorka: Exactly. IMO the FreePascal CGI/FCGI/Apache_module is not affected by the ExtJS License.…
ABorka wrote
. I always found the needed ExtJS extensions online, never needed to develop them myself (A custom GridView for example, a double click sorting functionality on the GridView header fields, etc.).

This suggests that doing a n ExtJS Widget Type interface for Lazarus would be a viable thing to do, as all the "outlandish" Java Script code already is in place and ready to be used .). The Lazarus distribution would provide the Pascal code and mention download links to the Java Scripts.

Of course it would be nice, if design-time surrogates for the appropriate controls would be provided, too (similar to how ExtPascal works) (plus server-to-client notification, TTimer and EventQueue ... GDR :-P ).

-Michael

Reply by email

Felipe Monteiro de Carvalho
to Michael Schnell: Did you consider to use Delphi Prism (AFAIK the compiler is free) in a Silverlight /…
Michael Schnell wrote
Did you consider to use Delphi Prism (AFAIK the compiler is free) in a Silverlight / Moonlight based web page ? This might allow for reusing some of the code.

No chance, I'd rather stop programming then using .net

Anyway, porting would be as much work as rewriting the application. Just porting from Win32-Delphi to cross-platform-Lazarus was already a huge work. Moving to a completely different platform then...

Felipe Monteiro de Carvalho

Reply by email

Marcos Douglas
to Michael Van Canneyt: FastCGI. But using the gateway shouldn't make any difference: you debug the fastcgi, not…
Michael Van Canneyt wrote 19 lines
On Wed, 24 Nov 2010, Marcos Douglas wrote: > On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt > wrote: >> >> Currently we're deploying a webapp that uses fpweb, FastCGI and runs as a >> windows service app. Although the latter is more of a necessity than a >> voluntary choice. >> >> The fastcgi approach makes it easy to debug. > > FastCGI or CGI gateway? FastCGI. But using the gateway shouldn't make any difference: you debug the fastcgi, not the gateway :-)

But if you want to update the application you will have to leave the application unavailable.
With CGI gateway you can redirect the flow to another server.

Marcos Douglas

Reply by email

Unknown author
to Marcos Douglas
Marcos Douglas wrote 25 lines
On Wed, Nov 24, 2010 at 4:43 PM, Michael Van Canneyt wrote: > > > On Wed, 24 Nov 2010, Marcos Douglas wrote: > >> On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt >> wrote: >>> >>> Currently we're deploying a webapp that uses fpweb, FastCGI and runs as a >>> windows service app. Although the latter is more of a necessity than a >>> voluntary choice. >>> >>> The fastcgi approach makes it easy to debug. >> >> FastCGI or CGI gateway? > > FastCGI. > > But using the gateway shouldn't make any difference: you debug the fastcgi, > not the gateway :-) But if you want to update the application you will have to leave the application unavailable. With CGI gateway you can redirect the flow to another server.

In my opinion that is pointless and serves no useful purpose except maybe in a few trivial cases.

The reason you use FastCGI is that you can keep things in memory during the session of the user. (DB connection, transactions and possibly complete form states)

By switching to another FastCGI instance, you loose all this session information: you get the same effect as stopping and restarting fastCGI, except maybe a couple of failed requests. It's not worth the overhead IMHO.

Michael.

Reply by email

Marcos Douglas
to Unknown author
Show quoted text 42 lines
On Tue, 30 Nov 2010, Marcos Douglas wrote: > On Wed, Nov 24, 2010 at 4:43 PM, Michael Van Canneyt > wrote: >> >> >> On Wed, 24 Nov 2010, Marcos Douglas wrote: >> >>> On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt >>> wrote: >>>> >>>> Currently we're deploying a webapp that uses fpweb, FastCGI and runs as >>>> a >>>> windows service app. Although the latter is more of a necessity than a >>>> voluntary choice. >>>> >>>> The fastcgi approach makes it easy to debug. >>> >>> FastCGI or CGI gateway? >> >> FastCGI. >> >> But using the gateway shouldn't make any difference: you debug the >> fastcgi, >> not the gateway :-) > > But if you want to update the application you will have to leave the > application unavailable. > With CGI gateway you can redirect the flow to another server. In my opinion that is pointless and serves no useful purpose except maybe in a few trivial cases. The reason you use FastCGI is that you can keep things in memory during the session of the user. (DB connection, transactions and possibly complete form states) By switching to another FastCGI instance, you loose all this session information: you get the same effect as stopping and restarting fastCGI, except maybe a couple of failed requests. It's not worth the overhead IMHO.

You rigth about the overhead...
And why you said: "(for the record, I use module mod_fastcgi, not the mod_fcgid module)"
There are many differences between them?

Thanks,
Marcos Douglas

Reply by email

Michael Schnell
to Felipe Monteiro de Carvalho: No chance, I'd rather stop programming then using .net Anyway, porting would be as much…
Felipe Monteiro de Carvalho wrote
I'd rather stop programming then using .net

:) I'd rather use a Delphi->CIL compiler than Java :)

Anyway, porting would be as much work as rewriting the application.

I suppose not really, but maybe nearly :)

Just porting from Win32-Delphi to cross-platform-Lazarus was already a huge work. Moving to a completely different platform then...

This does not add but is an viable alternative.

-Michael

Reply by email

Unknown author
to Marcos Douglas: You rigth about the overhead... And why you said: "(for the record, I use module…
Marcos Douglas wrote 48 lines
On Tue, Nov 30, 2010 at 10:23 AM, wrote: > > > On Tue, 30 Nov 2010, Marcos Douglas wrote: > >> On Wed, Nov 24, 2010 at 4:43 PM, Michael Van Canneyt >> wrote: >>> >>> >>> On Wed, 24 Nov 2010, Marcos Douglas wrote: >>> >>>> On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt >>>> wrote: >>>>> >>>>> Currently we're deploying a webapp that uses fpweb, FastCGI and runs as >>>>> a >>>>> windows service app. Although the latter is more of a necessity than a >>>>> voluntary choice. >>>>> >>>>> The fastcgi approach makes it easy to debug. >>>> >>>> FastCGI or CGI gateway? >>> >>> FastCGI. >>> >>> But using the gateway shouldn't make any difference: you debug the >>> fastcgi, >>> not the gateway :-) >> >> But if you want to update the application you will have to leave the >> application unavailable. >> With CGI gateway you can redirect the flow to another server. > > In my opinion that is pointless and serves no useful purpose except maybe in > a few trivial cases. > > The reason you use FastCGI is that you can keep things in > memory during the session of the user. (DB connection, transactions and > possibly complete form states) > > By switching to another FastCGI instance, you loose all this session > information: you get the same effect as stopping and restarting fastCGI, > except maybe a couple of failed requests. It's not worth the overhead IMHO. You rigth about the overhead... And why you said: "(for the record, I use module mod_fastcgi, not the mod_fcgid module)" There are many differences between them?

The can do the same thing:
By default, a fastcgi process is started by the webserver, passing it the socket on which it should listen.

But mod_fastcgi additionally allows you to specify that the fastcgi process is already running, and that no process should be started. The process can run on the same or on another machine as the Webserver:

FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 -idle-timeout 30 -flush

This is very convenient, because you can start the fastcgi process in the debugger, just as any normal process. Or, the fastCGI process can be a windows service.

Other than that, the configuration option names are different.

My FastCGI process is running as a windows service.

Michael.

Reply by email

Marcos Douglas
to Unknown author
Show quoted text 72 lines
On Tue, 30 Nov 2010, Marcos Douglas wrote: > On Tue, Nov 30, 2010 at 10:23 AM, ? wrote: >> >> >> On Tue, 30 Nov 2010, Marcos Douglas wrote: >> >>> On Wed, Nov 24, 2010 at 4:43 PM, Michael Van Canneyt >>> wrote: >>>> >>>> >>>> On Wed, 24 Nov 2010, Marcos Douglas wrote: >>>> >>>>> On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt >>>>> wrote: >>>>>> >>>>>> Currently we're deploying a webapp that uses fpweb, FastCGI and runs >>>>>> as >>>>>> a >>>>>> windows service app. Although the latter is more of a necessity than >>>>>> a >>>>>> voluntary choice. >>>>>> >>>>>> The fastcgi approach makes it easy to debug. >>>>> >>>>> FastCGI or CGI gateway? >>>> >>>> FastCGI. >>>> >>>> But using the gateway shouldn't make any difference: you debug the >>>> fastcgi, >>>> not the gateway :-) >>> >>> But if you want to update the application you will have to leave the >>> application unavailable. >>> With CGI gateway you can redirect the flow to another server. >> >> In my opinion that is pointless and serves no useful purpose except maybe >> in >> a few trivial cases. >> >> The reason you use FastCGI is that you can keep things in >> memory during the session of the user. (DB connection, transactions and >> possibly complete form states) >> >> By switching to another FastCGI instance, you loose all this session >> information: you get the same effect as stopping and restarting fastCGI, >> except maybe a couple of failed requests. It's not worth the overhead >> IMHO. > > You rigth about the overhead... > And why you said: "(for the record, I use module mod_fastcgi, not the > mod_fcgid module)" > There are many differences between them? The can do the same thing: By default, a fastcgi process is started by the webserver, passing it the socket on which it should listen. But mod_fastcgi additionally allows you to specify that the fastcgi process is already running, and that no process should be started. The process can run on the same or on another machine as the Webserver: ?FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 -idle-timeout 30 -flush This is very convenient, because you can start the fastcgi process in the debugger, just as any normal process. Or, the fastCGI process can be a windows service.

Very interesting. I didn't know about it.

Other than that, the configuration option names are different. My FastCGI process is running as a windows service.

Hum... now I'm curious: why Windows?
This interests me greatly because my servers are Windows.

Marcos Douglas

Reply by email

Marcos Douglas
to Marcos Douglas
Marcos Douglas wrote 83 lines
On Tue, Nov 30, 2010 at 10:52 AM, ? wrote: > > > On Tue, 30 Nov 2010, Marcos Douglas wrote: > >> On Tue, Nov 30, 2010 at 10:23 AM, ? wrote: >>> >>> >>> On Tue, 30 Nov 2010, Marcos Douglas wrote: >>> >>>> On Wed, Nov 24, 2010 at 4:43 PM, Michael Van Canneyt >>>> wrote: >>>>> >>>>> >>>>> On Wed, 24 Nov 2010, Marcos Douglas wrote: >>>>> >>>>>> On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt >>>>>> wrote: >>>>>>> >>>>>>> Currently we're deploying a webapp that uses fpweb, FastCGI and runs >>>>>>> as >>>>>>> a >>>>>>> windows service app. Although the latter is more of a necessity than >>>>>>> a >>>>>>> voluntary choice. >>>>>>> >>>>>>> The fastcgi approach makes it easy to debug. >>>>>> >>>>>> FastCGI or CGI gateway? >>>>> >>>>> FastCGI. >>>>> >>>>> But using the gateway shouldn't make any difference: you debug the >>>>> fastcgi, >>>>> not the gateway :-) >>>> >>>> But if you want to update the application you will have to leave the >>>> application unavailable. >>>> With CGI gateway you can redirect the flow to another server. >>> >>> In my opinion that is pointless and serves no useful purpose except maybe >>> in >>> a few trivial cases. >>> >>> The reason you use FastCGI is that you can keep things in >>> memory during the session of the user. (DB connection, transactions and >>> possibly complete form states) >>> >>> By switching to another FastCGI instance, you loose all this session >>> information: you get the same effect as stopping and restarting fastCGI, >>> except maybe a couple of failed requests. It's not worth the overhead >>> IMHO. >> >> You rigth about the overhead... >> And why you said: "(for the record, I use module mod_fastcgi, not the >> mod_fcgid module)" >> There are many differences between them? > > The can do the same thing: > By default, a fastcgi process is started by the webserver, passing it the > socket on which it should listen. > > But mod_fastcgi additionally allows you to specify that the fastcgi process > is > already running, and that no process should be started. The process can run > on the same or on another machine as the Webserver: > > ?FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 > -idle-timeout 30 -flush > > This is very convenient, because you can start the fastcgi process in the > debugger, just as any normal process. Or, the fastCGI process can be a > windows service. Very interesting. I didn't know about it. > Other than that, the configuration option names are different. > > My FastCGI process is running as a windows service. Hum... now I'm curious: why Windows? This interests me greatly because my servers are Windows.

In others words, I thought all yours Web servers were on Linux. All features of fpWeb-FastCGI works fine in Linux and Windows?

Marcos Douglas

Reply by email

Unknown author
to Marcos Douglas
Marcos Douglas wrote 16 lines
>> This is very convenient, because you can start the fastcgi process in the >> debugger, just as any normal process. Or, the fastCGI process can be a >> windows service. > > Very interesting. I didn't know about it. > > >> Other than that, the configuration option names are different. >> >> My FastCGI process is running as a windows service. > > Hum... now I'm curious: why Windows? > This interests me greatly because my servers are Windows. In others words, I thought all yours Web servers were on Linux. All features of fpWeb-FastCGI works fine in Linux and Windows?

Yes, 100%.

I work on Linux, but the clients usually use Windows, so our apps are deployed on Windows.

The last step before creating the installer is to recompile the application on windows.

Michael.

Reply by email

waldo kitty
to Felipe Monteiro de Carvalho: No chance, I'd rather stop programming then using .net Anyway, porting would be as much…
Felipe Monteiro de Carvalho wrote 6 lines
On Wed, Nov 24, 2010 at 11:13 AM, Michael Schnell wrote: > Did you consider to use Delphi Prism (AFAIK the compiler is free) in a > Silverlight / Moonlight based web page ? This might allow for reusing some > of the code. No chance, I'd rather stop programming then using .net

+100000000000000000000000~

;)

Reply by email

Michael Schnell
to waldo kitty
waldo kitty wrote
> No chance, I'd rather stop programming then using .net +100000000000000000000000~

Why exactly would you prefer Java over CIL Pascal ?

(This of course should rather be handled in the "other" list...)

-Michael

Reply by email

waldo kitty
to Michael Schnell
Michael Schnell wrote
On 12/01/2010 12:58 AM, waldo kitty wrote: >> No chance, I'd rather stop programming then using .net > +100000000000000000000000~ Why exactly would you prefer Java over CIL Pascal ?

i'm not saying that... i'm saying that if i had to code in .net, that i would quite coding... is that not what the first quote says?

(This of course should rather be handled in the "other" list...)

i don't carry that list...

Reply by email

Michael Schnell
to waldo kitty: i'm not saying that... i'm saying that if i had to code in .net, that i would quite…
waldo kitty wrote
i'm not saying that... i'm saying that if i had to code in .net, that i would quite coding... is that not what the first quote says?

There are things that can't be done by most traditional programming frameworks but can be done by using either Java or CIL (or to a certain extend: Basic, Python, Perl, ... but only Java and CIL offer "close to native" performance) framework (no-recompile CPU and OS independence, run in a Browser, ...). As we are in a Pascal oriented list, here, only CIL-Pascal is relevant.

-Michael

Reply by email

Vincent Snijders
to Michael Schnell

2010/12/1 Michael Schnell :

a Browser, ...). As we are in a Pascal oriented list, here, only CIL-Pascal is relevant.

Actually this is a Lazarus list, so until FPC support CIL-pascal, CIL-pascal is irrelevant here.

Vincent

Reply by email

Michael Van Canneyt
to Michael Schnell: AFAIK, fastCGI can use as well a TCP/IP socket as a pipe to do the communication between…
Michael Schnell wrote 7 lines
On 11/30/2010 02:52 PM, wrote: > FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 > -idle-timeout 30 -flush > AFAIK, fastCGI can use as well a TCP/IP socket as a pipe to do the communication between the WebServer and the CGI program (not really a big difference regarding the program API).

Well, the TCP/IP port is passed to the FastCGI on standard input (using a pipe) when it is started. All the other traffic is per TCP/IP. but as you say, it does not matter from the Program API point of view, it's a matter of configuration.

Michael.

Reply by email

Joost van der Sluis
to Unknown author: The can do the same thing: By default, a fastcgi process is started by the webserver,…
Show quoted text 55 lines
On Tue, 30 Nov 2010, Marcos Douglas wrote: > On Tue, Nov 30, 2010 at 10:23 AM, wrote: >> >> >> On Tue, 30 Nov 2010, Marcos Douglas wrote: >> >>> On Wed, Nov 24, 2010 at 4:43 PM, Michael Van Canneyt >>> wrote: >>>> >>>> >>>> On Wed, 24 Nov 2010, Marcos Douglas wrote: >>>> >>>>> On Wed, Nov 24, 2010 at 3:09 PM, Michael Van Canneyt >>>>> wrote: >>>>>> >>>>>> Currently we're deploying a webapp that uses fpweb, FastCGI and runs as >>>>>> a >>>>>> windows service app. Although the latter is more of a necessity than a >>>>>> voluntary choice. >>>>>> >>>>>> The fastcgi approach makes it easy to debug. >>>>> >>>>> FastCGI or CGI gateway? >>>> >>>> FastCGI. >>>> >>>> But using the gateway shouldn't make any difference: you debug the >>>> fastcgi, >>>> not the gateway :-) >>> >>> But if you want to update the application you will have to leave the >>> application unavailable. >>> With CGI gateway you can redirect the flow to another server. >> >> In my opinion that is pointless and serves no useful purpose except maybe in >> a few trivial cases. >> >> The reason you use FastCGI is that you can keep things in >> memory during the session of the user. (DB connection, transactions and >> possibly complete form states) >> >> By switching to another FastCGI instance, you loose all this session >> information: you get the same effect as stopping and restarting fastCGI, >> except maybe a couple of failed requests. It's not worth the overhead IMHO. > > You rigth about the overhead... > And why you said: "(for the record, I use module mod_fastcgi, not the > mod_fcgid module)" > There are many differences between them? The can do the same thing: By default, a fastcgi process is started by the webserver, passing it the socket on which it should listen.

Most imporant difference is that mod_fastcgi is deprecated and doesn't follow the FastCGI standard.

But mod_fastcgi additionally allows you to specify that the fastcgi process is already running, and that no process should be started. The process can run on the same or on another machine as the Webserver:

What you described here is the FastCGI standard. This way the webserver can scale up the amount of connections for each instance of the cgi-process.

FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 -idle-timeout 30 -flush

You can configure mod_fcgid also this way, if you want. (Except for debugging, I woudn't know why you would do that. And I use the embedded webserver for debugging)

This is very convenient, because you can start the fastcgi process in the debugger, just as any normal process. Or, the fastCGI process can be a windows service.

Hmm.. windows service could be an idea. But that scales not that easy, offcourse.

Other than that, the configuration option names are different. My FastCGI process is running as a windows service.

What is exactly the reason for this? Isn't it much easier when the webserver starts (and stops, when it is not used) the cgi-application, than doing this in a Windows service?

Joost.

Reply by email

Michael Schnell
to Joost van der Sluis
Joost van der Sluis wrote
> My FastCGI process is running as a windows service. What is exactly the reason for this? Isn't it much easier when the webserver starts (and stops, when it is not used) the cgi-application, than doing this in a Windows service?

As creating process is a time consuming effort in Windows, fast-cgi-ing already running processes would offer a lot faster response.

OTOH, If doing Windows, Microsoft of course wants you to use IIS. Microsoft IIS provides the ISAPI interface between the webserver and the cgi program, that in this case is neither a program nor a service, but a DLL. ISAPI offers similar features like FGCI but in a Windows-centric way.

A colleague of mine (using Delphi) did a quite complex application based on ISAP. it's running just fine for a lot of customers.

In fact he did an ISAPI "proxy" DLL, that communicates with a service (or program). This way debugging is a lot easier than directly debugging the ISAPI DLL.

-Michael

Reply by email

Joost van der Sluis
to Michael Schnell
Michael Schnell wrote 7 lines
On 12/01/2010 02:16 PM, Joost van der Sluis wrote: >> My FastCGI process is running as a windows service. > What is exactly the reason for this? Isn't it much easier when the > webserver starts (and stops, when it is not used) the cgi-application, > than doing this in a Windows service? As creating process is a time consuming effort in Windows, fast-cgi-ing already running processes would offer a lot faster response.

You understood me wrong. These are FastCGI-processes. Only they are managed by the webserver. You can, for example, specify that the FastCGI process should be shutdown after 15 minutes idle-time. And then it will start the process on the first request. It can also decide to run more instances, when there are a lot of requests..

Joost.

Reply by email

Unknown author
to Joost van der Sluis: Most imporant difference is that mod_fastcgi is deprecated and doesn't follow the FastCGI…
Joost van der Sluis wrote 7 lines
> > The can do the same thing: > By default, a fastcgi process is started by the webserver, passing it the > socket on which it should listen. Most imporant difference is that mod_fastcgi is deprecated and doesn't follow the FastCGI standard.

In what way doesn't it follow the FastCGI standard ?

Show quoted text 7 lines
> But mod_fastcgi additionally allows you to specify that the fastcgi process is > already running, and that no process should be started. The process can run > on the same or on another machine as the Webserver: What you described here is the FastCGI standard. This way the webserver can scale up the amount of connections for each instance of the cgi-process.

Can you show me how ?

Show quoted text 6 lines
> FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 -idle-timeout 30 -flush You can configure mod_fcgid also this way, if you want. (Except for debugging, I woudn't know why you would do that. And I use the embedded webserver for debugging)

How ? I tried, but found no description of how to do this.

That's why I use mod_fastcgi, because the mod_fcgid doesn't offer an equivalent of FastCgiExternalServer.

Show quoted text 14 lines
> This is very convenient, because you can start the fastcgi process in the > debugger, just as any normal process. Or, the fastCGI process can be a > windows service. Hmm.. windows service could be an idea. But that scales not that easy, offcourse. > Other than that, the configuration option names are different. > > My FastCGI process is running as a windows service. What is exactly the reason for this? Isn't it much easier when the webserver starts (and stops, when it is not used) the cgi-application, than doing this in a Windows service?

I want to control the amount of instances and the exact moment of their start/stop. I don't want the server to control my application instance.

Michael.

Reply by email

Unknown author
to Michael Schnell: As creating process is a time consuming effort in Windows, fast-cgi-ing already running…
Michael Schnell wrote 19 lines
On 12/01/2010 02:16 PM, Joost van der Sluis wrote: >> My FastCGI process is running as a windows service. > What is exactly the reason for this? Isn't it much easier when the > webserver starts (and stops, when it is not used) the cgi-application, > than doing this in a Windows service? As creating process is a time consuming effort in Windows, fast-cgi-ing already running processes would offer a lot faster response. OTOH, If doing Windows, Microsoft of course wants you to use IIS. Microsoft IIS provides the ISAPI interface between the webserver and the cgi program, that in this case is neither a program nor a service, but a DLL. ISAPI offers similar features like FGCI but in a Windows-centric way. A colleague of mine (using Delphi) did a quite complex application based on ISAP. it's running just fine for a lot of customers. In fact he did an ISAPI "proxy" DLL, that communicates with a service (or program). This way debugging is a lot easier than directly debugging the ISAPI DLL.

ISAPI is still on my list.

But FastCGI is better, since it runs irrespective of the webserver. And given that IIS is losing market share, I would never code exclusively for IIS.

Michael.

Reply by email

Joost van der Sluis
to Unknown author: In what way doesn't it follow the FastCGI standard ? Can you show me how ? How ? I tried,…
Show quoted text 12 lines
On Wed, 1 Dec 2010, Joost van der Sluis wrote: >> >> The can do the same thing: >> By default, a fastcgi process is started by the webserver, passing it the >> socket on which it should listen. > > Most imporant difference is that mod_fastcgi is deprecated and doesn't > follow the FastCGI standard. In what way doesn't it follow the FastCGI standard ?

The way how a connection is initialized, using a socket, is part of the specification. Providing a port isn't. See:

http://www.fastcgi.com/drupal/node/6?q=node/22#S3.2

Show quoted text 9 lines
>> But mod_fastcgi additionally allows you to specify that the fastcgi process is >> already running, and that no process should be started. The process can run >> on the same or on another machine as the Webserver: > > What you described here is the FastCGI standard. This way the webserver > can scale up the amount of connections for each instance of the > cgi-process. Can you show me how ?

These are standard options of mod_cgid?

http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgididletimeout

And also look for fcgidmaxprocesses, fcgidmaxrequestsperprocess, fcgidprocesslifetime

Also check this:
http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1

The FastCGI process should return how many connection and requests it can handle. I'm not sure anymore if FastCGI of fpc can handle muliple requests at a time. (It could, but some parts ahve been changed)

Show quoted text 7 lines
>> FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 -idle-timeout 30 -flush > > You can configure mod_fcgid also this way, if you want. (Except for > debugging, I woudn't know why you would do that. And I use the embedded > webserver for debugging) How ? I tried, but found no description of how to do this.

I tried to find it, but now I remember that I looked for this earlier and coudn't find it. Probably because it isn't part of the FastCGI standard. So, no, if you need a specified port, you have to stick with mod_fastcgi.

That's why I use mod_fastcgi, because the mod_fcgid doesn't offer an equivalent of FastCgiExternalServer.

Seems you're right.

Show quoted text 17 lines
>> This is very convenient, because you can start the fastcgi process in the >> debugger, just as any normal process. Or, the fastCGI process can be a >> windows service. > > Hmm.. windows service could be an idea. But that scales not that easy, > offcourse. > >> Other than that, the configuration option names are different. >> >> My FastCGI process is running as a windows service. > > What is exactly the reason for this? Isn't it much easier when the > webserver starts (and stops, when it is not used) the cgi-application, > than doing this in a Windows service? I want to control the amount of instances and the exact moment of their start/stop. I don't want the server to control my application instance.

Because you don't trust IIS? ;)

Joost.

Reply by email

Unknown author
to Joost van der Sluis: The way how a connection is initialized, using a socket, is part of the specification.…
Joost van der Sluis wrote 19 lines
On Wed, 2010-12-01 at 15:51 +0100, wrote: > > On Wed, 1 Dec 2010, Joost van der Sluis wrote: > >>> >>> The can do the same thing: >>> By default, a fastcgi process is started by the webserver, passing it the >>> socket on which it should listen. >> >> Most imporant difference is that mod_fastcgi is deprecated and doesn't >> follow the FastCGI standard. > > In what way doesn't it follow the FastCGI standard ? The way how a connection is initialized, using a socket, is part of the specification. Providing a port isn't. See: http://www.fastcgi.com/drupal/node/6?q=node/22#S3.2

Yes, this I know. But this is an addition, it can follow the standard too. But providing the port is IMHO the sanest thing to do, as it gives you the most control over the FastCGI process.

Show quoted text 17 lines
>>> But mod_fastcgi additionally allows you to specify that the fastcgi process is >>> already running, and that no process should be started. The process can run >>> on the same or on another machine as the Webserver: >> >> What you described here is the FastCGI standard. This way the webserver >> can scale up the amount of connections for each instance of the >> cgi-process. > > Can you show me how ? These are standard options of mod_cgid? http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgididletimeout And also look for fcgidmaxprocesses, fcgidmaxrequestsperprocess, fcgidprocesslifetime

This I know, I was talking about how to do FastCgiExternalServer

Show quoted text 6 lines
Also check this: http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1 The FastCGI process should return how many connection and requests it can handle. I'm not sure anymore if FastCGI of fpc can handle muliple requests at a time. (It could, but some parts ahve been changed)

It never could.
There is 1 connection, and all requests go through this connection.

A week (or maybe 2) ago, I sent you a private mail about using select() on the connection handle. This or the use of threads could be used to handle multiple connections. Maybe look it up and reply :-)

Show quoted text 12 lines
>>> FastCgiExternalServer D:/counte/verbruik/server -host 127.0.0.1:2015 -idle-timeout 30 -flush >> >> You can configure mod_fcgid also this way, if you want. (Except for >> debugging, I woudn't know why you would do that. And I use the embedded >> webserver for debugging) > > How ? I tried, but found no description of how to do this. I tried to find it, but now I remember that I looked for this earlier and coudn't find it. Probably because it isn't part of the FastCGI standard. So, no, if you need a specified port, you have to stick with mod_fastcgi.

Exactly :-)

Show quoted text 25 lines
> That's why I use mod_fastcgi, because the mod_fcgid doesn't offer an > equivalent of FastCgiExternalServer. Seems you're right. >>> This is very convenient, because you can start the fastcgi process in the >>> debugger, just as any normal process. Or, the fastCGI process can be a >>> windows service. >> >> Hmm.. windows service could be an idea. But that scales not that easy, >> offcourse. >> >>> Other than that, the configuration option names are different. >>> >>> My FastCGI process is running as a windows service. >> >> What is exactly the reason for this? Isn't it much easier when the >> webserver starts (and stops, when it is not used) the cgi-application, >> than doing this in a Windows service? > > I want to control the amount of instances and the exact moment of their > start/stop. I don't want the server to control my application instance. Because you don't trust IIS? ;)

Definitely not IIS (I would only use IIS with ASP.NET, since I suspect that Microsoft will dump support for anything else).

But Apache I also don't trust. I want decide when to start/stop my daemon, not leave it to the webserver...

Michael.

Reply by email

Marcos Douglas
to Unknown author
Show quoted text 8 lines
[snip] It never could. There is 1 connection, and all requests go through this connection. A week (or maybe 2) ago, I sent you a private mail about using select() on the connection handle. ?This or the use of threads could be used to handle multiple connections. ?Maybe look it up and reply :-)

ExtPascal uses threads to handle multiple connections. I remember you don't accept this way, right? BTW, what is there wrong if ExtPascal uses threads?

Marcos Douglas

Reply by email

Luiz Americo Pereira Camara
to Joost van der Sluis: The way how a connection is initialized, using a socket, is part of the specification.…
Joost van der Sluis wrote
The FastCGI process should return how many connection and requests it can handle. I'm not sure anymore if FastCGI of fpc can handle muliple requests at a time. (It could, but some parts ahve been changed)

AFAIK at least Apache does not support multiplexing, so no hurry in implementing in fpc.

BTW: did you get fpweb fastcgi + apache + mod_fcgid to work under Windows?

I could not get to work and i think that the problem could be mod_fcgid because Michael V Canneyt got success with mod_fastcgi

Luiz

Reply by email

Unknown author
to Marcos Douglas: ExtPascal uses threads to handle multiple connections. I remember you don't accept this…
Marcos Douglas wrote 13 lines
On Wed, Dec 1, 2010 at 1:05 PM, wrote: > > [snip] > > It never could. There is 1 connection, and all requests go through this connection. > > A week (or maybe 2) ago, I sent you a private mail about using select() > on the connection handle. ?This or the use of threads could be used > to handle multiple connections. ?Maybe look it up and reply :-) ExtPascal uses threads to handle multiple connections. I remember you don't accept this way, right? BTW, what is there wrong if ExtPascal uses threads?

I accept using threads, but not the way ExtPascal does it. Threads should be optional. In extpascal, the thread is equal to the session: if you have many sessions, the application will create as many threads as there are sessions.

Under normal circumstances you would have a fixed (or limited) thread pool, and each request is handled by a free thread in the pool. So requests of a session can (and will) be handled by different threads.

In ExtPascal, it is impossible to separate the thread from the session. This has the advantage of being simple, but doesn't scale, and creates unneeded dependencies between different parts of the software.

Michael.

Reply by email

Marcos Douglas
to Unknown author

2010/12/1 :

Show quoted text 30 lines
On Wed, 1 Dec 2010, Marcos Douglas wrote: > On Wed, Dec 1, 2010 at 1:05 PM, wrote: >> >> [snip] >> >> It never could. There is 1 connection, and all requests go through this >> connection. >> >> A week (or maybe 2) ago, I sent you a private mail about using select() >> on the connection handle. ?This or the use of threads could be used >> to handle multiple connections. ?Maybe look it up and reply :-) > > ExtPascal uses threads to handle multiple connections. I remember you > don't accept this way, right? BTW, what is there wrong if ExtPascal > uses threads? I accept using threads, but not the way ExtPascal does it. Threads should be optional. In extpascal, the thread is equal to the session: if you have many sessions, the application will create as many threads as there are sessions. Under normal circumstances you would have a fixed (or limited) thread pool, and each request is ?handled by a free thread in the pool. So requests of a session can (and will) be handled by different threads. In ExtPascal, it is impossible to separate the thread from the session. This has the advantage of being simple, but doesn't scale, and creates unneeded dependencies between different parts of the software.

I understood.
So, the fpWeb works with threads (pool) if I need them?

Marcos Douglas

Reply by email

Joost van der Sluis
to Unknown author: Yes, this I know. But this is an addition, it can follow the standard too. But providing…
Show quoted text 16 lines
On Wed, 1 Dec 2010, Joost van der Sluis wrote: > On Wed, 2010-12-01 at 15:51 +0100, wrote: >> >> On Wed, 1 Dec 2010, Joost van der Sluis wrote: > Also check this: > http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1 > > The FastCGI process should return how many connection and requests it > can handle. I'm not sure anymore if FastCGI of fpc can handle muliple > requests at a time. (It could, but some parts ahve been changed) It never could. There is 1 connection, and all requests go through this connection.

Yes, but this was about requests. One connection can be used for multiple requests. Each package contain an identifier for which request it is, so multiple request can be handled.

A week (or maybe 2) ago, I sent you a private mail about using select() on the connection handle. This or the use of threads could be used to handle multiple connections. Maybe look it up and reply :-)

I still have to , it once used select(), but that didn't work on Windows, somehow.

Joost.

Reply by email

Marcos Douglas
to Joost van der Sluis
Joost van der Sluis wrote 21 lines
On Wed, 2010-12-01 at 17:05 +0100, wrote: > > On Wed, 1 Dec 2010, Joost van der Sluis wrote: > > > On Wed, 2010-12-01 at 15:51 +0100, wrote: > >> > >> On Wed, 1 Dec 2010, Joost van der Sluis wrote: > > Also check this: > > http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1 > > > > The FastCGI process should return how many connection and requests it > > can handle. I'm not sure anymore if FastCGI of fpc can handle muliple > > requests at a time. (It could, but some parts ahve been changed) > > It never could. > There is 1 connection, and all requests go through this connection. Yes, but this was about requests. One connection can be used for multiple requests. Each package contain an identifier for which request it is, so multiple request can be handled.

I've made ISAPI apps a long time ago... with Delphi. One connection can be used for multiples requests, in ISAPI, but all access to RDBMS were protected (TCriticalSection). How would be with FastCGI and FPC?

Marcos Douglas

Reply by email

Michael Van Canneyt
to Joost van der Sluis: Yes, but this was about requests. One connection can be used for multiple requests. Each…
Joost van der Sluis wrote 21 lines
On Wed, 2010-12-01 at 17:05 +0100, wrote: > > On Wed, 1 Dec 2010, Joost van der Sluis wrote: > >> On Wed, 2010-12-01 at 15:51 +0100, wrote: >>> >>> On Wed, 1 Dec 2010, Joost van der Sluis wrote: >> Also check this: >> http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1 >> >> The FastCGI process should return how many connection and requests it >> can handle. I'm not sure anymore if FastCGI of fpc can handle muliple >> requests at a time. (It could, but some parts ahve been changed) > > It never could. > There is 1 connection, and all requests go through this connection. Yes, but this was about requests. One connection can be used for multiple requests. Each package contain an identifier for which request it is, so multiple request can be handled.

Quote:
"The FastCGI process should return how many connection"

The last word is what I reacted on :-)

Show quoted text 7 lines
> A week (or maybe 2) ago, I sent you a private mail about using select() > on the connection handle. This or the use of threads could be used to > handle multiple connections. Maybe look it up and reply :-) I still have to , it once used select(), but that didn't work on Windows, somehow.

Works fine for me. There were some other bugs on windows, which I fixed some time ago.

Well the app is in production, I tested the adding of select() initially on Windows and it's doing just fine :-)

Michael.

Reply by email

Michael Van Canneyt
to Marcos Douglas: 2010/12/1 : I understood. So, the fpWeb works with threads (pool) if I need them? Marcos…
Marcos Douglas wrote 34 lines
2010/12/1 : > > > On Wed, 1 Dec 2010, Marcos Douglas wrote: > >> On Wed, Dec 1, 2010 at 1:05 PM, wrote: >>> >>> [snip] >>> >>> It never could. There is 1 connection, and all requests go through this >>> connection. >>> >>> A week (or maybe 2) ago, I sent you a private mail about using select() >>> on the connection handle. ?This or the use of threads could be used >>> to handle multiple connections. ?Maybe look it up and reply :-) >> >> ExtPascal uses threads to handle multiple connections. I remember you >> don't accept this way, right? BTW, what is there wrong if ExtPascal >> uses threads? > > I accept using threads, but not the way ExtPascal does it. Threads should be > optional. In extpascal, the thread is equal to the session: if you have many > sessions, the application will create as many threads as there are sessions. > > Under normal circumstances you would have a fixed (or limited) thread pool, > and each request is ?handled by a free thread in the pool. So requests of > a session can (and will) be handled by different threads. > > In ExtPascal, it is impossible to separate the thread from the session. > This has the advantage of being simple, but doesn't scale, and creates > unneeded dependencies between different parts of the software. I understood. So, the fpWeb works with threads (pool) if I need them?

Currently not, but the design is made so that it can be added if needed. With ExtPascal, the design is so that it cannot be added, even if you wanted it. (well, not without reworking ExtPascal completely)

Michael.

Reply by email

Dariusz Mazur
to Unknown author: I accept using threads, but not the way ExtPascal does it. Threads should be optional. In…
Show quoted text 10 lines
> ExtPascal uses threads to handle multiple connections. I remember you > don't accept this way, right? BTW, what is there wrong if ExtPascal > uses threads? I accept using threads, but not the way ExtPascal does it. Threads should be optional. In extpascal, the thread is equal to the session: if you have many sessions, the application will create as many threads as there are sessions.

I use different architecture: each session has own thread and each connection has own thread. Sessions are separated from connections and communicate via FIFO queue.
Session runs whole life time in the same thread. With this i can use modal form and thread var in the same manner, as normal (desktop) application.

Show quoted text 5 lines
Under normal circumstances you would have a fixed (or limited) thread pool, and each request is handled by a free thread in the pool. So requests of a session can (and will) be handled by different threads.
In ExtPascal, it is impossible to separate the thread from the session. This has the advantage of being simple, but doesn't scale, and creates unneeded dependencies between different parts of the software.

that is next point

Darek

Reply by email

Unknown author
to Dariusz Mazur
Dariusz Mazur wrote 17 lines
>> ExtPascal uses threads to handle multiple connections. I remember you >> don't accept this way, right? BTW, what is there wrong if ExtPascal >> uses threads? > > I accept using threads, but not the way ExtPascal does it. Threads should > be > optional. In extpascal, the thread is equal to the session: if you have > many > sessions, the application will create as many threads as there are > sessions. I use different architecture: each session has own thread and each connection has own thread. Sessions are separated from connections and communicate via FIFO queue. Session runs whole life time in the same thread. With this i can use modal form and thread var in the same manner, as normal (desktop) application.

I understand this is the easy way.

But you don't need this architecture to do that. As long as a single request runs in a single thread, there is no problem with decoupling sessions and threads, and still be able to keep everything in memory.

Michael.

Reply by email

Michael Schnell
to Unknown author: I accept using threads, but not the way ExtPascal does it. Threads should be optional. In…
Under normal circumstances you would have a fixed (or limited) thread pool, and each request is handled by a free thread in the pool.

Of course it does make sense to use pre-started threads.

How are requests queued if no threads are available in the pool ? If this is done by a single (main) thread, this might introduce a bandwidth limitation.

In ExtPascal, it is impossible to separate the thread from the session. This has the advantage of being simple, but doesn't scale, and creates unneeded dependencies between different parts of the software.

It would be great to have an improved thingy similar to ExtPascal in the Lazarus Library :)

-Michael

Reply by email

Unknown author
to Michael Schnell
Michael Schnell wrote 9 lines
On 12/01/2010 05:43 PM, wrote: > > > Under normal circumstances you would have a fixed (or limited) thread pool, > and each request is handled by a free thread in the pool. Of course it does make sense to use pre-started threads. How are requests queued if no threads are available in the pool ? If this is done by a single (main) thread, this might introduce a bandwidth limitation.

Such things are usually configurable:
- Create new thread to handle the request
- Wait (as in: store in queue, and continue waiting for requests) till a thread becomes available.

Just as a webserver does it.

Show quoted text 6 lines
> In ExtPascal, it is impossible to separate the thread from the session. > This has the advantage of being simple, but doesn't scale, and creates > unneeded dependencies between different parts of the software. It would be great to have an improved thingy similar to ExtPascal in the Lazarus Library :)

It would, indeed. Darek Maszur has something similar to ExtPascal. If you'd start with something like it, I think his implementation would be easier to convert than ExtPascal.

Michael.

Reply by email

Dariusz Mazur
to Unknown author: I understand this is the easy way. But you don't need this architecture to do that. As…

W dniu 2010-12-02 09:25, pisze:

Show quoted text 29 lines
On Thu, 2 Dec 2010, Dariusz Mazur wrote: > >>> ExtPascal uses threads to handle multiple connections. I remember you >>> don't accept this way, right? BTW, what is there wrong if ExtPascal >>> uses threads? >> >> I accept using threads, but not the way ExtPascal does it. Threads >> should be >> optional. In extpascal, the thread is equal to the session: if you >> have many >> sessions, the application will create as many threads as there are >> sessions. > > I use different architecture: each session has own thread and each > connection has own thread. Sessions are separated from connections > and communicate via FIFO queue. > Session runs whole life time in the same thread. With this i can use > modal form and thread var in the same manner, as normal (desktop) > application. I understand this is the easy way. But you don't need this architecture to do that. As long as a single request runs in a single thread, there is no problem with decoupling sessions and threads, and still be able to keep everything in memory.

I dont understand.
I parse single request in single thread (for each request new thread) and what can I do (other) with sessions?

Darek

Reply by email

Unknown author
to Dariusz Mazur
Dariusz Mazur wrote 33 lines
W dniu 2010-12-02 09:25, pisze: > > > On Thu, 2 Dec 2010, Dariusz Mazur wrote: > >> >>>> ExtPascal uses threads to handle multiple connections. I remember you >>>> don't accept this way, right? BTW, what is there wrong if ExtPascal >>>> uses threads? >>> >>> I accept using threads, but not the way ExtPascal does it. Threads should >>> be >>> optional. In extpascal, the thread is equal to the session: if you have >>> many >>> sessions, the application will create as many threads as there are >>> sessions. >> >> I use different architecture: each session has own thread and each >> connection has own thread. Sessions are separated from connections and >> communicate via FIFO queue. >> Session runs whole life time in the same thread. With this i can use modal >> form and thread var in the same manner, as normal (desktop) application. > > I understand this is the easy way. > > But you don't need this architecture to do that. As long as a single > request > runs in a single thread, there is no problem with decoupling sessions and > threads, and still be able to keep everything in memory. I dont understand. I parse single request in single thread (for each request new thread) and what can I do (other) with sessions?

One scenario looks like this:
- Request comes in (on whatever thread).
- Determine session data (your form) for the request. Session data is in a global list.
- Find a thread to handle the request.
- Pass session data to thread and let it handle request.

Another way is
- Connection is accepted.
- An idle thread to handle request is found.
- Thread looks up session data from data in request.
- Thread handles request using found session data.

Michael.

Reply by email

Marcos Douglas
to Unknown author
Show quoted text 19 lines
[snip] > I dont understand. > I parse single request in single thread (for each request new thread) > and what can I do (other) with sessions? One scenario looks like this: - Request comes in (on whatever thread). - Determine session data (your form) for the request. ?Session data is in a global list. - Find a thread to handle the request. - Pass session data to thread and let it handle request. Another way is - Connection is accepted. - An idle thread to handle request is found. - Thread looks up session data from data in request. - Thread handles request using found session data.

Now I understand the Michael's concept and looks like better for me.

One thread for each session is the easy way, no doubt, but an application it have many, many, many users logged, the web server would become very slow. Also, each thread will create a connection with DB and we would have a lot of connections at the same time!

Marcos Douglas

Reply by email

Dariusz Mazur
to Unknown author: One scenario looks like this: - Request comes in (on whatever thread). - Determine…

W dniu 2010-12-02 11:38, pisze:

Show quoted text 54 lines
On Thu, 2 Dec 2010, Dariusz Mazur wrote: > W dniu 2010-12-02 09:25, pisze: >> >> >> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >> >>> >>>>> ExtPascal uses threads to handle multiple connections. I remember >>>>> you >>>>> don't accept this way, right? BTW, what is there wrong if ExtPascal >>>>> uses threads? >>>> >>>> I accept using threads, but not the way ExtPascal does it. Threads >>>> should be >>>> optional. In extpascal, the thread is equal to the session: if you >>>> have many >>>> sessions, the application will create as many threads as there are >>>> sessions. >>> >>> I use different architecture: each session has own thread and each >>> connection has own thread. Sessions are separated from connections >>> and communicate via FIFO queue. >>> Session runs whole life time in the same thread. With this i can >>> use modal form and thread var in the same manner, as normal >>> (desktop) application. >> >> I understand this is the easy way. >> >> But you don't need this architecture to do that. As long as a single >> request >> runs in a single thread, there is no problem with decoupling >> sessions and >> threads, and still be able to keep everything in memory. > > I dont understand. > I parse single request in single thread (for each request new thread) > and what can I do (other) with sessions? One scenario looks like this: - Request comes in (on whatever thread). - Determine session data (your form) for the request. Session data is in a global list. - Find a thread to handle the request. - Pass session data to thread and let it handle request. Another way is - Connection is accepted. - An idle thread to handle request is found. - Thread looks up session data from data in request. - Thread handles request using found session data.

At the beginning I use second attempt, after that first. But both have limitation, because not follow (not act as desktop OS) desktop architecture. There are not pass to more complicated application (when it is porting from Delphi).

1. All task of application should be prepare as response for request, there is problem with modal forms, which stop and wait to user action, and after response go on (next statement in current procedure, not other ).
2. When application is busy for long time with preparing response, its no chance to make simple response with message of waiting (or progress bar)
3. With second attempt session data is computing with different threads, thus thread vars can't be used

Darek

Reply by email

Unknown author
to Dariusz Mazur
Dariusz Mazur wrote 59 lines
W dniu 2010-12-02 11:38, pisze: > > > On Thu, 2 Dec 2010, Dariusz Mazur wrote: > >> W dniu 2010-12-02 09:25, pisze: >>> >>> >>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>> >>>> >>>>>> ExtPascal uses threads to handle multiple connections. I remember you >>>>>> don't accept this way, right? BTW, what is there wrong if ExtPascal >>>>>> uses threads? >>>>> >>>>> I accept using threads, but not the way ExtPascal does it. Threads >>>>> should be >>>>> optional. In extpascal, the thread is equal to the session: if you have >>>>> many >>>>> sessions, the application will create as many threads as there are >>>>> sessions. >>>> >>>> I use different architecture: each session has own thread and each >>>> connection has own thread. Sessions are separated from connections and >>>> communicate via FIFO queue. >>>> Session runs whole life time in the same thread. With this i can use >>>> modal form and thread var in the same manner, as normal (desktop) >>>> application. >>> >>> I understand this is the easy way. >>> >>> But you don't need this architecture to do that. As long as a single >>> request >>> runs in a single thread, there is no problem with decoupling sessions and >>> threads, and still be able to keep everything in memory. >> >> I dont understand. >> I parse single request in single thread (for each request new thread) >> and what can I do (other) with sessions? > > One scenario looks like this: > - Request comes in (on whatever thread). > - Determine session data (your form) for the request. > Session data is in a global list. > - Find a thread to handle the request. > - Pass session data to thread and let it handle request. > > Another way is > - Connection is accepted. > - An idle thread to handle request is found. > - Thread looks up session data from data in request. > - Thread handles request using found session data. > At the beginning I use second attempt, after that first. But both have limitation, because not follow (not act as desktop OS) desktop architecture. There are not pass to more complicated application (when it is porting from Delphi).

This is correct, but I assume that when starting a web application, you will start with a fresh design.

Show quoted text 5 lines
1. All task of application should be prepare as response for request, there is problem with modal forms, which stop and wait to user action, and after response go on (next statement in current procedure, not other ). 2. When application is busy for long time with preparing response, its no chance to make simple response with message of waiting (or progress bar)

I don't see the connection of these problems with how threads are used. A simple WaitForEvent()/SetEvent() should do this.

3. With second attempt session data is computing with different threads, thus thread vars can't be used

They are only a problem if you use global variables. You should never use global variables, unless maybe the database connection and global application configuration.

None of my 4 web applications uses global variables (except said database connection and global configuration object).
The other programmers have not yet complained. They know global variables are evil from their work on our regular desktop program :-)

Michael.

Reply by email

Marcos Douglas
to Unknown author
Show quoted text 72 lines
On Thu, 2 Dec 2010, Dariusz Mazur wrote: > W dniu 2010-12-02 11:38, pisze: >> >> >> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >> >>> W dniu 2010-12-02 09:25, pisze: >>>> >>>> >>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>> >>>>> >>>>>>> ExtPascal uses threads to handle multiple connections. I remember you >>>>>>> don't accept this way, right? BTW, what is there wrong if ExtPascal >>>>>>> uses threads? >>>>>> >>>>>> I accept using threads, but not the way ExtPascal does it. Threads should be >>>>>> optional. In extpascal, the thread is equal to the session: if you have many >>>>>> sessions, the application will create as many threads as there are sessions. >>>>> >>>>> I use different architecture: each session has own thread and each connection has own thread. Sessions are separated from connections and communicate via FIFO queue. >>>>> Session runs whole life time in the same thread. With this i can use modal form and thread var in the same manner, as normal (desktop) application. >>>> >>>> I understand this is the easy way. >>>> >>>> But you don't need this architecture to do that. As long as a single request >>>> runs in a single thread, there is no problem with decoupling sessions and >>>> threads, and still be able to keep everything in memory. >>> >>> I dont understand. >>> I parse single request in single thread (for each request new thread) >>> and what can I do (other) with sessions? >> >> One scenario looks like this: >> - Request comes in (on whatever thread). >> - Determine session data (your form) for the request. >> ?Session data is in a global list. >> - Find a thread to handle the request. >> - Pass session data to thread and let it handle request. >> >> Another way is >> - Connection is accepted. >> - An idle thread to handle request is found. >> - Thread looks up session data from data in request. >> - Thread handles request using found session data. >> > > At the beginning I use second attempt, after that first. But both have limitation, because not follow (not act as desktop OS) desktop architecture. > There are ?not pass to more complicated application (when it is porting from Delphi). > This is correct, but I assume that when starting a web application, you will start with a fresh design. > 1. All task of application should be prepare as response for request, there is problem with modal forms, which stop and wait to user action, and after response go on (next statement in current procedure, not other ). > 2. ?When application is busy for long time with preparing response, its no chance to make simple response with message of waiting (or progress bar) I don't see the connection of these problems with how threads are used. A simple WaitForEvent()/SetEvent() should do this. > 3. With second attempt session data is computing with different threads, thus thread vars can't be used They are only a problem if you use global variables. You should never use global variables, unless maybe the database connection and global application configuration. None of my 4 web applications uses global variables (except said database connection and global configuration object). The other programmers have not yet complained. They know global variables are evil from their work on our regular desktop program :-)

How do you work to manipulate sessions?

Marcos Doulglas

Reply by email

Michael Van Canneyt
to Marcos Douglas
Marcos Douglas wrote 75 lines
On Thu, Dec 2, 2010 at 1:12 PM, wrote: > > > On Thu, 2 Dec 2010, Dariusz Mazur wrote: > >> W dniu 2010-12-02 11:38, pisze: >>> >>> >>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>> >>>> W dniu 2010-12-02 09:25, pisze: >>>>> >>>>> >>>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>>> >>>>>> >>>>>>>> ExtPascal uses threads to handle multiple connections. I remember you >>>>>>>> don't accept this way, right? BTW, what is there wrong if ExtPascal >>>>>>>> uses threads? >>>>>>> >>>>>>> I accept using threads, but not the way ExtPascal does it. Threads should be >>>>>>> optional. In extpascal, the thread is equal to the session: if you have many >>>>>>> sessions, the application will create as many threads as there are sessions. >>>>>> >>>>>> I use different architecture: each session has own thread and each connection has own thread. Sessions are separated from connections and communicate via FIFO queue. >>>>>> Session runs whole life time in the same thread. With this i can use modal form and thread var in the same manner, as normal (desktop) application. >>>>> >>>>> I understand this is the easy way. >>>>> >>>>> But you don't need this architecture to do that. As long as a single request >>>>> runs in a single thread, there is no problem with decoupling sessions and >>>>> threads, and still be able to keep everything in memory. >>>> >>>> I dont understand. >>>> I parse single request in single thread (for each request new thread) >>>> and what can I do (other) with sessions? >>> >>> One scenario looks like this: >>> - Request comes in (on whatever thread). >>> - Determine session data (your form) for the request. >>> ?Session data is in a global list. >>> - Find a thread to handle the request. >>> - Pass session data to thread and let it handle request. >>> >>> Another way is >>> - Connection is accepted. >>> - An idle thread to handle request is found. >>> - Thread looks up session data from data in request. >>> - Thread handles request using found session data. >>> >> >> At the beginning I use second attempt, after that first. But both have limitation, because not follow (not act as desktop OS) desktop architecture. >> There are ?not pass to more complicated application (when it is porting from Delphi). >> > > This is correct, but I assume that when starting a web application, you > will start with a fresh design. > >> 1. All task of application should be prepare as response for request, there is problem with modal forms, which stop and wait to user action, and after response go on (next statement in current procedure, not other ). >> 2. ?When application is busy for long time with preparing response, its no chance to make simple response with message of waiting (or progress bar) > > I don't see the connection of these problems with how threads are used. > A simple WaitForEvent()/SetEvent() should do this. > >> 3. With second attempt session data is computing with different threads, thus thread vars can't be used > > They are only a problem if you use global variables. You should never use > global variables, unless maybe the database connection and global > application configuration. > > None of my 4 web applications uses global variables (except said database > connection and global configuration object). The other programmers have not yet complained. They know global variables > are evil from their work on our regular desktop program :-) How do you work to manipulate sessions?

There is a global sessionlist (simple hashlist: string is session GUID, object is session module). based on the session cookie, I get the session. All other things are stored in a descendent of the session module.

Michael.

Reply by email

Marcos Douglas
to Michael Van Canneyt

2010/12/2 Michael Van Canneyt :

Show quoted text 102 lines
On Thu, 2 Dec 2010, Marcos Douglas wrote: > On Thu, Dec 2, 2010 at 1:12 PM, wrote: >> >> >> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >> >>> W dniu 2010-12-02 11:38, pisze: >>>> >>>> >>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>> >>>>> W dniu 2010-12-02 09:25, pisze: >>>>>> >>>>>> >>>>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>>>> >>>>>>> >>>>>>>>> ExtPascal uses threads to handle multiple connections. I remember >>>>>>>>> you >>>>>>>>> don't accept this way, right? BTW, what is there wrong if >>>>>>>>> ExtPascal >>>>>>>>> uses threads? >>>>>>>> >>>>>>>> I accept using threads, but not the way ExtPascal does it. Threads >>>>>>>> should be >>>>>>>> optional. In extpascal, the thread is equal to the session: if you >>>>>>>> have many >>>>>>>> sessions, the application will create as many threads as there are >>>>>>>> sessions. >>>>>>> >>>>>>> I use different architecture: each session has own thread and each >>>>>>> connection has own thread. Sessions are separated from connections and >>>>>>> communicate via FIFO queue. >>>>>>> Session runs whole life time in the same thread. With this i can use >>>>>>> modal form and thread var in the same manner, as normal (desktop) >>>>>>> application. >>>>>> >>>>>> I understand this is the easy way. >>>>>> >>>>>> But you don't need this architecture to do that. As long as a single >>>>>> request >>>>>> runs in a single thread, there is no problem with decoupling sessions >>>>>> and >>>>>> threads, and still be able to keep everything in memory. >>>>> >>>>> I dont understand. >>>>> I parse single request in single thread (for each request new thread) >>>>> and what can I do (other) with sessions? >>>> >>>> One scenario looks like this: >>>> - Request comes in (on whatever thread). >>>> - Determine session data (your form) for the request. >>>> ?Session data is in a global list. >>>> - Find a thread to handle the request. >>>> - Pass session data to thread and let it handle request. >>>> >>>> Another way is >>>> - Connection is accepted. >>>> - An idle thread to handle request is found. >>>> - Thread looks up session data from data in request. >>>> - Thread handles request using found session data. >>>> >>> >>> At the beginning I use second attempt, after that first. But both have >>> limitation, because not follow (not act as desktop OS) desktop architecture. >>> There are ?not pass to more complicated application (when it is porting >>> from Delphi). >>> >> >> This is correct, but I assume that when starting a web application, you >> will start with a fresh design. >> >>> 1. All task of application should be prepare as response for request, >>> there is problem with modal forms, which stop and wait to user action, and >>> after response go on (next statement in current procedure, not other ). >>> 2. ?When application is busy for long time with preparing response, its >>> no chance to make simple response with message of waiting (or progress bar) >> >> I don't see the connection of these problems with how threads are used. >> A simple WaitForEvent()/SetEvent() should do this. >> >>> 3. With second attempt session data is computing with different threads, >>> thus thread vars can't be used >> >> They are only a problem if you use global variables. You should never use >> global variables, unless maybe the database connection and global >> application configuration. >> >> None of my 4 web applications uses global variables (except said database >> connection and global configuration object). The other programmers have >> not yet complained. They know global variables >> are evil from their work on our regular desktop program :-) > > How do you work to manipulate sessions? There is a global sessionlist (simple hashlist: string is session GUID, object is session module). based on the session cookie, I get the session. All other things are stored in a descendent of the session module.

There is just a global sessionlist accessed for many threads, at the same time? The fpWeb framework manages thread conflicts?

Marcos Douglas

Reply by email

Michael Van Canneyt
to Marcos Douglas
Marcos Douglas wrote 106 lines
2010/12/2 Michael Van Canneyt : > > > On Thu, 2 Dec 2010, Marcos Douglas wrote: > >> On Thu, Dec 2, 2010 at 1:12 PM, wrote: >>> >>> >>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>> >>>> W dniu 2010-12-02 11:38, pisze: >>>>> >>>>> >>>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>>> >>>>>> W dniu 2010-12-02 09:25, pisze: >>>>>>> >>>>>>> >>>>>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>>>>> >>>>>>>> >>>>>>>>>> ExtPascal uses threads to handle multiple connections. I remember >>>>>>>>>> you >>>>>>>>>> don't accept this way, right? BTW, what is there wrong if >>>>>>>>>> ExtPascal >>>>>>>>>> uses threads? >>>>>>>>> >>>>>>>>> I accept using threads, but not the way ExtPascal does it. Threads >>>>>>>>> should be >>>>>>>>> optional. In extpascal, the thread is equal to the session: if you >>>>>>>>> have many >>>>>>>>> sessions, the application will create as many threads as there are >>>>>>>>> sessions. >>>>>>>> >>>>>>>> I use different architecture: each session has own thread and each >>>>>>>> connection has own thread. Sessions are separated from connections and >>>>>>>> communicate via FIFO queue. >>>>>>>> Session runs whole life time in the same thread. With this i can use >>>>>>>> modal form and thread var in the same manner, as normal (desktop) >>>>>>>> application. >>>>>>> >>>>>>> I understand this is the easy way. >>>>>>> >>>>>>> But you don't need this architecture to do that. As long as a single >>>>>>> request >>>>>>> runs in a single thread, there is no problem with decoupling sessions >>>>>>> and >>>>>>> threads, and still be able to keep everything in memory. >>>>>> >>>>>> I dont understand. >>>>>> I parse single request in single thread (for each request new thread) >>>>>> and what can I do (other) with sessions? >>>>> >>>>> One scenario looks like this: >>>>> - Request comes in (on whatever thread). >>>>> - Determine session data (your form) for the request. >>>>> ?Session data is in a global list. >>>>> - Find a thread to handle the request. >>>>> - Pass session data to thread and let it handle request. >>>>> >>>>> Another way is >>>>> - Connection is accepted. >>>>> - An idle thread to handle request is found. >>>>> - Thread looks up session data from data in request. >>>>> - Thread handles request using found session data. >>>>> >>>> >>>> At the beginning I use second attempt, after that first. But both have >>>> limitation, because not follow (not act as desktop OS) desktop architecture. >>>> There are ?not pass to more complicated application (when it is porting >>>> from Delphi). >>>> >>> >>> This is correct, but I assume that when starting a web application, you >>> will start with a fresh design. >>> >>>> 1. All task of application should be prepare as response for request, >>>> there is problem with modal forms, which stop and wait to user action, and >>>> after response go on (next statement in current procedure, not other ). >>>> 2. ?When application is busy for long time with preparing response, its >>>> no chance to make simple response with message of waiting (or progress bar) >>> >>> I don't see the connection of these problems with how threads are used. >>> A simple WaitForEvent()/SetEvent() should do this. >>> >>>> 3. With second attempt session data is computing with different threads, >>>> thus thread vars can't be used >>> >>> They are only a problem if you use global variables. You should never use >>> global variables, unless maybe the database connection and global >>> application configuration. >>> >>> None of my 4 web applications uses global variables (except said database >>> connection and global configuration object). The other programmers have >>> not yet complained. They know global variables >>> are evil from their work on our regular desktop program :-) >> >> How do you work to manipulate sessions? > > There is a global sessionlist (simple hashlist: string is session GUID, > object is session module). > based on the session cookie, I get the session. All other things are stored > in a descendent of the session module. There is just a global sessionlist accessed for many threads, at the same time? The fpWeb framework manages thread conflicts?

No, it does not. The sessionlist is not in fpWeb (although I have planned that), only in some private code (the list is obviously protected with a critical section). What conflicts do you expect ?

Michael.

Reply by email

waldo kitty
to Michael Schnell: Of course it does make sense to use pre-started threads. How are requests queued if no…
Michael Schnell wrote 9 lines
On 12/01/2010 05:43 PM, wrote: > > > Under normal circumstances you would have a fixed (or limited) thread pool, > and each request is handled by a free thread in the pool. Of course it does make sense to use pre-started threads. How are requests queued if no threads are available in the pool ? If this is done by a single (main) thread, this might introduce a bandwidth limitation.

using apache as an example, if the maximum number of servers (threads) is reached, then requests are queued for X amount of time in the hopes that a server comes free to handle the request... if a server does not come free within X amount of time, then that request is dropped in the bitbucket...

i think that the queue (bucket?) also has a limit on the number of requests that it will hold and if this is reached, then in FIFO fashion, the first in is dumped since it is also the oldest...

Reply by email

Michael Schnell
to waldo kitty
waldo kitty wrote 10 lines
using apache as an example, if the maximum number of servers (threads) is reached, then requests are queued for X amount of time in the hopes that a server comes free to handle the request... if a server does not come free within X amount of time, then that request is dropped in the bitbucket... i think that the queue (bucket?) also has a limit on the number of requests that it will hold and if this is reached, then in FIFO fashion, the first in is dumped since it is also the oldest...

Do I understand correctly that Apache performs the queuing ?

So The FCGI interface would need to provide it with additional information (e.g. if any or how many threads are still available) _before_ it opens a connection to the FCGI "Server" (as this would go directly to the thread and not to some kind of thread-scheduler).

Interesting indeed.... !

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 11 lines
On 12/03/2010 01:32 AM, waldo kitty wrote: > > using apache as an example, if the maximum number of servers (threads) is > reached, then requests are queued for X amount of time in the hopes that a > server comes free to handle the request... if a server does not come free > within X amount of time, then that request is dropped in the bitbucket... > > i think that the queue (bucket?) also has a limit on the number of requests > that it will hold and if this is reached, then in FIFO fashion, the first > in is dumped since it is also the oldest... Do I understand correctly that Apache performs the queuing ?

Apache performs it's own queuing, independent of FastCGI, CGI or whatever.

Show quoted text 5 lines
So The FCGI interface would need to provide it with additional information (e.g. if any or how many threads are still available) _before_ it opens a connection to the FCGI "Server" (as this would go directly to the thread and not to some kind of thread-scheduler).

No. You probably misunderstood what Waldo wanted to say.

What he said pertains to the inner workings of Apache, and is independent of how a particular request is handled. It pertains to how Apache handles new connections on its HTTP socket. No more, no less.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
What he said pertains to the inner workings of Apache,,,,

So when doing a multithreaded FCGI "Server" that uses a thread pool, the managing what thread is to be used when (creating additional threads or manage a queue if more requests com in than Thread are available), needs to be done by the FCGI Server itself.

I suppose this needs to be done by some kind of central "Thread Scheduler" (supposedly done by the application main thread). This in fact might create a performance limitation.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 8 lines
On 12/03/2010 01:56 PM, Michael Van Canneyt wrote: > > What he said pertains to the inner workings of Apache,,,, So when doing a multithreaded FCGI "Server" that uses a thread pool, the managing what thread is to be used when (creating additional threads or manage a queue if more requests com in than Thread are available), needs to be done by the FCGI Server itself.

Yes.
Apache has no control over this process, other than starting it on demand. (presumably, it will even start it many times, if many requests come in)

I suppose this needs to be done by some kind of central "Thread Scheduler" (supposedly done by the application main thread). This in fact might create a performance limitation.

It might.

You can do of course everything in a single thread, and then it is definitely even less performant :-)

Michael.

Reply by email

Marcos Douglas
to Michael Van Canneyt: No, it does not. The sessionlist is not in fpWeb (although I have planned that), only in…

2010/12/2 Michael Van Canneyt :

Show quoted text 135 lines
On Thu, 2 Dec 2010, Marcos Douglas wrote: > 2010/12/2 Michael Van Canneyt : >> >> >> On Thu, 2 Dec 2010, Marcos Douglas wrote: >> >>> On Thu, Dec 2, 2010 at 1:12 PM, wrote: >>>> >>>> >>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>> >>>>> W dniu 2010-12-02 11:38, pisze: >>>>>> >>>>>> >>>>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>>>> >>>>>>> W dniu 2010-12-02 09:25, pisze: >>>>>>>> >>>>>>>> >>>>>>>> On Thu, 2 Dec 2010, Dariusz Mazur wrote: >>>>>>>> >>>>>>>>> >>>>>>>>>>> ExtPascal uses threads to handle multiple connections. I >>>>>>>>>>> remember >>>>>>>>>>> you >>>>>>>>>>> don't accept this way, right? BTW, what is there wrong if >>>>>>>>>>> ExtPascal >>>>>>>>>>> uses threads? >>>>>>>>>> >>>>>>>>>> I accept using threads, but not the way ExtPascal does it. >>>>>>>>>> Threads >>>>>>>>>> should be >>>>>>>>>> optional. In extpascal, the thread is equal to the session: if >>>>>>>>>> you >>>>>>>>>> have many >>>>>>>>>> sessions, the application will create as many threads as there >>>>>>>>>> are >>>>>>>>>> sessions. >>>>>>>>> >>>>>>>>> I use different architecture: each session has own thread and each >>>>>>>>> connection has own thread. Sessions are separated from connections >>>>>>>>> and >>>>>>>>> communicate via FIFO queue. >>>>>>>>> Session runs whole life time in the same thread. With this i can >>>>>>>>> use >>>>>>>>> modal form and thread var in the same manner, as normal (desktop) >>>>>>>>> application. >>>>>>>> >>>>>>>> I understand this is the easy way. >>>>>>>> >>>>>>>> But you don't need this architecture to do that. As long as a >>>>>>>> single >>>>>>>> request >>>>>>>> runs in a single thread, there is no problem with decoupling >>>>>>>> sessions >>>>>>>> and >>>>>>>> threads, and still be able to keep everything in memory. >>>>>>> >>>>>>> I dont understand. >>>>>>> I parse single request in single thread (for each request new >>>>>>> thread) >>>>>>> and what can I do (other) with sessions? >>>>>> >>>>>> One scenario looks like this: >>>>>> - Request comes in (on whatever thread). >>>>>> - Determine session data (your form) for the request. >>>>>> ?Session data is in a global list. >>>>>> - Find a thread to handle the request. >>>>>> - Pass session data to thread and let it handle request. >>>>>> >>>>>> Another way is >>>>>> - Connection is accepted. >>>>>> - An idle thread to handle request is found. >>>>>> - Thread looks up session data from data in request. >>>>>> - Thread handles request using found session data. >>>>>> >>>>> >>>>> At the beginning I use second attempt, after that first. But both have >>>>> limitation, because not follow (not act as desktop OS) desktop >>>>> architecture. >>>>> There are ?not pass to more complicated application (when it is >>>>> porting >>>>> from Delphi). >>>>> >>>> >>>> This is correct, but I assume that when starting a web application, you >>>> will start with a fresh design. >>>> >>>>> 1. All task of application should be prepare as response for request, >>>>> there is problem with modal forms, which stop and wait to user action, >>>>> and >>>>> after response go on (next statement in current procedure, not other >>>>> ). >>>>> 2. ?When application is busy for long time with preparing response, >>>>> its >>>>> no chance to make simple response with message of waiting (or progress >>>>> bar) >>>> >>>> I don't see the connection of these problems with how threads are used. >>>> A simple WaitForEvent()/SetEvent() should do this. >>>> >>>>> 3. With second attempt session data is computing with different >>>>> threads, >>>>> thus thread vars can't be used >>>> >>>> They are only a problem if you use global variables. You should never >>>> use >>>> global variables, unless maybe the database connection and global >>>> application configuration. >>>> >>>> None of my 4 web applications uses global variables (except said >>>> database >>>> connection and global configuration object). The other programmers have >>>> not yet complained. They know global variables >>>> are evil from their work on our regular desktop program :-) >>> >>> How do you work to manipulate sessions? >> >> There is a global sessionlist (simple hashlist: string is session GUID, >> object is session module). >> based on the session cookie, I get the session. All other things are >> stored >> in a descendent of the session module. > > There is just a global sessionlist accessed for many threads, at the same > time? > The fpWeb framework manages thread conflicts? No, it does not. The sessionlist is not in fpWeb (although I have planned that), only in some private code (the list is obviously protected with a critical section). What conflicts do you expect ?

Conflicts type of Read/Write where 2 threads uses the same session, at the same time.
But you said the list is protected with a critical section, so... that's ok.

Now... why isn't in the fpWeb? :)

Marcos Douglas

Reply by email

Michael Van Canneyt
to Marcos Douglas
Marcos Douglas wrote 15 lines
>> >> There is just a global sessionlist accessed for many threads, at the same >> time? >> The fpWeb framework manages thread conflicts? > > No, it does not. The sessionlist is not in fpWeb (although I have planned > that), only in some private code (the list is obviously protected with a > critical section). > What conflicts do you expect ? Conflicts type of Read/Write where 2 threads uses the same session, at the same time. But you said the list is protected with a critical section, so... that's ok. Now... why isn't in the fpWeb? :)

Because it requires some changes which I must still discuss with Joost.

Michael.

Reply by email

Lee Jenkins
to Marcos Douglas: I've made ISAPI apps a long time ago... with Delphi. One connection can be used for…
Marcos Douglas wrote 28 lines
On Wed, Dec 1, 2010 at 2:07 PM, Joost van der Sluis wrote: > On Wed, 2010-12-01 at 17:05 +0100, wrote: >> >> On Wed, 1 Dec 2010, Joost van der Sluis wrote: >> >>> On Wed, 2010-12-01 at 15:51 +0100, wrote: >>>> >>>> On Wed, 1 Dec 2010, Joost van der Sluis wrote: > >>> Also check this: >>> http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1 >>> >>> The FastCGI process should return how many connection and requests it >>> can handle. I'm not sure anymore if FastCGI of fpc can handle muliple >>> requests at a time. (It could, but some parts ahve been changed) >> >> It never could. >> There is 1 connection, and all requests go through this connection. > > Yes, but this was about requests. One connection can be used for > multiple requests. Each package contain an identifier for which request > it is, so multiple request can be handled. I've made ISAPI apps a long time ago... with Delphi. One connection can be used for multiples requests, in ISAPI, but all access to RDBMS were protected (TCriticalSection). How would be with FastCGI and FPC?

In my experience, connection pooling is most common. Below is a pooling class I copied from the pooling class in tiOPF, but using TObject instead of the TtiObject base class with some extra features that I needed without a dependency on tiOPF.

http://pastebin.com/xQ3nNpHj

Basically I do this:

var
   lDM: TDataModule;
begin
   lDM := gGlobalPool.Lock;
   try
     // Get your code on
   finally;
     gGlobalPool.UnLock(lDM);
   end;
end;

The pool can contain any TObject so I frequently use it to pool other resources than database connections. The tiOPOF implementation is pretty sweet (why I copied it) and so the TObject version also uses a watch thread to destroy older, unused object to save memory, etc to maintain the number of connections, etc.

Warm Regards, Lee

Reply by email

Marcos Douglas
to Lee Jenkins
Lee Jenkins wrote 59 lines
On 12/1/2010 12:44 PM, Marcos Douglas wrote: > > On Wed, Dec 1, 2010 at 2:07 PM, Joost van der Sluis ?wrote: >> >> On Wed, 2010-12-01 at 17:05 +0100, wrote: >>> >>> On Wed, 1 Dec 2010, Joost van der Sluis wrote: >>> >>>> On Wed, 2010-12-01 at 15:51 +0100, wrote: >>>>> >>>>> On Wed, 1 Dec 2010, Joost van der Sluis wrote: >> >>>> Also check this: >>>> http://www.fastcgi.com/drupal/node/6?q=node/22#S4.1 >>>> >>>> The FastCGI process should return how many connection and requests it >>>> can handle. I'm not sure anymore if FastCGI of fpc can handle muliple >>>> requests at a time. (It could, but some parts ahve been changed) >>> >>> It never could. >>> There is 1 connection, and all requests go through this connection. >> >> Yes, but this was about requests. One connection can be used for >> multiple requests. Each package contain an identifier for which request >> it is, so multiple request can be handled. > > I've made ISAPI apps a long time ago... with Delphi. > One connection can be used for multiples requests, in ISAPI, but all > access to RDBMS were protected (TCriticalSection). > How would be with FastCGI and FPC? > In my experience, connection pooling is most common. ?Below is a pooling class I copied from the pooling class in tiOPF, but using TObject instead of the TtiObject base class with some extra features that I needed without a dependency on tiOPF. http://pastebin.com/xQ3nNpHj Basically I do this: var ?lDM: TDataModule; begin ?lDM := gGlobalPool.Lock; ?try ? ?// Get your code on ?finally; ? ?gGlobalPool.UnLock(lDM); ?end; end; The pool can contain any TObject so I frequently use it to pool other resources than database connections. ?The tiOPOF implementation is pretty sweet (why I copied it) and so the TObject version also uses a watch thread to destroy older, unused object to save memory, etc to maintain the number of connections, etc.

That is exactly I used, in my ISAPI apps, but without threads and pool, just TCriticalSection (the apps were used local net).

Marcos Douglas

Reply by email

waldo kitty
to Michael Van Canneyt: Apache performs it's own queuing, independent of FastCGI, CGI or whatever. No. You…
Michael Van Canneyt wrote 13 lines
On Fri, 3 Dec 2010, Michael Schnell wrote: > On 12/03/2010 01:32 AM, waldo kitty wrote: >> using apache as an example, if the maximum number of servers (threads) is >> reached, then requests are queued for X amount of time in the hopes that a >> server comes free to handle the request... if a server does not come free >> within X amount of time, then that request is dropped in the bitbucket... >> >> i think that the queue (bucket?) also has a limit on the number of requests >> that it will hold and if this is reached, then in FIFO fashion, the first in >> is dumped since it is also the oldest... > Do I understand correctly that Apache performs the queuing ? Apache performs it's own queuing, independent of FastCGI, CGI or whatever.

yes...

Show quoted text 6 lines
> So The FCGI interface would need to provide it with additional information > (e.g. if any or how many threads are still available) _before_ it opens a > connection to the FCGI "Server" (as this would go directly to the thread and > not to some kind of thread-scheduler). No. You probably misunderstood what Waldo wanted to say.

i think so, too...

What he said pertains to the inner workings of Apache, and is independent of how a particular request is handled. It pertains to how Apache handles new connections on its HTTP socket. No more, no less.

exactly... i offered how apache does it as an example so that those doing the FCGI stuff could see how a mainstream app does this and maybe they would not see any problems implementing it...

Reply by email

Michael Van Canneyt
to waldo kitty
waldo kitty wrote 8 lines
> What he said pertains to the inner workings of Apache, and is independent > of how > a particular request is handled. It pertains to how Apache handles new > connections on its HTTP socket. No more, no less. exactly... i offered how apache does it as an example so that those doing the FCGI stuff could see how a mainstream app does this and maybe they would not see any problems implementing it...

'those' - that would be me and/or Joost van der Sluis :-)

Michael.

Reply by email

waldo kitty
to Michael Van Canneyt
Michael Van Canneyt wrote 13 lines
On Fri, 3 Dec 2010, waldo kitty wrote: >> What he said pertains to the inner workings of Apache, and is independent of how >> a particular request is handled. It pertains to how Apache handles new >> connections on its HTTP socket. No more, no less. > > exactly... i offered how apache does it as an example so that those doing the > FCGI stuff could see how a mainstream app does this and maybe they would not > see any problems implementing it... 'those' - that would be me and/or Joost van der Sluis :-)

ahhh, ok :)

i was misunderstanding that someone else (or more) was wanting to do this in their code for this... likely i was confused by the several "Michael" persons that are on the list...

Reply by email

Graeme Geldenhuys
to Dariusz Mazur: W dniu 2010-12-02 11:38, pisze: At the beginning I use second attempt, after that first.…

Hi,

No I'm not the list moderator (he/she seems asleep). Can Dariusz, Michael, Marcos etc please stop quoting such a lot of the previous messages. We can all read the previous message if needed. Currently your new posts contain 90% quotes and 3-5 lines of new text.

This is very annoying to read and a waist of bandwidth!

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Marco van de Voort
to Michael Schnell: As creating process is a time consuming effort in Windows, fast-cgi-ing already running…
Michael Schnell wrote 12 lines
OTOH, If doing Windows, Microsoft of course wants you to use IIS. Microsoft IIS provides the ISAPI interface between the webserver and the cgi program, that in this case is neither a program nor a service, but a DLL. ISAPI offers similar features like FGCI but in a Windows-centric way. A colleague of mine (using Delphi) did a quite complex application based on ISAP. it's running just fine for a lot of customers. In fact he did an ISAPI "proxy" DLL, that communicates with a service (or program). This way debugging is a lot easier than directly debugging the ISAPI DLL.

In my previous job, we also did this for a delphi app, but the isapi<->service framework was bought in (webhub, href.com).

This framework also abstracted Apache and IIS.

Reply by email