Bug 24074 – Reference to struct not working, when executed as a task

Status
NEW
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-08-06T13:04:47Z
Last change time
2024-12-01T16:41:36Z
Assigned to
No Owner
Creator
Joshua Wohlleben
Moved to GitHub: phobos#9861 →

Attachments

IDFilenameSummaryContent-TypeSize
1883pi_ref.dThis file contains the pi benchmark implementation using referencestext/x-dsrc2971

Comments

Comment #0 by js.wohlleben — 2023-08-06T13:04:47Z
Created attachment 1883 This file contains the pi benchmark implementation using references I tried to execute a function, that takes a struct reference, as a task. This doesnt work. If I use a pointer instead, the code runs just fine. The "pi_ref.d" example uses the "ref"-keyword and doesnt work. The code calculates pi with different threads. Execute for example with ./pi 2000000000 4 to monitor behaviour. Expected output: 3.14159 Actual output: nan, because it is passed as a value, not as a reference
Comment #1 by robert.schadek — 2024-12-01T16:41:36Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9861 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB