Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-06

TThread extensions

25 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Schnell

HI fpc team,

for doing an extension to the Lazarus LCL, I need the "TThread extensions" such as
- CurrentThread,
- Queue, and
- GetTickCount64

It already works fine with the svn version of fpc.

I installed the "official" X86-64 fpc release (Debian Package, provided by the Debian store). This is version 2.6.0-9 and it does not have the TThread extensions.

So my questions are:
- what is the current official version ?
- does it have the TThread extensions ?
- is there a Debian Package with this version (X86-32, X86-64, and ARM (BeagleBone) ), and where to find it ?

Thanks,
-Michael

Reply by email

Sven Barth
to Michael Schnell
"Michael Schnell" wrote
- what is the current official version ?

2.6.4

- does it have the TThread extensions ?

No

- is there a Debian Package with this version (X86-32, X86-64, and ARM

(BeagleBone) ), and where to find it ?
We had some problems with building Deb packages when we released, I don't know whether they were resolved in the meantime...

Regards,
Sven

Reply by email

Michael Schnell
to Sven Barth
Sven Barth wrote 8 lines
Am 26.06.2014 14:22 schrieb "Michael Schnell" < >: > - what is the current official version ? 2.6.4 > - does it have the TThread extensions ? No

So I supposedly need to hold off this projects :-( .

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 9 lines
On 06/26/2014 02:27 PM, Sven Barth wrote: Am 26.06.2014 14:22 schrieb "Michael Schnell" : >  - what is the current official version ? 2.6.4 >  - does it have the TThread extensions ? No So I supposedly need to hold off this projects :-( .

What kind of argument is that ?

Trunk is quite stable, the functionality you need is present since ages.

You can perfectly just develop with trunk and be ready to release when the trunk version is released as a stable version. If you want to wait for trunk to be released to start your project, you're needlessly restricting yourself.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
Trunk is quite stable, the functionality you need is present since ages.

Did I commit inappropriate phrasing ?

I meant, I need to hold off the enhancement I have in mind until an rtl version that provides TThread.Queue is officially released, as this project is simply not doable without TThread.Queue.

More explicit;
I need an Event queue, and IMHO for this project it is not appropriate at all to implement a second Event queue, while the rtl with TThread.Queue provides a perfectly usable one. As I do not practically need any working program (and in fact can create one using the svn fpc version, if I should need one) I can happily wait. But for implementing something in a once-to-be-released Lazarus LCL, it can't rely on a not released fpc version.

Am I wrong ?
-Michael

P.S.: perhaps the project is not even doable (in a perfectly compatible way) with the (Delphi compatible) implementation of TThread.Queue. (I just would need to be able to feed an Event in the Queue, but those means are "private" in TThread.) So maybe the holdoff will be forever.

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 10 lines
On 06/26/2014 02:53 PM, Michael Van Canneyt wrote: > > > Trunk is quite stable, the functionality you need is present since ages. > Did I commit inappropriate phrasing ? I meant, I need to hold off the enhancement I have in mind until an rtl version that provides TThread.Queue is officially released, as this project is simply not doable without TThread.Queue.

You clearly didn't understand my remark. Please re-read it.

Michael.

Reply by email

Mattias Gaertner
to Michael Schnell: Did I commit inappropriate phrasing ? I meant, I need to hold off the enhancement I have…
Show quoted text 9 lines
[...] More explicit; I need an Event queue, and IMHO for this project it is not appropriate at all to implement a second Event queue, while the rtl with TThread.Queue provides a perfectly usable one. As I do not practically need any working program (and in fact can create one using the svn fpc version, if I should need one) I can happily wait. But for implementing something in a once-to-be-released Lazarus LCL, it can't rely on a not released fpc version.

1. The nogui LCL functions can be implemented without this.
2. If you insist using the new RTL features, then add the LCL features using $IFs.

Am I wrong ?

Were you ever?

Mattias

Reply by email

Michael Schnell
to Michael Van Canneyt: You clearly didn't understand my remark. Please re-read it. Michael.
Michael Van Canneyt wrote
You clearly didn't understand my remark. Please re-read it.

OK.

So your point is that I can do the development and hold-off just the release.

If so:

- The development of the functionality (using the svn release of fpc) id done and seems to work just fine
- For "release" I would need to work with the Lazarus team. Here the discussion is whether or not this makes sense if it will not compile with the (currently) released fpc rtl.

Finally: maybe for perfect compatibility with existing Lazarus WidgetTypes maybe even the current svn version (TThread.Queue implementation) might be not usable (as it is said to do a direct call instead of a schedule when called from the Main thread <for Delphi compatibility>). Here I maybe would need yet another (non TThread-private) function to push an Event in the Queue (say class procedure TThread.QueueDirect). I'll take a look at this ASAP.

-Michael

Reply by email

Michael Schnell
to Mattias Gaertner: On Thu, 26 Jun 2014 15:20:39 +0200 1. The nogui LCL functions can be implemented without…
Mattias Gaertner wrote
2. If you insist using the new RTL features, then add the LCL features using $IFs.

I do not _need_ anything. I just want to enhance the functionality in the best possible way, if I can.

With the ActiveNoGUI Application there is no sensible way to implement Application.QueuAsyncCall without using TThread.Queue (or similar). I will not implement a second Event Queue.

Using $IFs I already did a working implementation that with the released fpc RTL does provide TTimers (but not in a really decent way) but not Application.QueuAsyncCall. I am not up to "release" this.

-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 9 lines
On 06/26/2014 03:34 PM, Mattias Gaertner wrote: > 2. If you insist using the new RTL features, then add the LCL features > using $IFs. I do not _need_ anything. I just want to enhance the functionality in the best possible way, if I can. With the ActiveNoGUI Application there is no sensible way to implement Application.QueuAsyncCall without using TThread.Queue (or similar). I will not implement a second Event Queue.

You can do it like the nogui widgetset. Application.QueuAsyncCall works there.

Using $IFs I already did a working implementation that with the released fpc RTL does provide TTimers (but not in a really decent way) but not Application.QueuAsyncCall. I am not up to "release" this.

Why not?

Mattias

Reply by email

Michael Van Canneyt
to Michael Schnell: OK. So your point is that I can do the development and hold-off just the release. If so:…
Michael Schnell wrote 8 lines
On 06/26/2014 03:31 PM, Michael Van Canneyt wrote: > > > You clearly didn't understand my remark. Please re-read it. > OK. So your point is that I can do the development and hold-off just the release.

Give the man a cigar and a drink ;)

Show quoted text 8 lines
If so: - The development of the functionality (using the svn release of fpc) id done and seems to work just fine - For "release" I would need to work with the Lazarus team. Here the discussion is whether or not this makes sense if it will not compile with the (currently) released fpc rtl.

The lazarus team makes pretty sure that Lazarus compiles with released and trunk versions.

Really, I think you are looking for problems where there are none.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
The lazarus team makes pretty sure that Lazarus compiles with released and trunk versions.

Yep. Exactly this is why my would-be LCL enhancement needs to wait until the next fpc release.

Really, I think you are looking for problems where there are none.

You need to see that I do not want to do an application (that already works just fine), but an enhancement to the LCL.

-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 5 lines
On 06/26/2014 04:34 PM, Michael Van Canneyt wrote: > > Strange. I came to exactly the opposite conclusion. > Sorry. I am not able to understand your argument :-( .

Why can't you use trunk and $IFs like everyone else?

Mattias

Reply by email

Michael Schnell
to Mattias Gaertner
Mattias Gaertner wrote
Why can't you use trunk and $IFs like everyone else?

I do _need_ TThread.Queue (and I do _need_ TThread.GetTickCount64 (or another decent timing source).

The released rtl version does not have TThread.Queue and for timing only fpgettimeofday() is provided, which is not a "permanent ticker"-source but jumps back and foreword when the UTC system time is updated.

Hence I of course can use $ifs to make it compilable with the released rtl version but it will have no

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 11 lines
On 06/26/2014 07:49 PM, Mattias Gaertner wrote: > Why can't you use trunk and $IFs like everyone else? I do _need_ TThread.Queue (and I do _need_ TThread.GetTickCount64 (or another decent timing source). The released rtl version does not have TThread.Queue and for timing only fpgettimeofday() is provided, which is not a "permanent ticker"-source but jumps back and foreword when the UTC system time is updated. Hence I of course can use $ifs to make it compilable with the released rtl version but it will have no other words: Nothing stops you, except yourself.

Mattias

Reply by email

Michael Schnell
to Michael Schnell: Did I commit inappropriate phrasing ? I meant, I need to hold off the enhancement I have…
Michael Schnell wrote 9 lines
P.S.: perhaps the project is not even doable (in a perfectly compatible way) with the (Delphi compatible) implementation of TThread.Queue. (I just would need to be able to feed an Event in the Queue, but those means are "private" in TThread.) So maybe the holdoff will be forever.

I checked the code of TThread.Queue and in fact it does not queue the call if TThread.Queue is executed from the main thread, but performs the call right away.

This supposedly is not compatible with how Application.QueueAsyncCall works in other WidgetTypes.

Unfortunately the svn-version of the rtl does not provide a means to prevent this (queer, Delphi compatible) behavior.

So for full compatibility we would need an enhancement in the fpc-rtl.

-Michael

Reply by email

Michael Schnell
to Michael Van Canneyt: What kind of argument is that ? Trunk is quite stable, the functionality you need is…
Michael Van Canneyt wrote
You can perfectly just develop with trunk and be ready to release when the trunk version is released as a stable version.

I finally was able to try to implement a version of my "interface" unit that is supposed to work with the trunk version i.e. without using TThread.Queue.

While it is possible to use TThread's "waking" mechanism by means of GetThreadManager() --> RTLEventResetEvent, pushing events in TThread's queue is not possible because ThreadQueueLock and ThreadQueueTail are private in TThread and hence can't be accessed by my code.

-Michael

Reply by email