[Lazarus] Threads in Lazarus code base
idokan at gmail.com
Wed Sep 15 16:30:50 CEST 2010
On Wed, Sep 15, 2010 at 15:34, Florian Klaempfl <florian at freepascal.org>wrote:
> Am 15.09.2010 15:26, schrieb ik:
> > On Wed, Sep 15, 2010 at 15:16, Florian Klaempfl <florian at freepascal.org
> > <mailto:florian at freepascal.org>> wrote:
> > Am 15.09.2010 13:56, schrieb Michael Schnell:
> > > My impression is that regarding the OS-interface of a program that
> > needs
> > > the said features (multiple "logical threads", performance,
> > > making use of modern SMP systems, ...), threads are a necessity.
> > > programming languages might be able to in many cases hide the dirty
> > > details from the programmer (e.g. "parallel" loops, see the Delphi
> > Prism
> > > and/or .NET documentation on these issues.) If FPC could be
> > enhances tn
> > > that direction it might be a decent improvement.
> > The parallel loop solves nothing which makes threading hard and is
> > a cheap excuse. The real problems of threading are synchronization
> > especially abording threads e.g. triggered by the main thread.
> > So how do you do multiple sub routines "at the same time", or some tasks
> > that will hang your system but you require it to function even when it
> > does the heavy work ?
> It depends on the application. But as I said before: aborting something
> like a parallel loop because the user pressed e.g. ESC isn't easy either.
Here is a real thing I've made using threads (and a thread pool). I would be
glad to know how to do it without it:
I have a PHP script that accept web service request. That's triggers a Ruby
(that version 1.8x and bellow uses green threads) daemon to start a call
into Asterisk PBX.
The thing is that I can have many requests at the same time. And I need to
answer each request up to 3 seconds worst case.
If I have more then one request per second, how would you do it without
threads or blocking the daemon in responding into additional requests "at
the same time" ?
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus