Showing posts with label Spring4D. Show all posts
Showing posts with label Spring4D. Show all posts

Saturday, June 28, 2025

ComputeCore - A Simple Parallel Task Framework

Today, I want to talk about a small multithreading kernel (framework, library, or whatever you want to call it) that I've recently helped develop for the Spring4D project.

ComputeCore is a lightweight parallel processing framework for Delphi that lets you easily run CPU-intensive tasks across multiple threads. Its goals are straightforward: to run (possibly compute-heavy) tasks concurrently, allow tasks to spawn child tasks, and expose a very simple interface for the caller.

It will eventually be published as Spring.Threading, but until that happens, we can examine the almost-final version at https://github.com/gabr42/ComputeCore. In Spring4D, it will run the parallel implementation of the new sorting algorithm, but that doesn't mean it is only useful for one specific job! It is indeed a completely open (although intentionally simple) framework that can be used for your projects too.

[This article was written with the help of an AI. My next article will explain this decision and the writing process.]

Monday, April 29, 2019

Spring4D European Conference 2019 sessions

Slides and code for the Spring4D conference are now published on the conference page.

Slides and code for my two sessions – Design patterns with Spring4D and Interception and dynamic proxy – are also available on my presentations page.

Tuesday, March 26, 2019

Spring conference, spring edition

Hurry up, you only have five (5) days left to get a Spring4D European Conference ticket at the regular price!


Spring 4D Logo


It’s gonna be a blast! Stefan will be there, of course (can you imagine Spring 4D without him in the picture?), and so will be I. There will be a ton of interesting sessions, and lots of time for eye-to-eye discussions. Marco has announced his presence, I’ll be bringing my books (or you can bring your own copy, if you already own it and want it signed), Stefan will be accepting musical requests (not really ;) ) …

You can join us for a day or two. Your call, but I would certainly recommend the latter, because this conference will ROCK!

“Bee there Orr Bee A Rectangular Thyng
- The Band With Rocks In *

Friday, December 08, 2017

Spring4D presentation slides and more

Slides and code for my Spring4D presentation are now online on the Presentations page.

And to the participants of the workshop, here's the answer I promised.

If you want to catch all calls to some function while mocking, you can pass in Arg.IsAny (or call some other function of the TArg type, defined in Spring.Mocking.Matching).

I have added an example to the Mocking project.

mockCalc.Setup.Returns(4).When.AddTwo(2);
mockCalc.Setup.Executes(
  function(const callInfo: TCallInfo): TValue
  begin
    lbLog.Items.Add('Don''t know how to handle ' + callInfo.Method.Name +
     
'(' + IntToStr(callInfo.Args[0].AsInteger) + ')');

  end).When.AddTwo(Arg.IsNotIn([2]));

Or you can pass Args.Any to the When function. In that case, the argument passed to AddTwo is ignored.

mockCalc.Setup.Returns(-1).When(Args.Any).AddTwo(0);


Friday, December 01, 2017

In the middle of winter, Spring comes to Ljubljana

Indeed, it is snowing for the last three days. Not much, but winter is definitely here.

To add some green to the white surroundings we'll spend the next Friday talking about spring. Or, actually Spring. For Delphi. Also known as Spring4D - definitely the best Delphi collection of programming goodies that you can find around.

If you speak Slovenian language (sorry, almost all of the world population), you're welcome to my workshop about that ingenious library. If not, you'll have to find that information somewhere else, sorry. Or you can learn Slovenian and come to Ljubljana. Where else can you listen about Delphi in a session targeted to only 2 millions of humans?

Programerji smo včasih malo leni in iščemo bližnjice. Odlične programe bi radi napisali s kar najmanj kode. Pri tem nam pomaga tudi fleksibilnost jezika Delphi in odlične programerske knjižnice.

Tokrat si bomo ogledali knjižnico Spring4D, ki prinaša množico malih pripomočkov in bljižnic za pametne programerje - od objektov, ki jih ni treba sproščati, do razredov, ki jih ni treba inicializirati in seznamov, po katerih se lahko sprehajamo, jih filtriramo, povezujemo in še in še.

Za nameček bomo podrobneje obdelali še tehniko Dependency Injection in si - bolj za zabavo, kot zares - ogledali še, kako lahko v Delphiju s tehniko odzivnega programiranja ReactiveX dogodke obravnavamo čisto drugače kakor smo navajeni.


Izkoristite priložnost in spoznajte kako lahko hitreje napišete odlične programe. Vabljeni v petek, 8. decembra, ob 9.00 uri, v predavalnico Obrtne zbornice Vič.