On 24/10/17 12:59, Mattias Gaertner via Lazarus wrote:
> ASystemTime is a stack variable. That's thread-safe.
>
> In fpc trunk it calls GetLocalTime on Unix, which fetches timezone
> every time. No global var. So it should be thread safe.
>
>> because each thread instance would have its own
Am 24.10.2017 13:41 schrieb "el es via Lazarus" <
lazarus@lists.lazarus-ide.org>:
On 24/10/17 10:04, Mattias Gaertner via Lazarus wrote:
> On Tue, 24 Oct 2017 08:59:36 +0100
> el es via Lazarus wrote:
>
>> On 23/10/17 20:00, Giuliano Colla via Lazarus wrote:
>>
On Tue, 24 Oct 2017 12:41:11 +0100
el es via Lazarus wrote:
>[...]
> Now() is literally
>
> function Now : TDateTime;
> var ASystemTime : TSYSTEMTIME;
> begin
>GetSystemTime(ASystemTime);
>Result := SystemTimeToDateTime(ASystemTime);
> end;
>
> on my
On 24/10/17 10:04, Mattias Gaertner via Lazarus wrote:
> On Tue, 24 Oct 2017 08:59:36 +0100
> el es via Lazarus wrote:
>
>> On 23/10/17 20:00, Giuliano Colla via Lazarus wrote:
>> [snip]
>>
>> I don't remember if I was hitting AV using Now(), likely I wasn't -
>>
On 24/10/17 10:20, Michael Schnell via Lazarus wrote:
> On 24.10.2017 10:48, el es via Lazarus wrote:
>> [...]
begin
repeat
until not ThreadNowInUse; //
try
ThreadNowInUse :=true;
>>>
> Busy wait actions are usually a very bad idea
>
> Better use a
On Tue, 24 Oct 2017, Mattias Gaertner via Lazarus wrote:
On Tue, 24 Oct 2017 11:11:15 +0200 (CEST)
Michael Van Canneyt via Lazarus wrote:
[...]
From memory:
The first call to Now is not necessarily thread-safe, because of the
initialization of TZ info ?
On Tue, 24 Oct 2017 11:11:15 +0200 (CEST)
Michael Van Canneyt via Lazarus wrote:
>[...]
> From memory:
> The first call to Now is not necessarily thread-safe, because of the
> initialization of TZ info ?
Please add this to the docs.
Mattias
--
On 24.10.2017 11:29, Mattias Gaertner via Lazarus wrote:
Are you kidding?
If this is not appropriate, I suppose the general design of that
functionality should be reconsidered, doing anything that needs a fast
reaction in the worker thread.
-Michael
--
On Tue, 24 Oct 2017 11:20:50 +0200
Michael Schnell via Lazarus wrote:
> On 24.10.2017 10:48, el es via Lazarus wrote:
> > [...]
> >>> begin
> >>>repeat
> >>>until not ThreadNowInUse; //
> >>>
> >>>try
> >>> ThreadNowInUse :=true;
> >>
On 24.10.2017 10:48, el es via Lazarus wrote:
[...]
begin
repeat
until not ThreadNowInUse; //
try
ThreadNowInUse :=true;
Busy wait actions are usually a very bad idea
Better use a TTimer for such.
-Michael
--
___
Lazarus
On Tue, 24 Oct 2017, Mattias Gaertner via Lazarus wrote:
On Tue, 24 Oct 2017 08:59:36 +0100
el es via Lazarus wrote:
On 23/10/17 20:00, Giuliano Colla via Lazarus wrote:
[snip]
I don't remember if I was hitting AV using Now(), likely I wasn't -
but due to
On Tue, 24 Oct 2017 08:59:36 +0100
el es via Lazarus wrote:
> On 23/10/17 20:00, Giuliano Colla via Lazarus wrote:
> [snip]
>
> I don't remember if I was hitting AV using Now(), likely I wasn't -
> but due to 'normal' Now() being not thread safe, I was getting
Am 24.10.2017 10:49 schrieb "el es via Lazarus" <
lazarus@lists.lazarus-ide.org>:
On 24/10/17 09:11, Mattias Gaertner via Lazarus wrote:
> On Tue, 24 Oct 2017 08:59:36 +0100
> el es via Lazarus wrote:
>
>> [...]
>> begin
>> repeat
>> until not ThreadNowInUse;
On 24/10/17 09:11, Mattias Gaertner via Lazarus wrote:
> On Tue, 24 Oct 2017 08:59:36 +0100
> el es via Lazarus wrote:
>
>> [...]
>> begin
>> repeat
>> until not ThreadNowInUse; //
>>
>> try
>> ThreadNowInUse :=true;
>
> This is not thread safe.
>
On Tue, 24 Oct 2017 08:59:36 +0100
el es via Lazarus wrote:
>[...]
> begin
> repeat
> until not ThreadNowInUse; //
>
> try
> ThreadNowInUse :=true;
This is not thread safe.
Mattias
--
___
Lazarus mailing
On 23/10/17 20:00, Giuliano Colla via Lazarus wrote:
[snip]
I don't remember if I was hitting AV using Now(), likely I wasn't -
but due to 'normal' Now() being not thread safe, I was getting inconsistent
timing results, when I used Now() both in main thread and in the thread;
So with my
On Mon, 23 Oct 2017 22:50:49 +0200
Giuliano Colla via Lazarus wrote:
> Il 23/10/2017 21:33, Sven Barth via Lazarus ha scritto:
> > How do you pass the SendMessage() method to your thread? And how does
> > the code look that calls it?
> >
> The SendMessage()
Il 23/10/2017 21:33, Sven Barth via Lazarus ha scritto:
How do you pass the SendMessage() method to your thread? And how does
the code look that calls it?
The SendMessage() method belongs to the main thread only, and is
supposed to execute only in the main thread context.
It fills up a
Am 23.10.2017 21:00 schrieb "Giuliano Colla via Lazarus" <
lazarus@lists.lazarus-ide.org>:
I'm doing something wrong, I'm missing something, or this is just a
compiler bug?
How do you pass the SendMessage() method to your thread? And how does the
code look that calls it?
Regards,
Sven
--
I have stumbled into what appears to me to be a compiler error,
but before I post in the fpc list, I'd like to get expert advice.
I have an application already in use since many years, which uses
a thread to handle a serial line. I don't know if that second
thread
20 matches
Mail list logo