A.M. Hoornweg 144 Posted October 29 Hello all, just a short question: is System.Threading.tParallelarray not usable with interfaces? The following won't compile: Type iDownloadJob=Interface [{3d24b7a2-6111-46e7-a281-7fdc318be5c4}] procedure Download; end; procedure test; var x: array of iDownloadJob; temp:Integer; begin // ..... fill the array here .... temp:=tParallelArray.ForThreshold; tParallelArray.ForThreshold:=1; try tParallelArray.&For<iDownloadJob>(x, procedure (const AValues: array of iDownloadJob; AFrom, ATo: NativeInt) var i:NativeInt; begin for i:=AFrom to ATo do aValues[i].Download; end); finally tParallelArray.ForThreshold:=temp; end; end; It would be just my luck if such a nice new feature doesn't work for me 😞 . Share this post Link to post
Dalija Prasnikar 1404 Posted October 29 It compiles for me... but after adding missing quotes in interface GUID declaration. TParallelArray is not the problem here. Share this post Link to post
Lars Fosdal 1793 Posted October 29 @A.M. Hoornweg It is always helpful to indicate what kind of error you get, and where you get it. 1 Share this post Link to post
A.M. Hoornweg 144 Posted November 1 On 10/29/2024 at 11:04 AM, Dalija Prasnikar said: It compiles for me... but after adding missing quotes in interface GUID declaration. TParallelArray is not the problem here. This is a totally weird experience. Tuesday my compiler kept saying "There is no overloaded version of tParallelArray.For ... that can be called with these arguments" and I searched in vain for the cause. Then something came up and I had to abandon the project for a few days. Today I resumed working on it and it compiled just fine - I had changed nothing! I think that something got corrupted in the memory of the IDE process on Tuesday and the reboot just made it go away... I do have regular exceptions in the IDE since installing the inline update for 12.2 (build nr 29.0.53982.0329). Anyway, I'm thrilled that I can continue now. Share this post Link to post