[Lazarus] GUI development for web UI
Lee Jenkins
lee at datatrakpos.com
Fri Dec 3 14:41:29 CET 2010
On 12/1/2010 12:44 PM, Marcos Douglas wrote:
> On Wed, Dec 1, 2010 at 2:07 PM, Joost van der Sluis<joost at cnoc.nl> wrote:
>> On Wed, 2010-12-01 at 17:05 +0100, michael.vancanneyt at wisa.be wrote:
>>>
>>> On Wed, 1 Dec 2010, Joost van der Sluis wrote:
>>>
>>>> On Wed, 2010-12-01 at 15:51 +0100, michael.vancanneyt at wisa.be 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
More information about the Lazarus
mailing list