[fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64
Vinzent Höfler
JeLlyFish.software at gmx.net
Fri Oct 15 23:12:45 CEST 2010
On Fri, 15 Oct 2010 22:50:29 +0200, Jonas Maebe
<jonas.maebe at elis.ugent.be> wrote:
> On 15 Oct 2010, at 22:31, Vinzent Höfler wrote:
>
>> - Suspend/Resume should be gone (you can't guarantee it to work,
>> so there's no point in doing it at all)
>
> FWIW, they're deprecated since Delphi 2009, so they will disappear over
> time. To resume a tthread created with fcreatesuspended=true, they
> introduced a new "Start" method (which does basically the same as
> Resume, but it's not deprecated).
So they already stole my idea! ;) Seriously that's good to hear,
because it solves some of the possible compatibility issues. If
users complain they can be told: "Delphi is doing it, too", then. ;)
>> - FreeOnTerminate should be gone, (meaning no way to actively call
>> TThread.Destroy from another thread, a thread gets destroyed
>> automatically when it leaves its execute method)
>> (IIRC FreeOnTerminate was even set to False by the default
>> constructor, so you had the choice of either using the default
>> or introducing a race condition by setting it after the
>> "inherited Create" - which starts the execute.)
>
> This problem has been solved with
> http://bugs.freepascal.org/view.php?id=16884
Yes. But isn't that precisely the (forced) thread suspension on
creation, Andrew is complaining about?
Vinzent.
More information about the fpc-pascal
mailing list