Sign in Join

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

Mailing lists / lazarus / 2018-02

Doe fpc/lazarus already have System-Threading or is it planned

9 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Sven Barth

Am 02.02.2018 11:25 schrieb "Michael Schnell via Lazarus" <

:

Featuring "parallel loops", "future variables", etc, implemented via a thread pool that is transparent for the application programmer.

-> http://docwiki.embarcadero.com/Libraries/Tokyo/de/System.Threading

It only relies on already existing functionality (except for those overloads that take a TProc), so feel free to implement this for FPC as no one is planning to implement it currently, so first come, first serve.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180202/297ffcb7/attachment.html>

Reply by email

Zoë Peterson
to Michael Schnell: Featuring "parallel loops", "future variables", etc, implemented via a thread pool that…
Michael Schnell wrote
Featuring "parallel loops", "future variables", etc, implemented via a thread pool that is transparent for the application programmer.

System.Threading requires anonymous methods, which Free Pascal doesn't currently support. Someone has been working on those, but it's hard to say when they'll be ready for merging. Once that's done someone could start implementing System.Threading, though personally I'd probably just look into adding FPC support to OmniThreadLibrary at that point.

Zoë Peterson Scooter Software

Reply by email

Zoë Peterson
to Zoë Peterson
Zoë Peterson wrote
System.Threading requires anonymous methods, which Free Pascal doesn't currently support.

Oops, Sven's right, it mostly doesn't use anonymous methods, so this isn't a blocker.

Zoë Peterson Scooter Software

Reply by email

R0b0t1
to Zoë Peterson
Zoë Peterson wrote 10 lines
On 2/2/2018 10:19 AM, Zoë Peterson wrote: > > System.Threading requires anonymous methods, which Free Pascal doesn't > currently support. Oops, Sven's right, it mostly doesn't use anonymous methods, so this isn't a blocker.

I've been looking for a replacement to
http://www.omnithreadlibrary.com/ for a long time. If I remember, the dealbreaker is the library's codebase making heavy use of anonymous functions and procedures.

Does System.Threading expose an API that could take either code references or anonymous methods? I'm very interested.

Cheers,
R0b0t1

Reply by email

Zoë Peterson
to R0b0t1
R0b0t1 wrote
I've been looking for a replacement to http://www.omnithreadlibrary.com/ for a long time. If I remember, the dealbreaker is the library's codebase making heavy use of anonymous functions and procedures.

Yeah, OTL requires anonymous methods. I was hoping to port it to FPC once the anonymous method support landed, but AFAICT the cross platform port got pushed into OTL v4 and it looks like that stalled a year ago.

Does System.Threading expose an API that could take either code references or anonymous methods? I'm very interested.

Yes, System.Threading has both "reference to procedure" and "procedure of object" overloads in the API, so you could implement most of it in the current FPC release. As Sven said, though, no one has started on it, and anyone who did work on it would have to be careful to not taint it with code from Delphi's implementation.

Zoë Peterson Scooter Software

Reply by email

Sven Barth
to Zoë Peterson

Am 02.02.2018 21:08 schrieb "Zoë Peterson via Lazarus" <

:
R0b0t1 wrote 5 lines
I've been looking for a replacement to http://www.omnithreadlibrary.com/ for a long time. If I remember, the dealbreaker is the library's codebase making heavy use of anonymous functions and procedures.

Yeah, OTL requires anonymous methods. I was hoping to port it to FPC once the anonymous method support landed, but AFAICT the cross platform port got pushed into OTL v4 and it looks like that stalled a year ago.

Once FPC supports anonymous functions as well I assume that support will start to become alive again. ;)

Does System.Threading expose an API that could take either code

references or anonymous methods? I'm very interested.

Yes, System.Threading has both "reference to procedure" and "procedure of object" overloads in the API, so you could implement most of it in the current FPC release. As Sven said, though, no one has started on it, and anyone who did work on it would have to be careful to not taint it with code from Delphi's implementation.

The suggested way is to write tests for the Delphi implementation and to implement the FPC one based on those tests and the Delphi documentation.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180202/5924c06d/attachment-0001.html>

Reply by email

Zoë Peterson
to Sven Barth
Sven Barth wrote
Once FPC supports anonymous functions as well I assume that support will start to become alive again. ;)

Hopefully. They were already working on iOS/Android/macOS/Linux support using Delphi, and that's what's stalled. The last commit on the v4 branch was a year ago. I looked into at least getting FPC on Windows running with Blaise's closure branch in Nov/Dec, but stopped because of that and the missing generics. Primož did respond favorably when I asked him about adding FPC support though.

Zoë Peterson Scooter Software

Reply by email