[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 21:41:44 CEST 2010


On Fri, 15 Oct 2010 18:26:59 +0200, Andrew Brunner
<andrew.t.brunner at gmail.com> wrote:

> Externally suspending a thread *IS* absolutely unsafe.

At least we're on the same page here. :)

> But the notion of suspending an ENGINE at runtime externally is
> totally expected.
> The thread itself MUST put itself in a suspended state.

Yes. This could be done. Yet, there's no way of knowing if the
thread is actually suspended without some sort of answer from
the to be suspended thread, means you'd need synchronisation again.

A possible solution would be to lower the to be suspended thread's
priority below that of the Idle-Task. Yet, there are very few
systems that provide such kind of asynchronous thread control and
AFAIK none of them is an FPC target.

(Sorry, Andrew. Freaking different mail program. I'm sooo used to
press "R" for Reply To Mailinglist...)


Vinzent.



More information about the fpc-pascal mailing list