Shrinavat 16 Posted January 31, 2019 42 minutes ago, Primož Gabrijelčič said: You should change the code to: Thank, @Primož Gabrijelčič. That works. And what about my question #1 (numTasks)? Share this post Link to post
Primož Gabrijelčič 223 Posted January 31, 2019 You have: Renderer := Parallel.ParallelTask.NumTasks(numTasks).NoWait .Execute( procedure begin workItem := RenderQueue.Next; ... end); and then: for iTask := 0 to numTasks-1 do begin TileSource := workItem.Data['TileSource' + iTask.ToString]; RenderQueue.Add(TOmniValue.Create([iTask, TileSource])); end; If you change only the parameter to `ParallelTask.NumTasks`, some tasks won't ever get data because you'll schedule only `numTasks` items to `RenderQueue`. 1 Share this post Link to post
Shrinavat 16 Posted February 8, 2019 On 1/31/2019 at 1:58 PM, Primož Gabrijelčič said: `workItem.Result` is a record property. Because of that, this code: workItem.Result.AsOwnedObject := TBitmap32.Create(256,256); is equivalent to running: var tmp: TOmniValue; tmp := workItem.Result; tmp.AsOwnedObject := TBitmap32.Create(256,256); And that fails. You should change the code to: var tmp: TOmniValue; tmp.AsOwnedObject := TBitmap32.Create(256,256); workItem.Result := tmp; I'll see if I can change the implementation of `IOmniWorkitem` to prevent such problems. @Primož Gabrijelčič Do you have any progress for this issue fix? There are no new commits on github. Current workaround with using extra variable is not very elegant, although it works. Share this post Link to post
Primož Gabrijelčič 223 Posted February 10, 2019 On 2/8/2019 at 7:46 AM, Shrinavat said: @Primož Gabrijelčič Do you have any progress for this issue fix? There are no new commits on github. Current workaround with using extra variable is not very elegant, although it works. No, and don't expect one soon. There are more urgent issues to be fixed before. 1 Share this post Link to post